Share
Explore BrainMass

C++

C++: Arrays, Pointers and more

1. Explain how an array works. 2.Define the purpose of a pointer. Provide an example of how it can be used 3. What are the drawbacks to using pointers? 4. What risks does Open Source Development Platforms present that may not be present with Proprietary Development Platforms? Is C++ an Open Source or Proprietary Program

C++ Stack and Queue

Convert the following infix expressions to postfix notations: a. (A + B) * (C + D) - E b. A - (B + C) * D + E / F c. ((A + B) / (C - D) + E) * F - G d. A + B * (C +D) - E / F * G + H

A Vector Class in C++

Your class VectorDouble will have a private member variable for a dynamic array of doubles. It will also have two member variables of type int; one called maxCount for the size of the dynamic array of doubles, and one called count for the number of array positions currently holding values. (maxCount is the same as the capacity o

C++ Recursion

A. What is direct recursion? b. What is tail recursion? c. Suppose hat intArray is an array of integers, and length specifies the number of elements in intArray. Also suppose that low and high are two integers such that 0 <= low < length. 0 <= high < length, and low < high. That is, low and high are two indices in intArray

C++ exception classes

Suppose an exception, class myException, is defined as follows: class myException { public: myException() { message = "myException thrown!"; cout << "Immediate attention required!" << endl; } myException (string msg) { message = msg; cout << "Attention required!" << endl; } string what() { retur

C++ Programs: Loops, Input Detection

Need programs that fulfill the requirements in attached document. Write a method called check Value that will meet the following criteria: - Initializes total both to the default initialization value. - Get input for the starting number (assume important statement is already present) - Set total to the input above. -

C - Write a Function that Accepts a Score for a Driver's License

(Please include comments in the code) It is required that in all assignments a Cast should be used to convert float to int. 1- Write a function that accepts a score for a driver's license facility, an int or a float, and returns a letter. If the score passed in is less than 75, then the letter returned is an F for Fail. Othe

Data Structures - C++

Convert the following infix expressions to postfix: a) a + b*c b) (a+b)/(d-e) c)(b^2-4*a*c)/(2*a)

Data Structures - C++

What is the output from the following sequence of stack operations? (please include the code and .exe) See attached file. stack<int> intStack; int x, y = 3; intStack.push(8); intStack.push(9); intStack.push(y); x = intStack.top(); intStack.pop(); intStack.push(18); x = intStack.top(); intStack.pop(); intStack.p

Data structures + C++

Please include the code. Trace the following code, and display the resulting elements in the list. int arr[] = {1, 2, 3, 4]; int arrSize = sizeof(arr)/sieof(int); list<int> intList (arr, arr+arrSize); list<int> :: iterator iter = intList.begin); int i; for (i=1; i <= arrSize; i++) intList.insert(iter++, i);

Data Structures + C++ STL

Give the value of v.size() after executing each of the following statements: (Be sure to include the code used to execute the statements. One program will be fine to execute all statements, no need to write multiple programs.) vector<int> v(25); v.push_back(-4); v.resize(40); m = v.back(); v.pop_back();

Writing a C++ Program Declaring Three Single Dimensional Arrays

Write a program that declares three single dimensional arrays named miles, gallon, and mpg. Each array should be capable of holding 5 elements. In the miles array, store the numbers 240.5, 300, 189.6, 177.4 and 192.3. In the gallons array store the numbers 10.3, 15.7, 14.9, 10.7 and 8.4. Each element of the mpg array should be c

C++ Student Gradebook Program

Write a program, use class to create many fields: Name,DOB,Address,Class,Mark,Average mark. Allow user save data to a text file, user also can add more students, can delete student, edit info about student. Write it in type of menu Drawing flowchart for this problem Please use C++, don't use 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[

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.

Name Header

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++ functions

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

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

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.