Está en la página 1de 11

#include <iostream>

#include <windows.h>
#include <string>
using namespace std;

string Seguir = "S", Seguir1 = "S", Seguir2 = "S";


string nombre, nombre2, apellido, apellido2, password1, password2, conf1, conf2,
nuevonombre, nuevoapellido, nuevapass, nuevonombre1, nuevoapellido2, nuevapass2;
int opcion, opcion1,opcionreportes, opcion2, actualizar, act,
actualizar1,actualizar2, login, opcionP, iden, cod, edad, iden1, cod1, edad1, pac,
opcionA, actualizar3, eliminar;
string nom, nom2, ape, ape2, dom, nom1, nom3, ape1, ape3, dom1;

int main(){
bienvenido:
cout << "---------------------------------"<< endl;
cout << "| BIENVENIDO |"<< endl;
cout << "---------------------------------"<< endl<<endl;
cout << "------------ MODULOS ------------"<< endl;
cout << "1. MODULO DE ACCESO"<< endl;
cout << "2. SALIR"<< endl;
cout << "INGRESE LA OPCION A REALIZAR: ";
cin >> opcion;
system("CLS");
if (opcion <1 || opcion>2){
cout << "OPCION NO DISPONIBLE, FAVOR VERIFICAR"<<endl;
goto bienvenido;
} else {

switch (opcion ){
case 1:
menu:
system("CLS");
cout << "-----------------------" << endl;
cout << " MODULO DE ACCESO " << endl;
cout << "-----------------------" << endl;
cout << "1. REGISTRO DE USUARIOS"<< endl;
cout << "2. ACTUALIZACION DE DATOS"<< endl;
cout << "3. LOGIN DE ACCESO"<< endl;
cout << "4. SALIR"<< endl;
cout << "INGRESE LA OPCION A REALIZAR: ";
cin >> opcion1;
system("CLS");
if (opcion1 < 1 || opcion1 > 4){
cout << "OPCION NO DISPONIBLE, FAVOR VERIFICAR"<<endl;
goto menu;
}{

}
switch(opcion1){
case 1:
registro:
cout << "---REGISTRO DE USUARIOS---"<<endl;
cout << "1. PRIMER USUARIO"<<endl;
cout << "2. SEGUNDO USUARIO"<<endl;
cout << "INGRESE LA OPCION A REALIZAR: ";
cin >> opcion2;
system("CLS");
switch(opcion2){
case 1:
cout << "REGISTRO PRIMER USUARIO"<<endl<<endl;
cout << "INGRESE SU PRIMER NOMBRE: ";
cin >> nombre;
cout << "INGRESE SU APELLIDO: ";
cin >> apellido;
ingresar:
cout << "INGRESE SU PASSWORD: ";
cin >> password1;
cout << "CONFIRME SU PASSWORD: ";
cin >> conf1;

if (conf1 == password1){
cout << "SU USUARIO SE HA REGISTRADO CON EXITO"<<endl;
cout << "DESEA VOLVER AL REGISTRO DE USUARIOS? (SI (S) - NO
(N))"<<endl;
cout << "INGRESE LA LETRA CORRESPONDIENTE: ";
cin >> Seguir;

if (Seguir == "S"){
goto registro;
} else {
cout << "HA DECIDIDO VOLVER AL MENU DE
ACCESO"<<endl<<endl;
goto menu;
}

} else {
cout << "SU PASSWORD NO COINCIDE, FAVOR INGRESARLA DE
NUEVO"<<endl<<endl;
goto ingresar;
}
break;
case 2:
cout << "REGISTRO SEGUNDO USUARIO"<<endl<<endl;
cout << "INGRESE SU PRIMER NOMBRE: ";
cin >> nombre2;
cout << "INGRESE SU APELLIDO: ";
cin >> apellido2;
ingresar1:
cout << "INGRESE SU PASSWORD: ";
cin >> password2;
cout << "CONFIRME SU PASSWORD: ";
cin >> conf2;

if (conf2 == password2){
cout << "SU SEGUDNO USUARIO SE HA REGISTRADO CON
EXITO"<<endl;
cout << "INGRESE (S) PARA VOLVER AL MENU PRINCIPAL"<<endl;
cout << "INGRESE LA LETRA CORRESPONDIENTE: ";
cin >> Seguir;

if (Seguir == "S"){
goto menu;
} else {
cout << "HA DECIDIDO VOLVER AL MENU DE
ACCESO"<<endl<<endl;
goto menu;
}

}else {
cout << "SU PASSWORD NO COINCIDE, FAVOR INGRESARLA DE
NUEVO"<<endl<<endl;
goto ingresar1;
}
break;
} break;
case 2:
system ("CLS");
actualizar:
cout << "---ACTUALIZACION DE DATOS---"<<endl<<endl;
cout << "SELECCIONE EL USUARIO AL CUAL DESEA ACTUALIZAR SUS
DATOS"<<endl;
cout << "1. PRIMER USUARIO"<<endl;
cout << "2. SEGUNDO USUARIO"<<endl;
cout << "3. SALIR"<<endl;
cout << "INGRESE OPCION: ";
cin >> act;
switch (act){
case 1:
cout << "---DATOS DEL PRIMER USUARIO---"<<endl;
cout << "NOMBRE DE USUARIO: "<< nombre<<endl;
cout << "APELLIDO DEL USUARIO: "<< apellido<<endl;
cout << "PASSWORD DEL USUARIO:" <<password1<<endl<<endl;
cout << "CAMPOS QUE PUEDE ACTUALIZAR: "<<endl;
cout << "1. NOMBRE DE USUARIO"<<endl;
cout << "2. APELLIDO DE USUARIO"<<endl;
cout << "3. CONTRASEÑA"<<endl;
cout << "4. SALIR"<<endl;
cout << "INGRESE OPCION A ACTUALIZAR: "<<endl;
cin>> actualizar;
system("CLS");
switch (actualizar){
case 1:
cout << "INGRESE EL NUEVO NOMBRE DE USUARIO: ";
cin >> nombre;
cout << "NOMBRE DE USUARIO ACTUALIZADO. "<<endl;
goto actualizar;
break;
system("CLS");
case 2:
cout << "INGRESE EL NUEVO APELLIDO DE USUARIO: ";
cin >> apellido;
cout << "APELLIDO DE USUARIO ACTUALIZADO. "<<endl;
goto actualizar;
break;
system("CLS");
case 3:
introducir:
cout << "INGRESE SU NUEVO PASSWORD: ";
cin >> password1;
cout << "CONFIRME SU NUEVO PASSWORD: ";
cin >> conf1;
system("CLS");
if (conf1 == password1){
cout << "SU PASSWORD SE HA ACTUALIZADO
CORRECTAMENTE"<<endl;
goto actualizar;
}else {
cout << "SU PASSWORD NO COINDIDE, FAVOR INGRESARLA
NUEVAMENTE"<<endl;
goto introducir;
}
break;
case 4:
goto menu;
break;

}
break;
case 2:
cout << "---DATOS DEL SEGUNDO USUARIO---"<<endl;
cout << "NOMBRE DE USUARIO: "<< nombre2<<endl;
cout << "APELLIDO DEL USUARIO: "<< apellido2<<endl;
cout << "PASSWORD DEL USUARIO:" <<password2<<endl<<endl;
cout << "CAMPOS QUE PUEDE ACTUALIZAR: "<<endl;
cout << "1. NOMBRE DE USUARIO"<<endl;
cout << "2. APELLIDO DE USUARIO"<<endl;
cout << "3. CONTRASEÑA"<<endl;
cout << "4. SALIR"<<endl;
cout << "INGRESE OPCION A ACTUALIZAR: "<<endl;
cin>> actualizar1;
system("CLS");
switch (actualizar1){
case 1:
cout << "INGRESE EL NUEVO NOMBRE DE USUARIO: ";
cin >> nombre2;
cout << "NOMBRE DE USUARIO ACTUALIZADO. "<<endl;
goto actualizar;
break;
system("CLS");
case 2:
cout << "INGRESE EL NUEVO APELLIDO DE USUARIO: ";
cin >> apellido2;
cout << "APELLIDO DE USUARIO ACTUALIZADO. "<<endl;
goto actualizar;
break;
system("CLS");
case 3:
introducir1:
cout << "INGRESE SU NUEVO PASSWORD: ";
cin >> password2;
cout << "CONFIRME SU NUEVO PASSWORD: ";
cin >> conf2;
system("CLS");
if (conf2 == password2){
cout << "SU PASSWORD SE HA ACTUALIZADO
CORRECTAMENTE"<<endl;
goto actualizar;
}else {
cout << "SU PASSWORD NO COINDIDE, FAVOR INGRESARLA
NUEVAMENTE"<<endl;
goto introducir1;
}
break;
case 4:
goto menu;
break;

}
break;
case 3:
goto menu;
break;

} break;
case 3:
cout << "---LOGIN DE ACCESO---"<<endl<<endl;
cout << "INICIE SESION CON CUALQUIERA DE LOS DOS USUARIOS"<<endl;
cout << "1. INGRESE (1) PARA INICIAR SESION" <<endl;
cout << "2. SALIR"<<endl;
cout << "INGRESE LA OPCION: ";
cin >> login;

switch(login){
case 1:
cout << "---LOGIN DE ACCESO---"<<endl<<endl;
ir:
cout << "INGRESE SU NOMBRE DE PRIMER USUARIO:";
cin >> nuevonombre;
cout << "INGRESE SU PASSWORD: ";
cin >>nuevapass;

if (nuevonombre == nombre && nuevapass == conf1 || nuevonombre ==


nombre2 && nuevapass == conf2 ){
sistema:
cout << "---BIENVENIDO AL SISTEMA---"<<endl;
cout << "USTED TIENE ACCESO A LOS SIGUIENTES MODULOS"<<endl;
cout << "1. MODULO DE PACIENTES"<< endl;
cout << "2. MODULO DE REPORTES"<< endl;
cout << "3. SALIR"<< endl;
cout << "SELECCIONE EL MODULO AL QUE DESEA INGRESAR: ";
cin >> opcion2;

switch (opcion2){
case 1:
system("CLS");
modulo:
cout << "-----------------------" << endl;
cout << " MODULO DE PACIENTES " << endl;
cout << "-----------------------" << endl;
cout << "1. REGISTRO DE PACIENTES"<< endl;
cout << "2. ACTUALIZACION DE DATOS (PACIENTES)"<< endl;
cout << "3. ELIMIMACION DE PACIENTES"<< endl;
cout << "4. SALIR"<< endl;
cout << "INGRESE LA OPCION A REALIZAR: ";
cin >> opcionP;
system("CLS");

switch (opcionP){
case 1:
paciente:
cout << "---REGISTRO DE PACIENTES---"<<endl<<endl;
cout << "1. REGISTRAR PRIMER PACIENTE"<<endl;
cout << "2. REGISTRAR SEGUNDO PACIENTE"<<endl;
cout << "INGRESE LA OPCION:";
cin>>pac;

switch (pac){
case 1:
cout <<"---DATOS DEL PRIMER PACIENTE---"<<endl;
cout <<"INGRESE LO QUE SE LE PIDE"<<endl;
cout <<"PRIMER NOMBRE: ";
cin>>nom;
cout <<"SEGUNDO NOMBRE: ";
cin>>nom2;
cout <<"PRIMER APELLIDO: ";
cin>>ape;
cout <<"SEGUNDO APELLIDO: ";
cin>>ape2;
cout <<"EDAD: ";
cin>>edad;
cout <<"DOMICILIO: ";
cin >> dom;
cout <<"CODIGO PACIENTE: ";
cin>>cod;
cout << "PACIENTE REGISTRADO CON EXITO."<<endl<<endl;
system("CLS");
cout << "DESEA REGISTRAR EL SEGUNDO PACIENTE? (SI (S) - NO
(N))"<<endl;
cout << "INGRESE LA LETRA CORRESPONDIENTE: ";
cin >> Seguir1;

if (Seguir1 == "S"){
goto paciente;
} else{
cout << "HA DECIDIDO NO REGISTRAR EL SEGUNDO PACIENTE"<<endl;
goto modulo;
}
break;
case 2:
cout <<"---DATOS DEL SEGUNDO PACIENTE---"<<endl;
cout <<"INGRESE LO QUE SE LE PIDE"<<endl;
cout <<"PRIMER NOMBRE: ";
cin>>nom1;
cout <<"SEGUNDO NOMBRE: ";
cin>>nom3;
cout <<"PRIMER APELLIDO: ";
cin>>ape1;
cout <<"SEGUNDO APELLIDO: ";
cin>>ape3;
cout <<"EDAD: ";
cin>>edad1;
cout <<"DOMICILIO: ";
cin>>dom1;
cout <<"CODIGO PACIENTE: ";
cin>>cod1;
cout << "PACIENTE REGISTRADO CON EXITO."<<endl<<endl;
cout << "INGRESE (S) PARA VOLVER AL MODULO PACIENTES (DE LO CONTRARIO
VOLVERA AL MODULO DE ACCESO)"<<endl;
cout << "INGRESE LA LETRA CORRESPONDIENTE: ";
cin >> Seguir1;

if (Seguir1 == "S"){
goto modulo;
}else{
goto menu;
}
break;

}
case 2:
actualizar2:
cout << "---ACTUALIZACION DE DATOS
(PACIENTES)---"<<endl<<endl;
cout << "SELECCIONE AL PACIENTE AL CUAL DESEA ACTUALIZAR
SUS DATOS"<<endl;
cout << "1. PRIMER PACIENTE"<<endl;
cout << "2. SEGUNDO PACIENTE"<<endl;
cout << "3. SALIR"<<endl;
cout << "INGRESE LA OPCION A REALIZAR: ";
cin >> opcionA;
switch (opcionA){
case 1:
cout <<"---DATOS DEL PRIMER PACIENTE---"<<endl;
cout <<"PRIMER NOMBRE: "<<nom<<endl;
cout <<"SEGUNDO NOMBRE: "<<nom2<<endl;
cout <<"PRIMER APELLIDO: "<<ape<<endl;
cout <<"SEGUNDO APELLIDO: "<<ape2<<endl;
cout <<"EDAD: "<<edad<<endl;
cout <<"DOMICILIO: "<<dom<<endl;
cout <<"CODIGO PACIENTE: "<<cod<<endl;
cout << "CAMPOS QUE PUEDE ACTUALIZAR: "<<endl;
cout << "1. PRIMER NOMBRE"<<endl;
cout << "2. SEGUNDO NOMBRE"<<endl;
cout << "3. PRIMER APELLIDO"<<endl;
cout << "4. SEGUNDO APELLIDO"<<endl;
cout << "5. EDAD"<<endl;
cout << "6. DOMICILIO"<<endl;
cout << "7. CODIGO PACIENTE"<<endl;
cout << "8. SALIR"<<endl;
cout << "INGRESE LA OPCION: ";
cin >>actualizar2;

switch(actualizar2){
case 1:
cout << "INGRESE EL NUEVO NOMBRE DEL PACIENTE: ";
cin >> nom;
cout << "DATO ACTUALIZADO CORRECTAMENTE" <<endl;
goto actualizar2;
case 2:
cout << "INGRESE EL NUEVO NOMBRE DEL PACIENTE: ";
cin >> nom2;
cout << "DATO ACTUALIZADO CORRECTAMENTE" <<endl;
goto actualizar2;
case 3:
cout << "INGRESE EL NUEVO APELLIDO DEL PACIENTE: ";
cin >> ape;
cout << "DATO ACTUALIZADO CORRECTAMENTE" <<endl;
goto actualizar2;
case 4:
cout << "INGRESE EL NUEVO APELLIDO DEL PACIENTE: ";
cin >> ape2;
cout << "DATO ACTUALIZADO CORRECTAMENTE" <<endl;
goto actualizar2;
case 5:
cout << "INGRESE LA NUEVA EDAD DEL PACIENTE: ";
cin >> edad;
cout << "DATO ACTUALIZADO CORRECTAMENTE" <<endl;
goto actualizar2;
case 6:
cout << "INGRESE EL NUEVO DOMICILIO DEL PACIENTE: ";
cin >> dom;
cout << "DATO ACTUALIZADO CORRECTAMENTE" <<endl;
goto actualizar2;
case 7:
cout << "INGRESE EL NUEVO CODIGO DEL PACIENTE: ";
cin >> cod;
cout << "DATO ACTUALIZADO CORRECTAMENTE" <<endl;
goto actualizar2;
case 8:
goto actualizar2;
}
break;
case 2:
cout <<"---DATOS DEL SEGUNDO PACIENTE---"<<endl;
cout <<"PRIMER NOMBRE: "<<nom1<<endl;
cout <<"SEGUNDO NOMBRE: "<<nom3<<endl;
cout <<"PRIMER APELLIDO: "<<ape1<<endl;
cout <<"SEGUNDO APELLIDO: "<<ape3<<endl;
cout <<"EDAD: "<<edad1<<endl;
cout <<"DOMICILIO: "<<dom1<<endl;
cout <<"CODIGO PACIENTE: "<<cod<<endl;
cout << "CAMPOS QUE PUEDE ACTUALIZAR: "<<endl;
cout << "1. PRIMER NOMBRE"<<endl;
cout << "2. SEGUNDO NOMBRE"<<endl;
cout << "3. PRIMER APELLIDO"<<endl;
cout << "4. SEGUNDO APELLIDO"<<endl;
cout << "5. EDAD"<<endl;
cout << "6. DOMICILIO"<<endl;
cout << "7. CODIGO PACIENTE"<<endl<<endl;
cout << "8. SALIR"<<endl;
cout << "INGRESE LA OPCION: ";
cin >>actualizar3;
switch (actualizar3){
case 1:
cout << "INGRESE EL NUEVO NOMBRE DEL PACIENTE: ";
cin >> nom1;
cout << "DATO ACTUALIZADO CORRECTAMENTE" <<endl;
goto actualizar2;
case 2:
cout << "INGRESE EL NUEVO NOMBRE DEL PACIENTE: ";
cin >> nom3;
cout << "DATO ACTUALIZADO CORRECTAMENTE" <<endl;
goto actualizar2;
case 3:
cout << "INGRESE EL NUEVO APELLIDO DEL PACIENTE: ";
cin >> ape1;
cout << "DATO ACTUALIZADO CORRECTAMENTE" <<endl;
goto actualizar2;
case 4:
cout << "INGRESE EL NUEVO APELLIDO DEL PACIENTE: ";
cin >> ape3;
cout << "DATO ACTUALIZADO CORRECTAMENTE" <<endl;
goto actualizar2;
case 5:
cout << "INGRESE LA NUEVA EDAD DEL PACIENTE: ";
cin >> edad1;
cout << "DATO ACTUALIZADO CORRECTAMENTE" <<endl;
goto actualizar2;
case 6:
cout << "INGRESE EL NUEVO DOMICILIO DEL PACIENTE: ";
cin >> dom1;
cout << "DATO ACTUALIZADO CORRECTAMENTE" <<endl;
goto actualizar2;
case 7:
cout << "INGRESE EL NUEVO CODIGO DEL PACIENTE: ";
cin >> cod1;
cout << "DATO ACTUALIZADO CORRECTAMENTE" <<endl;
goto actualizar2;
case 8:
goto actualizar2;
}
break;
case 3:
goto modulo;
break;

} break;

case 3:
elim:
cout << "---ELIMINACION DE PACIENTES---"<<endl<<endl;
cout << "QUE PACIENTE DESEA ELIMINAR?"<<endl;
cout << "1. PRIMER PACIENTE"<<endl;
cout << "2. SEGUNDO PACIENTE"<<endl;
cout << "3. SALIR"<<endl;
cin >>eliminar;

switch (eliminar){
case 1:
cout << "DATOS DEL PRIMER PACIENTE"<<endl;
cout <<"---DATOS DEL PRIMER PACIENTE---"<<endl;
cout <<"PRIMER NOMBRE: "<<nom<<endl;
cout <<"SEGUNDO NOMBRE: "<<nom2<<endl;
cout <<"PRIMER APELLIDO: "<<ape<<endl;
cout <<"SEGUNDO APELLIDO: "<<ape2<<endl;
cout <<"EDAD: "<<edad<<endl;
cout <<"DOMICILIO: "<<dom<<endl;
cout <<"CODIGO PACIENTE: "<<cod<<endl;
cout << "PACIENTE ELIMINADO CORRECTAMENTE"<<endl;
goto elim;
break;
case 2:
cout << "DATOS DEL SEGUNDO PACIENTE"<<endl;
cout <<"PRIMER NOMBRE: "<<nom1<<endl;
cout <<"SEGUNDO NOMBRE: "<<nom3<<endl;
cout <<"PRIMER APELLIDO: "<<ape1<<endl;
cout <<"SEGUNDO APELLIDO: "<<ape3<<endl;
cout <<"EDAD: "<<edad1<<endl;
cout <<"DOMICILIO: "<<dom1<<endl;
cout <<"CODIGO PACIENTE: "<<cod<<endl;
cout << "PACIENTE ELIMINADO CORRECTAMENTE"<<endl;
goto elim;
break;
case 3:
goto modulo;
}
break;
case 4:
goto sistema;
} break;
case 2:
report:
system("CLS");
cout << "-----------------------" << endl;
cout << " MODULO DE REPORTES " << endl;
cout << "-----------------------" << endl;
cout << "1. REPORTE DE PACIENTES"<< endl;
cout << "2. REPORTE DE USUARIOS"<< endl;
cout << "3. SALIR"<< endl;
cout << "INGRESE LA OPCION A REALIZAR: ";
cin >> opcionreportes;
system("CLS");

switch (opcionreportes){
case 1:
cout << "---REPORTE PACINTES---"<<endl<<endl;
cout << "| REPORTE DEL PRIMER PACIENTE |"<<endl;
cout << "PRIMER PACIENTE NOMBRE: " <<nom << " " << nom2 << " " << ape
<< " " << ape2 <<endl;
cout << "LA EDAD DEL PRIMER PACIENTE ES: " << edad <<endl;
cout << "EL PACIENTE RESIDE EN: " << dom <<endl;
cout << "EL COGIDO DEL PACIENTE ES: " << cod << endl<<endl;

cout << "| REPORTE DEL SEGUNDO PACIENTE |"<<endl;


cout << "SEGUNDO PACIENTE NOMBRE: " <<nom1 << " " << nom3 << " " <<
ape1 << " " << ape3 <<endl;
cout << "LA EDAD DEL PRIMER PACIENTE ES: " << edad1 <<endl;
cout << "EL PACIENTE RESIDE EN: " << dom1 <<endl;
cout << "EL COGIDO DEL PACIENTE ES: " << cod1 << endl<<endl;

cout << "RESPORTE DE PACIENTES VERFICADO"<<endl;


cout << "DESEA VOLVER AL MODULO REPORTES? (SI (S) - NO (N)) "<<endl;
cout << "INGRESE LA LETRA CORRESPONDIENTE:";
cin >>Seguir2;

if (Seguir2 == "S"){
goto report;
} else{
cout << "HA DECIDIDO VOLVER AL INICIO DEL SISTEMA"<<endl;
goto sistema;
} break;
case 2:
cout << "---REPORTE USUARIOS REGISTRADOS---"<<endl<<endl;
cout << "| REPORTE DEL PRIMER USUARIO |"<<endl;
cout << "PRIMER USUARIO NOMBRE: " <<nombre<<endl;
cout << "PRIMER USUARIO APELLIDO: " << apellido <<endl;
cout << "PRIMER USUARIO CONTRASEÑA " << password1 <<endl<<endl;
cout << "| REPORTE DEL SEGUNDO USUARIO |"<<endl;
cout << "SEGUNDO USUARIO NOMBRE: " <<nombre2<<endl;
cout << "SEGUNDO USUARIO APELLIDO: " << apellido2 <<endl;
cout << "SEGUNDO USUARIO CONTRASEÑA " << password2 <<endl<<endl;
cout << "RESPORTE DE PACIENTES VERFICADO"<<endl;
cout << "DESEA VOLVER AL MODULO REPORTES? (SI (S) - NO (N)) "<<endl;
cout << "INGRESE LA LETRA CORRESPONDIENTE:";
cin >>Seguir2;

if (Seguir2 == "S"){
goto report;
} else{
cout << "HA DECIDIDO VOLVER AL INICIO DEL SISTEMA"<<endl;
goto sistema;
} break;
case 3:
goto sistema;
break;

}
}else{
cout << "SUS DATOS NO COINCIDEN, FAVOR INGRESARLOS
CORRECTAMENTE"<<endl;
goto ir;
} break;
case 2:
goto menu;
break;
}
case 4:
goto bienvenido;
break;
}

return 0;
}

También podría gustarte