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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started