fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string nombre;
  9. float ventas, bono = 0, sueldoBase = 300, sueldoTotal;
  10.  
  11. cout << "==========================================" << endl;
  12. cout << " EMPRESA BTA - CALCULO DE SUELDO DIARIO " << endl;
  13. cout << "==========================================" << endl;
  14.  
  15. cout << "Ingrese el nombre del vendedor: ";
  16. getline(cin, nombre);
  17.  
  18. cout << "Ingrese el monto de ventas del dia: $";
  19. cin >> ventas;
  20.  
  21. if (ventas >= 15000)
  22. {
  23. bono = ventas * 0.15;
  24. }
  25. else if (ventas >= 10000)
  26. {
  27. bono = ventas * 0.10;
  28. }
  29. else if (ventas >= 5000)
  30. {
  31. bono = ventas * 0.05;
  32. }
  33. else
  34. {
  35. bono = 0;
  36. }
  37.  
  38. sueldoTotal = sueldoBase + bono;
  39.  
  40. cout << "\n========== RESULTADOS ==========" << endl;
  41. cout << "Nombre del vendedor: " << nombre << endl;
  42. cout << "Ventas realizadas: $" << ventas << endl;
  43. cout << "Bono obtenido: $" << bono << endl;
  44. cout << "Sueldo total del dia: $" << sueldoTotal << endl;
  45. cout << "================================" << endl;
  46.  
  47. return 0;
  48. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
==========================================
 EMPRESA BTA - CALCULO DE SUELDO DIARIO 
==========================================
Ingrese el nombre del vendedor: Ingrese el monto de ventas del dia: $
========== RESULTADOS ==========
Nombre del vendedor: 
Ventas realizadas: $0
Bono obtenido: $0
Sueldo total del dia: $300
================================