In this exercise, you will modify the program from Lab 5-1. If necessary, create a new project

Question:

In this exercise, you will modify the program from Lab 5-1. If necessary, create a new project named ModifyThis10 Project, and save it in the Cpp8\Chap05 folder. Enter the instructions shown earlier in Figure 5-23 into a new source file named ModifyThis10.cpp. Currently, the 20% rate is assigned to the rate variable only when the code variable contains either the character 1 or the character 3. Modify the selection structure so that codes 1 and 3 still get the 20% rate, but only when the sales amount is at least $20,000; otherwise, they should get the 15% rate. Test the program appropriately.

Figure 5-23

1 //Lab5-1.cpp - displays projected sales 2 //Created/revi sed by  on  4 #include  5 #include  6 using namespace std; 7 8 int main() 9 { 10 double sales 0.0; double rate - 0.0; = ' '; 11 12 char code 13 cout > sales; cout >

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: