can some me with a program that does the following Loop 4 times to do the follow
ID: 3653684 • Letter: C
Question
can some me with a program that does the following Loop 4 times to do the following this program prompts the user to enter an employee name, number of hours, worked and pay rate. It then determines the net pay with the tax as well as bonus (if any). Output the data into a text file called outfile.datExplanation / Answer
//something like this? #include #include using namespace std; int main(){ ofstream out("outfile.dat"); string fname, lname; double hours, payrate; double NetPay, pay; int tax= 1; //change this to whatever it needs to be in percentage form double bonus =100; //change this to whatever also for(int i=0;i>lname; couthours; coutpayrate; //calculate input if(hours>40) pay=(40*payrate)+(hours-40)*(payrate*1.5); else pay=hours*payrate; NetPay=pay*(1- (tax/100.00))+bonus;//might need to fix this formula //print the info outRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.