Problem

In this exercise, you modify the program from Computer Exercise 26. If necessary, create...

In this exercise, you modify the program from Computer Exercise 26. If necessary, create a new project named Intermediate27 Project and save it in the Cpp7\Chap11 folder. Also create a new source file named Intermediate27.cpp. Copy the C++ instructions from the Intermediate26.cpp file into the Intermediate27.cpp file. Change the filename in the first comment to Intermediate27.cpp. Modify the program so that it also asks the user to enter a number from 1 through 10. When the user enters the number 1, the program should update only the first price in the array. When the user enters the number 2, the program should update only the second price in the array, and so on. Use a loop that stops prompting the user when he or she enters a number that is either less than or equal to 0 or greater than 10. Save and then run the program. Increase the second price by 10%. Next, increase the tenth price by 2%. Finally, decrease the first price by 10%.

REFERENCE : EXERCISE 26

Follow the instructions for starting C++ and viewing the Intermediate26.cpp file, which is contained in either the Cpp7\Chap11\Intermediate26 Project folder or the Cpp7\Chap11 folder. (Depending on your C++ development tool, you may need to open the project/solution file first.) If necessary, delete the two forward slashes that appear before the system("pause"); statement, and then save the program. Code the program so that it asks the user for a percentage amount by which each price should be increased. The program then should increase each price in the array by that amount. For example, when the user enters the number 15, the program should increase each element’s value by 15%. After increasing each price, the program should display the contents of the array. Save and then run the program. Increase each price by 5%.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search