You are on page 1of 4

TALLER 1 - Estructura selectiva anidada en C++

Apellidos y Nombres: Charagua Zapana Paulo Cesar Jhocimar Grupo:CIV1-2.2


1.
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
int t;
cout<<"INGRESE TIPO DE VEHICULO: 1-BUS 2-PARTICULAR 3-CAMION:"<<endl;
cin>>t;
if(t==1)
{
cout<<"EL IMPORTE DEL BUS ES DE S/. 10:"<<endl;
}
else
{
if(t==2)
{
cout<<" EL IMPORTE DEL CARRO PARTICULAR ES DE S/. 15:"<<endl;
}
else
{
cout<<" EL IMPORTE DEL CAMION ES DE S/. 25:"<<endl;
}
}
return 0;
}
2)
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
float n1,n2,n3,n4,p;
cout<<"INGRESE 4 NOTAS:"<<endl;
cin>>n1>>n2>>n3>>n4;
if(n1<n2 and n1<n3 and n1<n4)
{
p=(n2+n3+n4)/3;
}
else
{
if(n2<n1 and n2<n3 and n2<n4)
{
p=(n1+n3+n4)/3;
}
else
{
if(n3<n2 and n3<n2 and n3<n4)
{
p=(n1+n2+n4)/3;
}
else
{
if(n4<n1 and n4<n2 and n4<n3)
{
p=(n1+n2+n3)/3;
}
}
}
}
cout<<"EL PROMEDIO ES: "<<p<<endl;
return 0;
}

3)
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
int ci,m;
char c;
float credito,p;
cout<<"INGRESE LOS CREDITOS INSCRITOS, CATEGORIA(A,B,C) Y MATRICULA(1-
NORMAL 2 - EXTEMPORANEA:"<<endl;
cin>>ci>>c>>m;
if(c=='a')
{
credito=125;
}
else
{
if(c=='b')
{
credito=150;
}
else
{
credito=180;
}
}
p=(ci*credito);
if(m==1)
{
cout<<"MATRICULA NORMAL, EL PAGO POR CICLO ES DE: S/."<<p<<endl;
}
else
{
cout<<"MATRICULA EXTEMPORANEO, EL PAGO POR CICLO ES DE:
S/."<<p+40<<endl;
}
return 0;
}

You might also like