0% found this document useful (0 votes)
24 views1 page

Source CPP

The document defines a struct called Estacionservicio to store employee data including name, last name, ID number, basic salary, and age. It then prompts the user to input data for 3 employees which is stored in an array and printed out.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

Source CPP

The document defines a struct called Estacionservicio to store employee data including name, last name, ID number, basic salary, and age. It then prompts the user to input data for 3 employees which is stored in an array and printed out.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

#include <iostream>

#include <string>
using namespace std;

struct Estacionservicio {
string nombre_empleado;
string apellido_empleado;
int cedula_ciudadania = 0;
int sueldo_basico = 0;
int edad = 0;
};

void imprimir(Estacionservicio[3]);
int main() {
Estacionservicio est[3];
for (int i = 0; i < 3; i++) {
cout << "Estacionservicio" << i + 1 << endl;
cout << " digite el Nombre del empleado" << endl;
cin >> est[i].nombre_empleado;
rewind(stdin);
cout << " digite el apellido del empleado" << endl;
cin >> est[i].apellido_empleado;
cout << "digite cedula ciudadana" << endl;
cin >> est[i].cedula_ciudadania;
rewind(stdin);
cout << "digite el sueldo basico" << " " << endl;
cin >> est[i].sueldo_basico;
rewind(stdin);
cout << "digite la edad" << " " << endl;
cin >> est[i].edad;
system("pause");
system("cls");
}
imprimir(est);
}

void imprimir(Estacionservicio est[]) {


for (int i = 0; i < 3; i++) {

cout << "Nombre del empleado" << est[i].nombre_empleado << endl;


cout << "Apellido del empleado" << est[i].apellido_empleado << endl;
cout << "cedula ciudadana" << est[i].cedula_ciudadania << endl;
cout << "sueldo basico" << est[i].sueldo_basico << endl;
cout << "edad" << est[i].edad << endl;
system("pause");
system("cls");
}

You might also like