Question: Challenge: Using the student data files for chapter 5, open the SwatTheBugs17.cpp file. The program should display a 10% bonus for sales over $10,000. Correct
Challenge: Using the student data files for chapter 5, open the SwatTheBugs17.cpp file. The program should display a 10% bonus for sales over $10,000. Correct the syntax errors, and then save, run, and test the program.
my program build keeps failing and I cannot find the error, please fix it so that it can succesfully build.
#include
#include
using namespace std;
int main( )
{
const double RATE = 0.1;
double sales = 0.0;
double bonus = 0.0;
//enter input
cout << "Enter the sales amount: ";
cin >> sales;
//display output
//check if sales greater than 10000
if (sales > 10000.0)
{
//get bonus
bonus = sales * RATE;
cout << fixed << setprecision(2);
//show the bonus
cout << "Bonus: $" << bonus << endl;
}
//else show error message
else
cout << "Sorry, you do not get a bonus." << endl;
//end if
return 0;
} //end of main function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
