1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
#include <iostream>
#include <conio.h>
#include <windows.h>
using namespace std;
//FUNCTION PLANILLA
void planilla(int a){
float counter;
float liquido;
float descuentoTotal;
float igss;
int i;
//COUNTER OF THE EMPLOYEE'S ENTRY'S.
for (i=0; i<=a; i++);{
counter = i;
}
//PROCESS
descuentoTotal = 500+a*0.0983;
igss = 500+a*0.0483;
liquido = 500-descuentoTotal;
//PRINTS THE RESULTS OF THE PROCESS
textcolor(15);
gotoxy(24,11); cprintf("EMPLOYEE'S ENTRY'S "); cout << counter;
textcolor(15);
gotoxy(24,13); cprintf("Liquido total: "); cout << liquido;
textcolor(15);
gotoxy(24,15); cprintf("Descuentos total: "); cout << descuentoTotal;
textcolor(15);
gotoxy(24,17); cprintf("IGSS total: "); cout << igss;
}
int sueldo; //GLOBAL INT VARIABLES
int opcion;
int sueldoNuevo;
int main(){
gotoxy(24,4); cprintf("Acumulo las planillas para ti");
textcolor(15);
gotoxy(24,6); cprintf("Enter the employee's salary: ");
cin >> sueldo;
textcolor(15);
gotoxy(24,8); cprintf("Everything ok, do you want to continue?");
textcolor(15);
gotoxy(24,9); cprintf("1 = Yes, 2 = No ");
cin >> opcion;
if (opcion == 1){
while (opcion != 1){
clrscr();
//IF OPCION IS 1, PRINTS THE HEADER AGAIN WITH A WHILE
gotoxy(24,4); cprintf("Acumulo las planillas para ti");
textcolor(15);
gotoxy(24,6); cprintf("Enter the employee's salary ");
cin >> sueldoNuevo;
sueldo = sueldo+sueldoNuevo;
planilla (sueldo);
textcolor(15);
gotoxy(24,8); cprintf("Everything ok, do you want to continue?");
textcolor(15);
gotoxy(24,9); cprintf("1 = Yes, 2 = No ");
cin >> opcion;
}
}
//CALL FUNCTION PLANILLA
planilla (sueldo);
getch();
return 0;
}
|