The thing that i want to make is first ask what vehicle's stats do you want to know with getline
Something like this:
cout << "Write an vehicle name" << endl;
And if the user write Mustang, call to Mustang.mostrarMensaje, but I don't want to use if I want something more automatic
#include <cstdlib>
#include <iostream>
#include <string>
using std::cout;
using std::endl;
using std::string;
using namespace std;
class Vehiculos
{
public:
int suGas;
int suVelocidad;
int suCondicion;
int suTipo;
void mostrarMensaje()
{
cout << "Estadisticas de su vehiculo!" << endl;
cout << "Gas:" << suGas << endl;
cout << "Velocidad maxima:" << suVelocidad << endl;
cout << "Condicion:" << suCondicion << endl;
cout << "Tipo:" << suTipo << endl;
}
};
int main(int argc, char *argv[])
{
Vehiculos Mustang;
Mustang.suGas = 100;
Mustang.suVelocidad = 250;
Mustang.suCondicion = 100;
Mustang.suTipo = 2;
Mustang.mostrarMensaje();
system("PAUSE");
return EXIT_SUCCESS;
}