Professional Documents
Culture Documents
EJERCICIO 2
#include <iostream> // Abriendo la librera iostream
using namespace std; // Se pueden usar abreviaturas
int main () //iniciamos el programa
{
int opcion;
cout<<"*******************************"<<endl;
cout<<"* MENU *"<<endl;
cout<<"*******************************"<<endl;
cout<<"1. Ingreso de datos"<<endl;
cout<<"2. Consulta de datos"<<endl;
cout<<"3. Modificacion de datos"<<endl;
cout<<"4. Eliminacion de datos"<<endl;
cout<<endl;
cout<<"INGRESE UNA OPCION DEL MENU (1-4): ";
cin>>opcion;
cout<<endl;
switch (opcion) {
case 1: JAIRO LUIS VSQUEZ AUQUI
EJERCICIO 3
#include <iostream> // Abriendo la librera iostream
#include <string> // Abriendo la librera string
using namespace std; // Se pueden usar abreviaturas
int main () //iniciamos el programa
{
int opcion;
cout<<"*******************************"<<endl;
cout<<"* MENU *"<<endl;
cout<<"*******************************"<<endl;
cout<<"1. Retirar efectivo"<<endl;
cout<<"2. Traspaso entre cuentas"<<endl;
cout<<"3. Consulta de saldos"<<endl;
cout<<"4. Otras operaciones"<<endl;
cout<<"5. Salir"<<endl;
cout<<endl;
cout<<"INGRESE UNA OPCION DEL MENU (1-5): ";
cin>>opcion;
cout<<endl;
switch (opcion) {
case 1:
cout<<"1. RETIRAR EFECTIVO"<<endl;
cout<<endl;
cout<<"1.1 50 soles"<<endl;
cout<<"1.2 100 soles"<<endl;
cout<<"1.3 otras cantidades"<<endl;
cout<<endl;
break;
case 2:
cout<<"2. TRASPASO A SU CUENTA"<<endl;
cout<<endl;
cout<<"2.1 A su propia cuenta"<<endl;
cout<<"2.2 A cuenta de terceros"<<endl;
cout<<endl;
break;
case 3:
cout<<"3. CONSULTA DE SALDOS"<<endl; JAIRO LUIS VSQUEZ AUQUI
cout<<endl;
cout<<"3.1 Ultimos movimientos"<<endl;
cout<<"3.2 Saldo total"<<endl;
cout<<endl;
break;
case 4:
cout<<"4. OTRAS OPERACIONES"<<endl;
cout<<endl;
cout<<"4.1 Pago de servicios"<<endl;
cout<<"4.2 Otros"<<endl;
cout<<endl;
break;
case 5:
cout<<"Gracias por usar este servicio, hasta pronto."<<endl;
cout<<endl;
break;
default:
cout<<"Opcion incorrecta"<<endl;
}
system ("pause");
}
EJERCICIO 4
#include <iostream> // Abriendo la librera iostream
#include <string> // Abriendo la librera string
using namespace std; // Se pueden usar abreviaturas
int main () //iniciamos el programa
{
int valor, cantidad,total;
cout<<"Ingrese el precio del libro: ";
cin>>valor;
cout<<"Ingrese la cantidad de libros que lleva: ";
cin>>cantidad;
cout<<endl;
if(cantidad>=6){
total=(valor*cantidad)*0.85;
cout<<"El total por los libros es: "<<total<<endl;
cout<<endl;
}
else{
cout<<"El total por los libros es: "<<total<<endl;
total=(
cout<<endl;
valor*
}
cantid
system ("pause");
ad)*0.
}
95;
EJERCICIO 5
#include <iostream> // Abriendo la librera iostream
#include <string> // Abriendo la librera string
using namespace std; // Se pueden usar abreviaturas JAIRO LUIS VSQUEZ AUQUI
EJERCICIO 6
#include <iostream> // Abriendo la librera iostream
using namespace std; // Se pueden usar abreviaturas
int main () //iniciamos el programa
{
int dia, mes,ao;
float ventas, descuento, total;
cout<<"BIENVENIDO"<<endl;
cout<<"Ingrese la fecha de hoy dd/mm/aa: "<<endl;
cout<<"Dia: ";
cin>>dia;
cout<<"Mes: ";
cin>>mes;
cout<<"Ano: ";
cin>>ao;
cout<<endl;
if(dia>0 && dia<=31 && mes>0 && mes<=12 && ao>2000 && ao<2020){
cout<<"Hoy es: "<<dia<<"/"<<mes<<"/"<<ao<<endl;
cout<<endl;
cout<<"Ingrese el total por ventas: ";
cin>>ventas; JAIRO LUIS VSQUEZ AUQUI
}
if(ventas>6000){
descuento=ventas*0.82;
total=descuento;
cout<<"El total a pagar es: "<<total<<" soles"<<endl;
}
}
}
else
{
cout<<"Fecha es incorrecta"<<endl;
}
cout<<endl;
//proceso
system ("pause");
}