Explore BrainMass

Explore BrainMass

    C++

    BrainMass Solutions Available for Instant Download

    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

    Three different looping examples in C++

    Design a While Loop that lets the user enter a number. The number should be multiplied by 10, and the result stored in a variable named product. The loop should iterate as long as product contains a value less than 100. Design a For loop that calculates the total of the following series of numbers: 1/30+2/29+3/28+...30/1

    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

    Examples of C++ Programs

    Please see the attached file. The formula for number 4 is as follows a = r3 + r4 b = (r2*a)/(r2+a) Thev equiv = r1 + b

    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. -

    An easy to understand example of arithmetic in C++

    Write a c++ program. 1. As a part time student and a part time worker, you earn $4.50 an hour. Your parents will buy you a used car, but you must pay for the gas. gas costs $1.10/gallon and you use 20 gallons/week. How many hours will you work each week to pay for the gas to fuel your car?

    Reading and writing a file with a Java Program

    Please assist with the following: Write a C++ or Java program that reads from one file and writes to another, in both Windows and Linux operating systems. Keep in mind that the key goal in this assignment is to identify the command used to copy a file. The other goal is to determine how to perform system calls in each operati

    Implement Dijkstra in C++

    Please include the code and the .exe file. For the Graph in figure 16-28(a), replicate the trace of Dijkstra's algorithm to find the minimum path from vertex A to F. For each step, create the list of minInfo elements in the priority queue and indicate which element is removed from the queue. Please see Graph 16-28(a) below

    C++ using multidimensional dimensional array

    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

    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. Ot

    Business Accounting System in C++

    The idea is to write an accounting system in C++ for a business, the proposed business is a lawnmower business. Three areas that need covering that I need help with are: 1) Main function, this will provide the menu interface to get to all the rest of them, it will basically be a switch statement that calls the other funct

    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)

    output from the following sequence of stack operations

    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

    List in C++

    Please include the code. Implement, according to the instructions in parts (a) and (b), the fnction count(), which takes item as argument and returns the number of times item occurs in a list. template <typename T> -------please see attachment for this portion int count (const list<T>& aList, constT& item); a) implemen

    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);

    output of the codes

    Trace the following code and give the output: (be sure to include the code used) int arr[] = {4, -6, 22, 7, 13, 8}; in arrSize = sizeof(arr)/sizeof(int); vector<int>v(arr.arr+arrSize); while (!v.empty()) { cout <<v.back() <<" "; v.pop_back(); }

    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();

    Westfield Carpet Company

    Use C++ to write a program: The Westfield Carpet Company has asked you to write an application that calculates the price of carpeting for rectangular rooms. To calculate the price, you multiply the area of the floor(width times length) by the price per square foot of carpet. For example, the area of floor that is 12 feet long

    Data Structures C++ for array generation

    Write a program that generates an array of 10 random integers in the range from 0 to 999. Output array using the template function writeArray(), and then call the function bubbleSort() to sort the list. Output the sorted list.

    Data structures C++

    The free newString() takes string objects strA and strB as arguments. For its action, newString() compares the string by using < and returns the concatenation of the arguments, with the lesser sring coming first. a) give a function prototype for newString() b)Give the implementation for newString() c) The main program has the

    Reversing integer using recursion

    I need a recursive function that accepts an integer and returns its reverse. for example int reverse( int n ); int main() { int n; n = reverse (123) ; // this returns 321 } I can do this easily without recursion but I have to use recursion. Thank you.

    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