Está en la página 1de 9

SALVADOR CASTRELLON

PROGRAMA DE SELECCIÓN DEL SERVICIO MILITAR


#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <conio.h>
using namespace std;
int main()
{
int i, n, sexo;
char nombre[100], apellido[100];
cout << " SELECCION DEL PERSONAL PARA EL SERVICIO MILITAR ";
cout << endl;
cout << endl;
cout << "SELECCIONE UNA OBCION DEL MENU ";
cout << endl;
cout << " SALIR = 1" << endl;
cout << " CONTINUAR = 2 " << endl;
cout << endl;
cout << "ELIJA UNA OPCION: ";
cin >> i;
switch (i)
{
case 1:
cout << "SALIR " << endl;
break;
case 2:
cout << "ElEGISTE CONTINUAR " << endl;
cout << "ESCRIBE TUS DATOS: " << endl;
cout << "NOMBRE: ";
cin >> nombre;
cout << "APELLIDO: ";
cin >> apellido;
cout << "EDAD: "; cin >> n;
cout << "SEXO: MUJER = 1 VARON = 2: "; cin >> sexo;
cout << endl;
switch (sexo)
{
case 1:
if (n < 21)
{
cout << "USTED NO ES ELEGIBLE PARA EL SERVICIO MILITAR";
}
else
if (n > 28) {
cout << "USTED NO ES ELEGIBLE PARA EL SERVICIO MILITAR";
}
else
cout << "USTED " << nombre << " " << apellido << " HA SIDO ELEGIDO PARA EL
SERVICIO MILITAR"; cout << endl;
break;
case 2:
if (n <18) {
cout << "USTED NO ES ELEGIBLE PARA EL SERVICIO MILITAR";
}
else
if (n > 30) {
cout << "USTED NO ES ELEGIBLE PARA EL SERVICIO MILITAR";
}
else
cout << "USTED " << nombre << " " << apellido << " HA SIDO ELEGIDO PARA
EL SERVICIO MILITAR"; cout << endl;
break;
}
}
cout << endl;
system("pause");
return 0;
}
SALVADOR CASTRELLON

CORRIDAS

Seleccionando Opción 1:

Seleccionando Opción 2:
SALVADOR CASTRELLON
SALVADOR CASTRELLON
SALVADOR CASTRELLON
SALVADOR CASTRELLON

PROGRAMA DE TRANSITAR EL TAXI


#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <conio.h>
using namespace std;
int main()
{
int i, dia, placa, n;
cout << " DIAS TRANSITABLE DEL TAXI ";
cout << endl;
cout << endl;
cout << "SELECCIONE UNA OBCION DEL MENU ";
cout << endl;
cout << " SALIR = 1" << endl;
cout << " CONTINUAR = 2 " << endl;
cout << endl;
cout << "ELIJA UNA OPCION: ";
cin >> i;
switch (i)
{
case 1:
cout << "SALIR " << endl;
break;
case 2:
cout << "ElEGISTE CONTINUAR " << endl;
cout << "ESCRIBE LOS SIGUIENTES DATOS: " << endl;
cout << "ESCRIBE EL ULTIMO DIGITO DE TU PLACA: ";
cin >> placa;
cout << "ELIGE EL NUMERO QUE CORRESPONDA AL DIA DE HOY: ";
cout << endl;
cout << " LUNES = 1";
cout << endl;
cout << " MARTES = 2";
cout << endl;
cout << " MIERCOLES = 3";
cout << endl;
cout << " JUEVES = 4";
cout << endl;
cout << " VIERNES = 5";
cout << endl;
cout << " SABADO = 6";
cout << endl;
cout << " DOMINGO = 7";
cout << endl;
cout << "DIA: ";
cin >> dia;
cout << endl;
if (placa % 2 == 0) {
if (dia % 2 == 1) {
cout << "puedes transitar lunes,miercoles,viernes";
cout << endl;
cout << "puedes transitar hoy";
}
else
if (dia % 2 == 0)
{cout << "no puedes transitar";
SALVADOR CASTRELLON

}
else
if (placa % 2 == 1) {
if (dia % 2 == 0) {
cout << "puedues transitar martes, jueves, sabado";
cout<<endl;
cout << "puedes transitar hoy";
}
else
if (dia % 2 == 1)
cout << "no puedes transitar";
}
else

break;
}
cout << endl;

system("pause");
return 0;
}

CORRIDA
SALVADOR CASTRELLON
SALVADOR CASTRELLON

También podría gustarte