C/Visual C - continuacion

 
Vista:

continuacion

Publicado por Aurora (2 intervenciones) el 02/06/2005 06:12:16
Aqui esta la continuacion del programa
se me olvido decirles que esta en Borland C++ gracias por su cooperacion

int menuconsultas (int)
{clrscr();
gotoxy(20,1);printf("#####**VIDEO GLOBO**#####\n\n");
gotoxy(20,3);printf("1.-Clientes:\n");
gotoxy(20,4);printf("2.-Peliculas:\n");
gotoxy(20,5);printf("\nElige una opcion:");scanf("%d",&opc1);
}

int menuconsultacliente(int)
{clrscr();
gotoxy(20,1);printf("#####**VIDEO GLOBO**#####\n\n");
gotoxy(20,3);printf("1.-Nombre:\n");
gotoxy(20,4);printf("2.-Clave:\n");
gotoxy(20,5);printf("\nElige una opcion:");scanf("%d",&opc1);
}

int consultanombre(int)
{char nom[30];
int estado;
FILE *archivo;
archivo=fopen("texto.txt","r");
do{
clrscr();
gotoxy(1,1);printf("Que nombre deseas buscar?: \n");gets(nom);
fscanf(archivo, "%d %s %s %s %s\n",&idclient,nombre,direccion,tel,sex);
estado=0;
while (!feof(archivo)&&estado==0)
{
if (nom==nombre)
{ // aqui hay error
gotoxy(1,3);cout<<idclient<<endl;
gotoxy(1,4);cout<<nombre<<endl;
gotoxy(1,5);cout<<direccion<<endl;
gotoxy(1,6);cout<<tel<<endl;
gotoxy(1,7);cout<<sex<<endl;
estado=1;
}
else
{
fscanf(archivo, "%d %s %d\n",&idclient,&nombre,&direccion,&tel,&sex);
}
}
if(estado==0)
{
gotoxy(1,9);cout<<"no se encontro"<<endl;
}
gotoxy(1,11); cout<<"Deseas buscar otro registro?(s/n):"<<endl;
cin>>(res);
}
while(res=='s');
fclose(archivo);
getch();
}
int consultaclave(int)
{
int estado;
FILE*archivo;
archivo=fopen("texto.txt","r");
do // aqui hay error

{ clrscr();
gotoxy(1,1);printf("Inserta el ID del cliente :");
cin>>buscar;
fscanf(archivo,"%d %s %s %s %s\n",&idclient,nombre,tel,direccion,sex);

estado=0;
while(!feof(archivo)&&estado==0)
{
if (buscar==idclient)
{
gotoxy(1,2);cout<<"Clave"<<idclient<<endl;
gotoxy(1,3);cout<<"Nombre"<<nombre<<endl;
gotoxy(1,4);cout<<"Telefono"<<tel<<endl;
gotoxy(1,5);cout<<"Direccion"<<direccion<<endl;
gotoxy(1,6);cout<<"Sexo"<<sex<<endl;
estado=1;
}
else
{
fscanf(archivo," %d %s %s %s %s\n",&idclient,nombre,tel,direccion,sex);
}
}
if(estado==0)
{
gotoxy(1,7);cout<<"No se encontro la clave"<<endl;
}
gotoxy(1,9);cout<<"Deseas buscar otro registro?(s/n):"<<endl;
cin>>(res);
}
while(res=='s');
fclose(archivo);
getch();
}

int menuconsultapeliculas(int)
{clrscr();
gotoxy(20,1);printf("#####**VIDEO GLOBO**#####\n\n");
gotoxy(20,3);printf("1.-Nombre:\n");
gotoxy(20,4);printf("2.-Genero:\n");
gotoxy(20,5);printf("3.-ID pelicula:\n");
gotoxy(20,6);printf("\nElige una opcion:");scanf("%d",&opc1);
}

int consultapnombre(int)
{char nomp[30];
int estado;
FILE *archivo;
archivo=fopen("texto1.txt","r");
do{
clrscr();
gotoxy(1,1);printf("Que pelicula deseas buscar?: \n");cin>>nomp;
fscanf(archivo, "%d %s %s\n",&idpelicula,gen,pel);
estado=0;
while (!feof(archivo)&&estado==0)
{
if (nomp==pel) // aqui hay error

{
gotoxy(1,2);cout<<idpelicula<<endl;
gotoxy(1,3);cout<<pel<<endl;
gotoxy(1,4);cout<<gen<<endl;
estado=1;
}
else
{
fscanf(archivo, "%d %s %d\n",&idpelicula,gen,pel);
}
}
if(estado==0)
{
gotoxy(1,9);cout<<"no se encontro"<<endl;
}
gotoxy(1,11);cout<<"Deseas buscar otro registro?(s/n):"<<endl;
cin>>(res);
}
while(res=='s');
fclose(archivo);
getch();
}

int consultapgenero(int)
/// no se como se hace

int consultapclave(int)
{ int estado;
FILE*archivo;
archivo=fopen("texto1.txt","r");
do
{ clrscr();
gotoxy(1,1);printf("Inserta el ID del la pelicula :");
cin>>buscar;
fscanf(archivo,"%d %s %s\n",&idpelicula,nombre,gen);

estado=0;
while(!feof(archivo)&&estado==0) // aqui hay error

{
if (buscar==idpelicula)
{
gotoxy(1,2);cout<<"Clave"<<idpelicula<<endl;
gotoxy(1,3);cout<<"Nombre"<<nombre<<endl;
gotoxy(1,4);cout<<"Genero"<<gen<<endl;
estado=1;
}
else
{
fscanf(archivo,"%d %s %s\n",&idpelicula,nombre,gen);
}
}
if(estado==0)
{
gotoxy(1,9); cout<<"No se encontro la clave";
}
gotoxy(1,11);cout<<"Deseas buscar otro registro?(s/n):"<<endl;
cin>>(res);
}
while(res=='s');
fclose(archivo);
getch();
}

int menumodificaciones(int)
{clrscr();
gotoxy(20,1);printf("#####**VIDEO GLOBO**#####\n\n");
gotoxy(20,3);printf("1.-Clientes:\n");
gotoxy(20,4);printf("2.-Peliculas:\n");
gotoxy(20,5);printf("\nElige una opcion:");scanf("%d",&opc1);
}
int modificacionesclavecliente (int)
// no se como se hacen
int modificacionespclave(int)
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder