Question: In this lab, you will modify the program from Lab 4-2 to allow the user to enter the commission rate (in decimal form). Test the

In this lab, you will modify the program from Lab 4-2 to allow the user to enter the commission rate (in decimal form). Test the program twice. For the first test, use 1328.50 and .1 as the sales amount and commission rate, respectively. For the second test, use 267.90 and .15. Can I adjust the code to allow me to enter the commision rate at the same time when I am entering the sales amount? Im not sure of the proper way to achieve this. Thanks for any help.

int main() { //declare named constat and variables const double COMM_RATE = 0.1; double sales = 0.0; double commission = 0.0;

//enter input item cout << "Sales amount:"; cin >> sales;

//calculate and display the commission commission = sales * COMM_RATE; cout << "Commission:$" << commission << endl;

return 0;

} //end of main function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!