Explore BrainMass
Share

C++

C++ I/O File streams

Write a C++ program to read from a file and sort into seperate arrays. See attached for more info.

C++ String Class Counter

Write function to count the number of sentences entered into a string class. Assume a sentence ends in either a period, question mark or exclamation mark. Count the number of words as well as the sentences and return and average the number of words per sentence. Attached is what I have done so far.

Matrix Multiplication Program Using Arrays

Attached are the requirements for the program. You are going to write a program to multiply two matrices. The matrices are stored in a two-dimensional array: int[][] matrixA int[][] matrixB Recall: Here is the way to declare a two-dimensional array: int testArray[3][4] = {{1,2,3,4},{2,3,4,1},{5,4,3,0}}; // three rows,

Write down a C++ record type, purchaseType

I would appreciate if anyone can provide me answers for Q4 & 5 only. Kindly save in words document. Using Visual Basic 2005 (C++) There is slight amendments. Q4d: The equation should be: final Sales Amount=(1-Discount/100)*Sales Amount

Classes and Data Abstraction

Consider the definition of the following class: class CC { public: CC(); //Line 1 CC(int); //Line 2 CC(int, int); //Line 3 CC(double, int); //Line 4 . . . private: int u; double v; }; a) Give the line number containing the constructor that is executed in each of the follow

Classes and Data Abstraction

See attachment. Please do not make the code very complicated on this C++ program. The topic is Classes and Data Abstraction. Please make sure to use this concept for the program.

Buffer-overflow is a common computer security concern

Please help with the following problem. Buffer-overflow is a common computer security concern. Write a simple program, in C, C++, and Java, to declare a simple one-dimensional array and then attempt to access an array element that is not within its bounds. For example, what happens if I declare an array to be in studentNums[

Use C++ to implement the state diagram.

Need help with Programming question. Use C++ to implement the state diagram. Design a state diagram to recognize one form of the comments of the C-based programming languages, those that begin with /* and end with */. Write and test the code to implement the state diagram of Problem 1.

C++ Vector: Computing average and maximum of real numbers

Write a program that declares a vector of real numbers and input values until a 0 is entered. Add the values to the vector by using push_back(), and compute both the average and the maximum value of the numbers. Output the average and the maximum. Use the upcoming statements that intialize max to have the value -infinity. The

Arrays and Strings

Consider the following function main: int main () { Int inStock [10] [4]; Int alpha [20]; Int beta [20]; Int gamma [4] = {11, 13, 15, 17}; Int delta [10] = {3, 5, 2, 6, 10, 9, 7, 11, 1, 8}; . . . } a) Write the definition of the function setZero that initializes any one-dimensional array of type int to 0.

C++ Header File

Here is what the NAME HEADER file (Name.h) will have: 1. a default constructor 2. 3 private string instance variables for : FIRST NAME, MIDDLE NAME, and LAST NAME 3. getFirstLast Function: it returns the first and middle name and last name in order. 4. print function: it prints the first, middle, and last name.

Modify Attached C++ Procedural Program

Hello , I would like this program modified to input the amount of the mortgage, the term (years) of the mortgage, and the interest rate of the mortgage. 1) What the to display the mortgage payment amount. 2) I want to allow the user to loop back and enter new data or quit. *** Any percentage such as 6.35 rate 20 yr lo

C++ Programming - Mortgage

I want to create a procedural C++ program that calculates and displays the mortgage payment amount that will display mortgage amount, the term of the mortgage, and the interest rate of the mortgage. I would like to use specific variables for the amount, term and interest rate, but hard code them to use: amount = $300,000.00, ter

What is so special about OOP

Can you please help with the following study question? Thanks What is so special about OOP? Why is it so widely used nowadays? What do you gain and what do you lose when using OOP? Which other programming languages (except for C++) can be assigned to the category of OO languages? Does the development of OOP mean "death" of pr

Write a modular program for a cafeteria kiosk

Write a modular program in three files which: I have included the program however it needs to be modified to utilize a function so I can use a header file, a Main file and a source file for the function. See header file for program description Write a modular program in three files which: Acts as a cafeteria kiosk, co

C++ program to find a biggest zero submatrix

Write a C++ program to accept an n*m matrix containing only 0 and 1 values, and then find it's biggest zero submatrix i.e. the biggest submatrix in which all the values are 0. INPUT First line contains two numbers n, m (n,m<=300), then n lines, each having m 0/1 digits. OUTPUT One number, which represent the number

Multidimensional Arrays and Vectors

I need the following in C++ Suppose that a certain automobile dealership sells ten different models of automobiles and employees eight salespersons. A record of sales for each month can be represented by a table in which each row contains the number of sales of each model by a given salesperson and each column contains the n

Multidimensional Arrays and Vectors

**I need the following in C++** The output needs to be in a table format. A company has a product line that includes five items that sell for $100, $75, $120, $150, and $35. There are four salespersons working for this company, and the following report is for a given week: Salesperson

Matching Grouping Symbols in Arithmetic Expression in C++

Write a C++ program that outputs appropriate messages for matching grouping symbols, such as parentheses and braces, in the input arithmetic expression. For example, the expression "{25+(3-6)*8}" contains matching grouping symbols (curly braces and parentheses), while in case of "[25+{3-6)*8]" only matching grouping symbols a

C++ program to process text file

Write a C++ program that reads a text file and counts the characters in each line. The program should display the line number and the length of the shortest and longest lines in the file, as well as the average number of characters per line.

C++ Program - Division

Write a program, using C++ that prints to screen the results of dividing 23 by 5, where 23 and 5 are ints. Provide the results of what was printed to screen via comments in the program ; need in hardcopy.

Programming Concepts

Program code can be organized through the use of functions. What are the criteria on creating functions? For example, do you limit the function to a certain number of lines of code, to a set of common function? The C/C++ language has two different types of conditional statements (if-else and switch-case). What do you see as t

C++ Change Program

Write a function that accepts the cost of the purchase and the amount of the payment as functon parameters, and the prints on the cashiers console how much change to give (how many bills and coin). Consider denominations of 1cent, 5 cents, 10 cents, 25 cents, $1, $5, and $10.

Classes and Enumerators Using C++

Use the type Date (consisting of a month name, day number, and a year number) to develop a class Event to model events scheduled for specified dates. use this class in a program that reads several events and stores these in a vector of Events. After all the events have been entered, the program should display a schedule of eve

Multidimensional Arrays and Vectors

A certain professor has a file containing a table of student grades, where the first line of the file contains the number of students and the number of scores in the table; each row of the table represents the exam scores of a given student and each column represents the scores on a given exam. The maximum possible score on eac

Building Classes

Write a program to do rational number arithmetic, representing each rational number as a class that has instance variables for the numerator and the denominator. The program should read and display all rational numbers in the format a/b, or simply a if the denominator is 1. I have enclosed what I have however it doesn't work ri

Vector class in c++

Write a program using the vector class that allows the user to input the number of days worked in a 7 day workweek and, using a fixed hourly rate, calculates the weeks wages and the average number of hours worked per day. The program needs to be in c++ and using the vector classes.