Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions

Question

Acceptance of the key role of people in this process of adaptation.

Answered: 1 week ago

Question

preference for well defined job functions;

Answered: 1 week ago