urgentisimo

jorgec++
16 de Junio del 2005
Alguien tendra un programa en C++ que simule un cajero automatico.
Basicamente es un objeto "cajero" un objeto "persona" y un
objeto "banco"

El programa en si debe preguntar que se quiere hacer, para lo cual
primero se debe autentificar nip y password
1.Chequear saldo
2.Sacar dinero
3.Meter dinero
4. salir


Espero alguien pueda ayudarme, lo necesito urgentemente a mas tardar hasta el 14/12/03 despues de este mensaje, es proyecto final para pasar el curso de lenguage de programacion 1. Gracias de todas maneras y saludos a todos los
usuarios de este muy buen grupo.

jd_small
16 de Junio del 2005
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<conio.h>
#include<iostream.h>
int op;
char sw='s';
void consulta();
void retiro();
void consignacion();
void main()
{
float cuenta;
clrscr();
textbackground(BLUE);
gotoxy(15,10);printf("BANCO INTERNACIONAL");
gotoxy(15,14);printf(" BIENVENIDOS");
gotoxy(15,18);printf(" CAJERO AUTOMATICO");
getch();
clrscr();
randomize();
cuenta=random (+100)*1000000;
gotoxy(15,12);printf("CUENTA: %-10.0f",cuenta);
getch();
while (sw=='s')
{
while (op!=4)
{
clrscr();
gotoxy(15,8);printf(" MENU ");
gotoxy(15,12);printf("1. CONSULTA DE SALDO");
gotoxy(15,14);printf("2. RETIRO ");
gotoxy(15,16);printf("3. CONSIGNACION");
gotoxy(15,18);printf("4. SALIR");
gotoxy(15,20);printf("DIGITE SU OPCION:");
scanf("%d",&op);
getch();
switch(op)
{
case 1:
consulta();
break;
case 2:
retiro();
break;
case 3:
consignacion();
break;
case 4:
exit(1);
default:
cout<<"DIGITO UNA OPCION VALIDA";
getch();
}
}
gotoxy(15,25);printf("DESEA OTRA OPERACION");
scanf("%d",&sw);
}
}
void consulta()
{
clrscr();
int clave;
float saldo;
gotoxy(15,15);printf("DIGITE CLAVE DE LA CUENTA: ");
scanf("%d",&clave);
randomize();
saldo=random (100);
saldo=saldo*10000;
gotoxy(15,17);printf("EL SALDO DE SU CUENTA ES: %-10.0fn", saldo);
getch();
}
void retiro()
{
float saldo, retira;
clrscr();
gotoxy(15,17);printf("DIGITE CANTIDAD A RETIRAR: ");
scanf("%f",&retira);
randomize();
saldo=random (100);
saldo=saldo*10000;
if (saldo>retira)
{
gotoxy(15,19);printf("OPERACION REALIZADA CON EXITO");
gotoxy(15,21);printf("TIENE SALDO DISPONIBLE ");
gotoxy(15,23);printf("POR FAVOR RETIRE SU DINERO ");
getch();
}
else
{
gotoxy(15,19);printf("SALDO NO DISPONIBLE ");
getch();
}
}
void consignacion()
{
float monto;
clrscr();
gotoxy(15,17);printf("DIGITE MONTO A CONSIGNAR:");
scanf("%f",&monto);
gotoxy(15,19);printf("CONSIGNACION REALIZADA CON EXITO");
gotoxy(15,21);printf("RETIRE SU RECIBO");
getch();
}