sauerplayer
6th November 2016, 04:25
What I had in mind before creating this program was, to declare and create all the ATM customer accounts
( database ) within Cuenta.h so that I can call every single one of them from main just by typing for example
Clase1 claseLuis( "Luis", 28, 3600 ) using program B or Clase1 ClaseLuis; using program A.
Clase2 claseDiana( "Diana", 23, 2200 ) using program B or Clase2 ClaseDiana; using program A.
Clase3 claseHector( "Hector", 26, 4500 ) using program B or Clase3 ClaseHector; using program A.
Clase2 and Clase3 does not yet exists in my current code but I guess I can add them all within "Cuenta.h" and
"cuenta.cpp"
within main obviously, with their respective passwords set for each one of them, but I wonder which program
is preferable to use "Program A or Program B"???
//****************( "Cuenta.h " )****************Part_Of_Program_"A"
#include<string>
using namespace std;
class Cuenta1{
public:
Cuenta1();
void establecerValores( string, int, int );
string obtenerUsuario( );
int obtenerEdad();
int obtenerMonto();
void pedirContrasenia();
void mostrarMensaje();
private:
string nombreUsuario;
int edadUsuario;
int montoUsuario;
int contraseniaUsuario;
};
//****************( " end of Cuenta.h " )****************Part_Of_Program_"A"
//****************( " Cuenta.cpp " )****************Part_Of_Program_"A"
#include<iostream>
#include"Cuenta.h"
using namespace std;
Cuenta1::Cuenta1(){
establecerValores( "Luis Alberto Sánchez M", 28, 3600 );
}
void Cuenta1::establecerValores( string nombre, int edad, int monto ){
nombreUsuario = nombre;
edadUsuario = edad;
montoUsuario = monto;
pedirContrasenia();
}
string Cuenta1::obtenerUsuario(){
return nombreUsuario;
}
int Cuenta1::obtenerEdad(){
return edadUsuario;
}
int Cuenta1::obtenerMonto(){
return montoUsuario;
}
void Cuenta1::pedirContrasenia(){
int contraseniaActual = 1988;
cout << "Por favor introduzca su contraseña : ";
cin >> contraseniaUsuario;
cout << "\n\n";
if( contraseniaUsuario == contraseniaActual )
mostrarMensaje();
if( contraseniaUsuario != contraseniaActual )
cout << "\n\n";
cout << "Usted ingreso una contraseña incorrecta se se reinicializara el sistema\n"
<< "por favor introduzca la contraseña correcta la proxima vez" << "\n\n" ;
}
void Cuenta1::mostrarMensaje(){
cout << "Bienvenido a cajeros Nature : " << obtenerUsuario() << " Edad " << obtenerEdad() << "usted tiene $ " << obtenerMonto() << "\n\n";
}
//****************( " end of cuenta.cpp " )****************Part_Of_Program_"A"
//****************( " main.cpp " )****************Part_Of_Program_"A"
#include<iostream>
#include<cstdlib>
#include "Cuenta.h"
using namespace std;
int main(){
Cuenta1 cuentaLuis;
system("PAUSE");
return 0;
}
//****************( " end of main.cpp " )****************Part_Of_Program_"A"
---------------------------------------------------------------------------------------------------------------------------------------------------------
//****************( "Cuenta.h " )****************Part_Of_Program_"B"
#include<string>
using namespace std;
class Cuenta1{
public:
Cuenta1( string, int, int );
void establecerValores( string, int, int );
string obtenerUsuario( );
int obtenerEdad();
int obtenerMonto();
void pedirContrasenia();
void mostrarMensaje();
private:
string nombreUsuario;
int edadUsuario;
int montoUsuario;
int contraseniaUsuario;
};
//****************( " end of Cuenta.h " )****************Part_Of_Program_"B"
//****************( " Cuenta.cpp " )****************Part_Of_Program_"B"
#include<iostream>
#include"Cuenta.h"
using namespace std;
Cuenta1::Cuenta1( string nombre, int edad, int monto ){
establecerValores( nombre, edad, monto );
}
void Cuenta1::establecerValores( string nombre, int edad, int monto ){
nombreUsuario = nombre;
edadUsuario = edad;
montoUsuario = monto;
pedirContrasenia();
}
string Cuenta1::obtenerUsuario(){
return nombreUsuario;
}
int Cuenta1::obtenerEdad(){
return edadUsuario;
}
int Cuenta1::obtenerMonto(){
return montoUsuario;
}
void Cuenta1::pedirContrasenia(){
int contraseniaActual = 1988;
cout << "Por favor introduzca su contraseña : ";
cin >> contraseniaUsuario;
cout << "\n\n";
if( contraseniaUsuario == contraseniaActual )
mostrarMensaje();
if( contraseniaUsuario != contraseniaActual )
cout << "\n\n";
cout << "Usted ingreso una contraseña incorrecta se se reinicializara el sistema\n"
<< "por favor introduzca la contraseña correcta la proxima vez" << "\n\n" ;
}
void Cuenta1::mostrarMensaje(){
cout << "Bienvenido a cajeros Nature : " << obtenerUsuario() << " Edad " << obtenerEdad() << "usted tiene $ " << obtenerMonto() << "\n\n";
}
//****************( " end of cuenta.cpp " )****************Part_Of_Program_"B"
//****************( " main.cpp " )****************Part_Of_Program_"B"
#include<iostream>
#include<cstdlib>
#include "Cuenta.h"
using namespace std;
int main(){
Cuenta1 cuentaLuis( "Luis Alberto Sanchez M", 28, 3600 );
system("PAUSE");
return 0;
}
//****************( " end of main.cpp " )****************Part_Of_Program_"B"
( database ) within Cuenta.h so that I can call every single one of them from main just by typing for example
Clase1 claseLuis( "Luis", 28, 3600 ) using program B or Clase1 ClaseLuis; using program A.
Clase2 claseDiana( "Diana", 23, 2200 ) using program B or Clase2 ClaseDiana; using program A.
Clase3 claseHector( "Hector", 26, 4500 ) using program B or Clase3 ClaseHector; using program A.
Clase2 and Clase3 does not yet exists in my current code but I guess I can add them all within "Cuenta.h" and
"cuenta.cpp"
within main obviously, with their respective passwords set for each one of them, but I wonder which program
is preferable to use "Program A or Program B"???
//****************( "Cuenta.h " )****************Part_Of_Program_"A"
#include<string>
using namespace std;
class Cuenta1{
public:
Cuenta1();
void establecerValores( string, int, int );
string obtenerUsuario( );
int obtenerEdad();
int obtenerMonto();
void pedirContrasenia();
void mostrarMensaje();
private:
string nombreUsuario;
int edadUsuario;
int montoUsuario;
int contraseniaUsuario;
};
//****************( " end of Cuenta.h " )****************Part_Of_Program_"A"
//****************( " Cuenta.cpp " )****************Part_Of_Program_"A"
#include<iostream>
#include"Cuenta.h"
using namespace std;
Cuenta1::Cuenta1(){
establecerValores( "Luis Alberto Sánchez M", 28, 3600 );
}
void Cuenta1::establecerValores( string nombre, int edad, int monto ){
nombreUsuario = nombre;
edadUsuario = edad;
montoUsuario = monto;
pedirContrasenia();
}
string Cuenta1::obtenerUsuario(){
return nombreUsuario;
}
int Cuenta1::obtenerEdad(){
return edadUsuario;
}
int Cuenta1::obtenerMonto(){
return montoUsuario;
}
void Cuenta1::pedirContrasenia(){
int contraseniaActual = 1988;
cout << "Por favor introduzca su contraseña : ";
cin >> contraseniaUsuario;
cout << "\n\n";
if( contraseniaUsuario == contraseniaActual )
mostrarMensaje();
if( contraseniaUsuario != contraseniaActual )
cout << "\n\n";
cout << "Usted ingreso una contraseña incorrecta se se reinicializara el sistema\n"
<< "por favor introduzca la contraseña correcta la proxima vez" << "\n\n" ;
}
void Cuenta1::mostrarMensaje(){
cout << "Bienvenido a cajeros Nature : " << obtenerUsuario() << " Edad " << obtenerEdad() << "usted tiene $ " << obtenerMonto() << "\n\n";
}
//****************( " end of cuenta.cpp " )****************Part_Of_Program_"A"
//****************( " main.cpp " )****************Part_Of_Program_"A"
#include<iostream>
#include<cstdlib>
#include "Cuenta.h"
using namespace std;
int main(){
Cuenta1 cuentaLuis;
system("PAUSE");
return 0;
}
//****************( " end of main.cpp " )****************Part_Of_Program_"A"
---------------------------------------------------------------------------------------------------------------------------------------------------------
//****************( "Cuenta.h " )****************Part_Of_Program_"B"
#include<string>
using namespace std;
class Cuenta1{
public:
Cuenta1( string, int, int );
void establecerValores( string, int, int );
string obtenerUsuario( );
int obtenerEdad();
int obtenerMonto();
void pedirContrasenia();
void mostrarMensaje();
private:
string nombreUsuario;
int edadUsuario;
int montoUsuario;
int contraseniaUsuario;
};
//****************( " end of Cuenta.h " )****************Part_Of_Program_"B"
//****************( " Cuenta.cpp " )****************Part_Of_Program_"B"
#include<iostream>
#include"Cuenta.h"
using namespace std;
Cuenta1::Cuenta1( string nombre, int edad, int monto ){
establecerValores( nombre, edad, monto );
}
void Cuenta1::establecerValores( string nombre, int edad, int monto ){
nombreUsuario = nombre;
edadUsuario = edad;
montoUsuario = monto;
pedirContrasenia();
}
string Cuenta1::obtenerUsuario(){
return nombreUsuario;
}
int Cuenta1::obtenerEdad(){
return edadUsuario;
}
int Cuenta1::obtenerMonto(){
return montoUsuario;
}
void Cuenta1::pedirContrasenia(){
int contraseniaActual = 1988;
cout << "Por favor introduzca su contraseña : ";
cin >> contraseniaUsuario;
cout << "\n\n";
if( contraseniaUsuario == contraseniaActual )
mostrarMensaje();
if( contraseniaUsuario != contraseniaActual )
cout << "\n\n";
cout << "Usted ingreso una contraseña incorrecta se se reinicializara el sistema\n"
<< "por favor introduzca la contraseña correcta la proxima vez" << "\n\n" ;
}
void Cuenta1::mostrarMensaje(){
cout << "Bienvenido a cajeros Nature : " << obtenerUsuario() << " Edad " << obtenerEdad() << "usted tiene $ " << obtenerMonto() << "\n\n";
}
//****************( " end of cuenta.cpp " )****************Part_Of_Program_"B"
//****************( " main.cpp " )****************Part_Of_Program_"B"
#include<iostream>
#include<cstdlib>
#include "Cuenta.h"
using namespace std;
int main(){
Cuenta1 cuentaLuis( "Luis Alberto Sanchez M", 28, 3600 );
system("PAUSE");
return 0;
}
//****************( " end of main.cpp " )****************Part_Of_Program_"B"