#include<stdio.h>
#include<stdlib.h>/*NECESARIA PARA TRABAJAR CON LA FUNCION system("clear"); en GNU/LINUX
PARA LOS QUE TRABAJAN EN WINDOWS PRUEBEN CON system("cls"); o indagen
*/
//DECLARACION DE VARIABLES GLOBALES
int ci, cant_zap;
float monto_efec, monto_cheque, monto_tarj;
char nombre[25], apellido[25], modelo[25];
//Declaraciones de Las Funciones
void Registro();
int Tipo_Pago();
void Reportes();
int main (){
int opc;
do{
system("clear");
printf("\n***BIENVENIDO***\n");
printf("\n***MENU PRINCIPAL****\n");
printf("\n*************");
printf("\nQue desea hacer\n");
printf("\n(1)-> Registrar Datos del Cliente\n");
printf("\n(2)-> Forma de Pago\n");
printf("\n(3)-> Reportes\n");
printf("\n(4)-> Salir\n");
printf("*************\n");
scanf("%i",&opc);
switch(opc){
case 1:{
system("clear");
Registro();//LLAMADO A LA FUNCION
break;
}
case 2:{
system("clear"); /*NOS PERMITE REALIZAR UNA LIMPIEZA DE PANTALLA AL MOMENTO DE MOSTRAR LA SIGUIENTE FUNCION */
Tipo_Pago();
break;
}
case 3:{
Reportes();
printf("\nGRACIAS POR SU COMPRA\n");
break;
}
case 4:{
printf("\nPROGRAMA FINALIZADO EXITOSAMENTE, GRACIAS POR PREFERIRNOS\n");
return 0;
break;
}
default:{
printf("\nPERDONE LA OPCION NO ES VALIDA\n");
break;
}
}//Fin del Switch case
}while(opc!=4);
}//Fin del Main
/*_________________________________________________________________
DESARROLLO DE LAS FUNCIONES
__________________________________________________________________*/
void Registro(){
printf("\n***BIENVENIDO***\n");
printf("\n***REGISTRO DEL CLIENTE****\n");
printf("\n*************");
printf("\nCedula de Identidad:\t");
scanf("%i",&ci);
printf("\nNombre:\t");
scanf("%s",&nombre);
printf("\nApellido:\t");
scanf("%s",&apellido);
printf("\nModelo:\t");
scanf("%s",&modelo);
printf("\nCantidad:\t");
scanf("%i",&cant_zap);
}//Fin de la Funcion Registrar
int Tipo_Pago(){
int opcion;
do{
printf("\n***FORMA DE PAGO****\n");
printf("\n*************");
printf("\n(1)-> Efectivo\n");
printf("\n(2)-> Cheque Conformable\n");
printf("\n(3)-> Tarjeta de Debito o Credito\n");
printf("\n(4)-> Salir\n");
printf("*************\n");
scanf("%i",&opcion);
switch(opcion){
case 1:{
printf("\nMONTO A CANCELAR:\t");
scanf("%f",&monto_efec);
break;
}
case 2:{
printf("\nMONTO A CANCELAR:\t");
scanf("%f",&monto_cheque);
break;
}
case 3:{
printf("\nMONTO A CANCELAR:\t");
scanf("%f",&monto_tarj);
break;
}
case 4:{
return 0;
break;
}
default:{
printf("\nPERDONE LA OPCION NO ES VALIDA\n");
break;
}
}//Fin del switch case
}while(opcion!=4);//Fin del ciclo do while
}//Fin de la funcion forma de pago
void Reportes(){
float total;
total=monto_efec+monto_cheque+monto_tarj;
printf("\n***FACTURA****\n");
printf("\n*************");
printf("\nDATOS DEL CLIENTE\n");
printf("\nCedula de Identidad: %i \n", ci);
printf("\n%s %s\n", nombre, apellido);
printf("\nModelo: %s\n", modelo);
printf("\nCantidad: %i \n", cant_zap);
printf("\nDATOS DE LA COMPRA\n");
printf("\nTotal Pagado con Efectivo %f Bs F. \n", monto_efec);
printf("\nTotal Pagado con Cheque %f Bs F.\n", monto_cheque);
printf("\nTotal Pagado con Tarjeta %f Bs F.\n", monto_tarj);
printf("\nMonto Total %f Bs F.\n", total);
printf("*************\n");
}//Fin de la funcion Reporte
Publicado por
Hansel Colmenarez

0 comentarios:
Publicar un comentario