Save this source code file in a directory of your choice


MULTIPLE-LEVEL CONTROL BREAK PROGRAMS In this lab, you use what you have learned about multiple-level control break programs to complete a C++ program. The program should produce a report for a used car dealer that includes the make and model of each car sold, the total cars sold of each make, and a total of all cars sold. The student file for this lab includes the variable declarations and input statements. You need to implement the control break portion of the program, which executes when a new record is read, that has a different make and/or a different model. Be sure to accumulate the car make totals and the grand total for all cars. Comments in the student file tell you where to write your code. You can use the Bookstore2 program in this chapter as a guide.

1. Open the source code file named UsedCars.cpp using Notepad or the text editor of your choice.

2. Study the prewritten code to understand what has already been done.

3. Write the control break code in the main function.

4. Write the makeBreak control break function.

5. Write the modelBreak control break function.

6. Save this source code file in a directory of your choice and then make that directory your working directory.

7. Compile the source code file UsedCars.cpp.

8. Execute the program. Use the following input data.

2444_dedd3ab7-d23e-4f85-92c9-9288a77124b2.png

Your output should show that the total for Chevrolet Corvette is 2, the total for Chevrolet Aveo is 1, the total for Chevrolet is 3, the total for Ford Mustang is 1, the total for Ford Focus is 1, the total for Ford is 2, the total for Honda Accord is 1, the total for Honda Odyssey is 1, the total for Honda Civic is 1, and the total for Honda is 3. The grand total of cars sold is 8.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Save this source code file in a directory of your choice
Reference No:- TGS02194062

Expected delivery within 24 Hours