Answer to Question #7675 in C++ for ken

Question #7675
One large company pays its salesperson on a commission basis.The salesperson each receive 200 per week plus 9 percent of their gross sales for that week.Develop a c++ program that uses a while statement to input each salespersons gross sales for last week and calculates and displays that salespersons earnings.
1
Expert's answer
2012-03-27T09:29:07-0400

#include<iostream.h>
#include<stdio.h>
#include<conio.h>
#include<iomanip.h>
#include<process.h>

int main()
{
& float sales,earn;
& char ch;
& while(1)
& {
& cout<<"\nEnter the salesman's sales->";
& cin>>sales;
& cout<<setprecision(6);
& earn=200+0.09*sales;
& cout<<"\nHis earning is::";
& cout<<earn;
& cout<<"\nWant to continue?(Press Y or N)->";
& fflush(stdin);
& ch=getche();
& if(ch=='N'||ch=='n')
& {
cout<<"\n*********THANK YOU********\n";
exit(1);
& }
& }
& return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS