PROGRAMA PARA CALCULAR DE UN REGISTRO EL
NOMBRE DE UN EMPLEADO, SU APELLIDO, PROFESION, SALARIO BÁSICO POR HORA, EL NÚMERO DE HORAS
TRABAJADAS EN EL PERÍODO Y EL PORCENTAJE DE RETENCIÓN EN LA FUENTE. CALCULAR EL
SALARIO BRUTO, EL VALOR DE LA RETENCIÓN Y SU SALARIO NETO.
#include<iostream.h>
void main (void)
{
char opcion='s';
char nombre[10];
char apellido[17];
char profesion[11];
char edad[3];
float tht,vht,sb,ret,sn;
while (opcion=='s')
{
textcolor(8);
textbackground(6);
clrscr();
gotoxy(30,2);printf("REGISTRO DE UNA PERSONA EN UNA EMPRESA");
gotoxy(10,4);cout<<"ingrese el nombre completo de la persona";
gotoxy(52,4);gets(nombre);
gotoxy(10,6);cout<<"ingrese los apellidos de la persona";
gotoxy(52,6);gets(apellido);
gotoxy(10,8);cout<<"ingrese la edad de la persona";
gotoxy(52,8);gets(edad);
gotoxy(10,10);cout<<"ingrese la profesion de la persona";
gotoxy(52,10);gets(profesion);
gotoxy(10,14);cout<<"ingrese total horas trabajadas";
gotoxy(52,14);cin>>tht;
gotoxy(10,16);cout<<"ingrese valor de las horas trabajadas";
gotoxy(52,16);cin>>vht;
sb=tht*vht;
ret=sb*0.15;
sn=sb-ret;
gotoxy(10,20);cout<<"el salario bruto de la persona es:"<<sb;
gotoxy(10,21);cout<<"el 15% de retencion de la persona es:"<<ret;
gotoxy(10,22);cout<<"el salario neto de la persona es:"<<sn;
do{
gotoxy(10,24);cout<<"desea consultar nuevamente un registro de un empleado s/n ";
opcion=getch();
}while((opcion!='s')&&(opcion!='n'));
}
}
#include<conio.h>
#include<stdio.h>#include<iostream.h>
void main (void)
{
char opcion='s';
char nombre[10];
char apellido[17];
char profesion[11];
char edad[3];
float tht,vht,sb,ret,sn;
while (opcion=='s')
{
textcolor(8);
textbackground(6);
clrscr();
gotoxy(30,2);printf("REGISTRO DE UNA PERSONA EN UNA EMPRESA");
gotoxy(10,4);cout<<"ingrese el nombre completo de la persona";
gotoxy(52,4);gets(nombre);
gotoxy(10,6);cout<<"ingrese los apellidos de la persona";
gotoxy(52,6);gets(apellido);
gotoxy(10,8);cout<<"ingrese la edad de la persona";
gotoxy(52,8);gets(edad);
gotoxy(10,10);cout<<"ingrese la profesion de la persona";
gotoxy(52,10);gets(profesion);
gotoxy(10,14);cout<<"ingrese total horas trabajadas";
gotoxy(52,14);cin>>tht;
gotoxy(10,16);cout<<"ingrese valor de las horas trabajadas";
gotoxy(52,16);cin>>vht;
sb=tht*vht;
ret=sb*0.15;
sn=sb-ret;
gotoxy(10,20);cout<<"el salario bruto de la persona es:"<<sb;
gotoxy(10,21);cout<<"el 15% de retencion de la persona es:"<<ret;
gotoxy(10,22);cout<<"el salario neto de la persona es:"<<sn;
do{
gotoxy(10,24);cout<<"desea consultar nuevamente un registro de un empleado s/n ";
opcion=getch();
}while((opcion!='s')&&(opcion!='n'));
}
}
No hay comentarios:
Publicar un comentario