fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. int main()
  7. {
  8. //definicion de variables pv=Prendas Vendidas y sb=Sueldo Base, venta1= 3-8, venta2=9-12, venta3=13-18
  9. int pv;
  10. int sb;
  11. int venta1=25;
  12. int venta2=45;
  13. int venta3=70;
  14. int totalprevio;
  15. int total;
  16.  
  17. cout<<"Ingrese el sueldo base\n";
  18. cin>>sb;
  19. cout<<"Ingrese la cantidad de prendas vendidas\n";
  20. cin>>pv;
  21.  
  22.  
  23. if (( pv >= 3) && (pv <= 8 ))
  24. {
  25. totalprevio=pv*venta1;
  26. total= totalprevio+sb;
  27. cout<<"Tu sueldo es ="<<total ;
  28.  
  29. }
  30. if (( pv >= 9) && (pv <= 12 ))
  31. {
  32. totalprevio=pv*venta2;
  33. total= totalprevio+sb;
  34. cout<<"Tu sueldo es ="<<total ;
  35.  
  36. }
  37. if (( pv >= 13) && (pv <= 18 ))
  38. {
  39. totalprevio=pv*venta3;
  40. total= totalprevio+sb;
  41. cout<<"Tu sueldo es ="<<total ;
  42.  
  43. }if ( pv <3)
  44. {
  45.  
  46. cout<<"Tu sueldo es ="<<sb ;
  47.  
  48. }
  49. return 0;
  50. }
Success #stdin #stdout 0.01s 5360KB
stdin
Standard input is empty
stdout
Ingrese el sueldo base
Ingrese la cantidad de prendas vendidas