60 636
Assignments Done
97,8%
Successfully Done
In April 2018

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.
Expert's answer

#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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions