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



Subscribe to Tutorials

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

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions 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

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Thank you very much for your help!!
View Tutorial          By: Ajay Singh at 2009-10-21 22:17:21

2. gud tutorial but the permission denied is because
View Tutorial          By: amithooda at 2012-06-11 06:43:00

3. very thanks...
View Tutorial          By: anush at 2012-08-10 07:46:53

4. i am newly in java, i want to learn about this and
View Tutorial          By: punitha at 2012-07-21 06:16:53

5. i need to code for sparse matrix in java. please
View Tutorial          By: sudhi at 2012-10-01 09:34:57

6. it s good ,understanding clearly and with out conf
View Tutorial          By: vasudeva kumar at 2012-01-06 14:04:30

7. What is SMSC and CSCA number? , in which JAVA file
View Tutorial          By: sampath at 2009-06-19 07:01:31

8. Seems to be the best tutorial on this topic. At le
View Tutorial          By: Bob Nickson at 2008-08-26 02:50:29

9. I did this exactly.
In my case, the fix.php

View Tutorial          By: Manorasa at 2010-06-29 23:32:24

10. can you gave us a sample form that has a design
View Tutorial          By: niknik at 2011-07-01 09:39:21