Comment on Tutorial - do...while Loops in C++ By Abinaya
Comment Added by : Joshua Torres
Comment Added at : 2012-10-05 16:59:17
Comment on Tutorial : do...while Loops in C++ By Abinaya
/
//BSIT
//
#include<iostream.h>
#include<conio.h>
void main()
{ clrscr();
double rPay,oPay,tax,nPay,pRate,hrswrkd,otPay,gPay,quit=0,total=0,total1=0,total2=0;
int noOfemployees=0;
char eCode,lCode,choice;
do{
cout<<"Enter the payrate: ";
cin>>pRate;
cout<<"Enter the number of hours worked: ";
cin>>hrswrkd;
cout<<"Enter the employee code (A or B): ";
cin>>eCode;
cout<<"Enter the location code (N or P): ";
cin>>lCode;
cout<<endl;
noOfemployees++;
total+=gPay+gPay;
total1+=nPay+nPay;
total2+=tax+tax;
if(hrswrkd<=40)
{rPay=pRate*hrswrkd;
otPay=0; }
else if (hrswrkd>40)
{rPay=pRate*40;
otPay=(1.5*pRate)*(hrswrkd-40);}
cout<<"Regular Pay: "<<rPay<<endl;
cout<<"Overtime Pay: "<<otPay<<endl;
gPay=rPay+otPay;
cout<<"Gross Pay: "<<gPay<<endl;
if(eCode=='A'&&lCode=='N')
tax=gPay*0.07;
else if(eCode=='A'&&lCode!='N')
tax=gPay*0.045;
else if(eCode!='A')
tax=0;
cout<<"Tax: "<<tax<<endl;
cout<<"---------------------"<<endl;
nPay=gPay-tax;
cout<<"Net pay: "<<nPay<<endl;
cout<<endl;
cout<<"Do you want to process another employee? (y/n): "<<endl;
cin>>choice;
if(choice!='y')
quit=0;
}while(choice!='n');
quit=1;
cout<<"Total number of employees processed:"<<noOfemployees<<endl;
cout<<"Total gross pay:"<<total<<endl;
cout<<"Total Tax:"<<total2<<endl;
cout<<"Total net pay:"<<total1<<endl;
getch();
}
i need to know the formula of TOTAL please help me
View Tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Related Tutorials
Program using concept of byte long short and int in java
Update contents of a file within a jar file
Tomcat and httpd configured in port 8080 and 80
Count number of vowels, consonants and digits in a String in Java
Student marks calculation program in Java
Calculate gross salary in Java
Calculate average sale of the week in Java
Vector in Java - Sample Program
MultiLevel Inheritance sample in Java
Archived Comments
1. java is new for me..... since i dont know from bas
View Tutorial By: m.padma at 2011-08-08 15:40:23
2. i need java simple programs
View Tutorial By: Tharani at 2010-01-22 06:39:25
3. FileOutputStream will create the file if it does n
View Tutorial By: Peter at 2012-02-07 13:25:16
4. Thanks so much!
View Tutorial By: Viet at 2013-01-15 15:02:52
5. Thanks this page is very useful for me and now I k
View Tutorial By: Yee Wai Wyne at 2009-10-18 23:03:41
6. all are easy to understanding codes. . . thanks
View Tutorial By: kadhir at 2011-06-27 03:33:30
7. what if the delimiter is "(quotation mark)?
View Tutorial By: hiakoto at 2013-02-18 16:15:20
8. Hello,
I've tried the above code, but I've
View Tutorial By: Phyo Phyo at 2009-09-14 05:32:28
9. Hi,
I am getting this exception..My modem i
View Tutorial By: divya at 2008-04-27 04:12:19
10. the article is very useful...!
View Tutorial By: pravin salame at 2011-05-20 11:58:28