#include <iostream>
#include <string>
using namespace std;
int main()
{
string nombre;
double ventas[7];
double totalVentas = 0;
double bono = 0;
double sueldoBaseDia = 300;
double sueldoSemana;
double aux;
cout << "EMPRESA BTA - CALCULO DE SUELDO SEMANAL\n";
cout << "Ingrese el nombre del vendedor: ";
getline(cin, nombre);
for(int i = 0; i < 7; i++)
{
cout << "Ingrese las ventas del dia " << i + 1 << ": $";
cin >> ventas[i];
totalVentas += ventas[i];
}
for(int i = 0; i < 6; i++)
{
for(int j = 0; j < 6 - i; j++)
{
if(ventas[j] < ventas[j + 1])
{
aux = ventas[j];
ventas[j] = ventas[j + 1];
ventas[j + 1] = aux;
}
}
}
if(totalVentas >= 105000)
{
bono = totalVentas * 0.15;
}
else if(totalVentas >= 70000)
{
bono = totalVentas * 0.10;
}
else if(totalVentas >= 35000)
{
bono = totalVentas * 0.05;
}
sueldoSemana = (sueldoBaseDia * 7) + bono;
cout << "\nVENTAS ORDENADAS DE MAYOR A MENOR\n";
for(int i = 0; i < 7; i++)
{
cout << ventas[i] << endl;
}
cout << "\nNombre del vendedor: " << nombre << endl;
cout << "Total de ventas semanales: $" << totalVentas << endl;
cout << "Bono semanal: $" << bono << endl;
cout << "Sueldo total semanal: $" << sueldoSemana << endl;
return 0;
}