Está en la página 1de 4

UNIVERSIDAD MILTAR NUEVA GRANADA

CENTRO DE SISTEMAS
PROGRAMACIN 1
QUIZ TALLER 12
NOMBRE: Nicolas Rincon Gonzalez

CDIGO 6000237

Haga un programa en C++, que permita


Una compaa debe calcular la comisin que reciben los vendedores de su departamento de
ventas teniendo en cuenta el monto mensual de ventas de cada uno. Las comisiones se
calculan as:
Ventas menores que $5.000.000 el 5%
Ventas entre $5.000.000 y $10.000.000 el 7.5%
Ventas Mayores que $10.000.000 hasta $20.000.000 el 10%
Ventas superiores a $20.000.000 el 15%
Crear un programa en Visual C++ que muestre para cada vendedor el monto total de las
ventas y la comisin correspondiente.

/*Objetivo: crear un programa que calcule la comisin que reciben los vendedores
teniendo en cuenta el monto mensual de ventas
Autor: Nicolas Rincon g
Fecha: 22/09/2016*/
# include<iostream>
# include<iomanip>
using namespace std;
float main()
{
//DECLARACION DE VARIABLES
int valor de ventas;
double ventas,, pago = 0;
// MENU DE OPCIONES
cout << "\n\n\n\t\t NUMERO DE COMISIONES\n\n";
cout << "\t\t 1.- VENTAS MENORES A $5.000.000 \n\n";
cout << "\t\t 2.- VENTAS ENTRE $5.000.000 Y $10.000.000 \n\n";
cout << "\t\t 3.- VENTAS ENTRE $10.000.000 Y $20.000.000 \n\n";
cout << "\t\t 4.- VENTAS SUPERIORES A $20.000.000 \n\n";
//SELECCION DE OPCION
cout << "\t\t DIGITE EL NUMERO DE VENTAS MENSUAL:
";
cin >> valor de ventas;
//ELABORACION DEL SWITCH
cout << "\n\n";
system("cls");
switch (opcion)
{
case 1:
cout << "\n\n\t DIGITE SU VALOR DE COMISION:
";
Visual C++ 2012 Programacin I Taller 12 Estructura Repetitivas

Pgina

cin >> valor de ventas;


pago = valor de ventas*0.5;
cout << "\n\n\t EL VALOR DE VENTAS: $ "<<setw(8) <<
setiosflags(ios::fixed) << setprecision(0) << pago;
cout << "\n\n";
system("pause>Null");
cout << "\n\n";
system("cls");
break;
case 2:

cout << "\n\n\t DIGITE SU VALOR DE COMISION:


";
cin >> valor de comision;
if(valor de comisin>$10.000.000)//(valor de comisin<$5.000.000);
cout <<EL VALOR DE LA COMISION NO CORRESPONDE<<endl;
system(pause);
return 0;
pago = valor de ventas*7.5;
cout << "\n\n\t EL VALOR DE VENTAS: $ "<<setw(8) <<
setiosflags(ios::fixed) << setprecision(0) << pago;
cout << "\n\n";
system("pause>Null");
cout << "\n\n";
system("cls");
break;
case 3:

cout << "\n\n\t DIGITE SU VALOR DE COMISION:


";
cin >> valor de comision;
if(valor de comisin>$20.000.000)//(valor de comisin<$10.000.000);
cout <<EL VALOR DE LA COMISION NO CORRESPONDE<<endl;
system(pause);
return 0;
pago = valor de ventas*0.10;
cout << "\n\n\t EL VALOR DE VENTAS: $ "<<setw(8) <<
setiosflags(ios::fixed) << setprecision(0) << pago;
cout << "\n\n";
system("pause>Null");
cout << "\n\n";
system("cls");
break;
case 4:

cout << "\n\n\t DIGITE SU VALOR DE COMISION:


";
cin >> valor de comision;
if(valor de comisin<$20.000.000);
cout <<EL VALOR DE LA COMISION NO CORRESPONDE<<endl;
system(pause);
return 0;
pago = valor de ventas*0.15;
cout << "\n\n\t EL VALOR DE VENTAS: $ "<<setw(8) <<
setiosflags(ios::fixed) << setprecision(0) << pago;
cout << "\n\n";
system("pause>Null");
cout << "\n\n";
system("cls");
break;
Visual C++ 2012 Programacin I Taller 12 Estructura Repetitivas

Pgina

default:
cout << "\n\n\t LA OPCION ES ERRADA EL RPOGRAMA SE CIERRA";
cout << "\n\n";
system("pause>Null");
cout << "\n\n";
system("cls");
}//FIN DEL SWITCH
cout << "\n\n";
system("pause>Null");
return 0;
}// FIN DEL PROGRAMA

Visual C++ 2012 Programacin I Taller 12 Estructura Repetitivas

Pgina

Visual C++ 2012 Programacin I Taller 12 Estructura Repetitivas

Pgina

También podría gustarte