Examen Programación

Descargar como pdf o txt
Descargar como pdf o txt
Está en la página 1de 3

#include <iostream>

using namespace std;

// Variables globales
int contMatricula = 0, contMensualidad = 0, contCertificado = 0;
float AcumuladorMatricula = 0, AcumuladorMensualidad = 0,
AcumuladorCertificado = 0;

// Funciones
void registroMatricula();
void registroMensualidad();
void registroCertificado();
void Reporte();

void registroMatricula() {
AcumuladorMatricula += 50;
contMatricula++;

cout << "Se registro su matricula " << endl;


}

void registroMensualidad() {
AcumuladorMensualidad += 150;
contMensualidad++;

cout << "Se registro su mensualidad" << endl;


}
void registroCertificado() {
AcumuladorCertificado += 20;
contCertificado++;
cout << "Se registro su certificado." << endl;
}
int main() {
int opc;

do {
cout << " MENU DE OPCIONES " << endl;
cout << "===============================" << endl;
cout << "1. Registrar matricula (S/. 50)" << endl;
cout << "2. Registrar mensualidad (S/. 150)" << endl;
cout << "3. Registrar certificado de estudios (S/. 20)" <<
endl;
cout << "4. Generar reporte" << endl;
cout << "5. Salir" << endl;
cout << "Seleccione una opcion [1 - 5]: ";
cin >> opcion;

cin >> opcion;

switch (opcion) {
case 1:
Matricula();
break;
case 3:
Certificado();
break;
case 4:
generarReporte();
break;
case 5:
cout << "Hasta luego!!!!....."<<endl;
break;
}

} while (opcion!= 5) ;//validar opcion


return 0;
}
void Certificado() {
contCertificado++;
sumaCertificado += 20;
cout << "Certificado registrado exitosamente...."<<endl;
}
void Matricula() {
contMensualidad++;
sumaMensualidad += 150;
cout << "Mensualidad registrada exitosamente....."<<endl;
}
void generarReporte() {
double totRecaudado = 0;
totRecaudado = sumaMatricula + sumaMensualidad + sumaCertificado;
//calculo del total
cout << "\n Reporte de Servicios
" << endl;
cout <<
"===============================================================" <<
endl;
cout << "Nro----CONCEPTO ------ CANT. - P.U. ---- IMPORTE" <<
endl;
cout << "--------------------------------------------------------
-------" << endl;
cout << "1 Matricula " << "---- "<< contMatricula << "
50 " << " -------- " << sumaMatricula << endl;
cout << "2 Mensualidad " << "---- " << contMensualidad <<
" 150 " << " -------- " << sumaMensualidad << endl;
cout << "3 Certificado " << "---- " << contCertificado <<
" 20 " << " -------- " << sumaCertificado << endl;
cout <<
"===============================================================" <<
endl;
cout << "Monto total S/. " << totRecaudado << endl;
}

También podría gustarte