• Lunes 29 de Abril de 2024, 04:04

Autor Tema:  Ayuda Con Programa De Caja  (Leído 805 veces)

kristho

  • Nuevo Miembro
  • *
  • Mensajes: 4
    • Ver Perfil
Ayuda Con Programa De Caja
« en: Miércoles 14 de Diciembre de 2005, 02:56 »
0
Tengo que hacer un programilla que funcione como una caja, con ingresos, egresos, etc. pero hasta ahora no he tenido exito, agradeceria si lo pudiesen ver. Gracias
Citar
#include<stdio.h>
#include<conio.h>
int menu(void);
void ventas(void);
void arqueo(void);
void cambio_moneda(void);
void ingresos_egresos(void);
void cierre_caja(void);
void vuelto(long double,long double);

long double inicial,total,total_ventas=0,ingresos=0,egresos=0;

void main()
{
int salir=0;
clrscr();
printf("\nAPERTURA DE CAJA\n");
printf("\nINGRESE SALDO INICIAL: ");
scanf("%d",&inicial);
total=inicial;
while(salir==0)
{
switch(menu())
{
case 1: ventas(); break;
case 2: arqueo(); break;
case 3: ingresos_egresos(); break;
case 4: cierre_caja(); break;
case 5: salir=1; break;
}
}
}

int menu()
{
int op;
clrscr();
printf("MENU\n\n");
printf("1. VENTAS\n");
printf("2. ARQUEO\n");
printf("3. INGRESOS/EGRESOS\n");
printf("4. CIERRE DE CAJA\n");
printf("5. SALIR\n");
printf("\nINGRESE SU OPCION: ");
scanf("%d",&op);
return(op);
}

void ventas(void)
{
long double valor_venta, efectivo;
char seguir;
do
{
clrscr();
printf("VENTAS\n\n");
printf("INGRESAR VENTA\n");
printf("\nVALOR ARTICULO: ");
scanf("%d",&valor_venta);
printf("\nEFECTIVO INGRESADO: ");
scanf("%d",&efectivo);
vuelto(efectivo,valor_venta);
printf("\n\nDESEA REALIZAR OTRA VENTA? (S/N): ");
do
{
fflush(stdin);
seguir=getch();
}
while(seguir!='S'&&seguir!='s'&&seguir!='N'&&seguir!='n');
}
while(seguir=='S'||seguir=='s');
}

void arqueo(void)
{
clrscr();
printf("ARQUEO\n\n");
printf("\nDETALLE ACTUAL DE TRANSACCIONES:\n");
printf("\nSALDO INICIAL : $ %d",inicial);
printf("\nINGRESOS : $ %d",ingresos);
printf("\nEGRESOS : $ %d",egresos);
printf("\nTOTAL VENTAS : $ %d",total_ventas);
printf("\nTOTAL RECAUDADO: $ %d",total);
printf("\n\nPresione cualquier tecla para volver al menu principal...");
getch();
}

void ingresos_egresos(void)
{
clrscr();
printf("INGRESOS Y EGRESOS");
getch();
}

void cierre_caja(void)
{
clrscr();
printf("CIERRE DE CAJA");
getch();
}

void vuelto(long double efect,long double valor_v)
{
long double vuelto_v;
vuelto_v=efect-valor_v;
if(vuelto_v>total)
printf("\nINSUFICIENTE DINERO PARA DAR VUELTO!");
else
{
total=total+valor_v;
total_ventas=total_ventas+valor_v;
printf("\nVUELTO: %d",vuelto_v);
}
}

shakka

  • Miembro HIPER activo
  • ****
  • Mensajes: 679
  • Nacionalidad: cr
    • Ver Perfil
    • http://mbrenes.com
Re: Ayuda Con Programa De Caja
« Respuesta #1 en: Miércoles 14 de Diciembre de 2005, 05:16 »
0
y cual es el problema?

Debes saber que muchos como yo trabajamos, y no vamos a tener el suficiente tiempo para andar buscando el problema. indica en que no tienes exito, que compilador usas, sobre que plataforma trabajas... todas esas variantes son importantes para darte sea yo u otro compañero del foro una satisfactoria solucion.