Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Banquete
  5. {
  6. private:
  7. int np;
  8. int cp;
  9. int tot;
  10. public:
  11. Banquete ();
  12. int leerCantPersona();
  13. void presupuesto(int np);
  14.  
  15. };
  16. Banquete::Banquete()
  17. {
  18. cp=0;
  19. tot=0;
  20. }
  21. int Banquete::leerCantPersona()
  22. {
  23. cout <<"Digite el numero de personas: ";
  24. cin >> np;
  25. return np;
  26. }
  27. void Banquete::presupuesto(int np)
  28. {
  29. if(np > 300)
  30. {
  31. cp= 75000;
  32. }
  33. else
  34. {
  35. if(np > 200)
  36. {
  37. cp = 85000;
  38. }
  39. else
  40. {
  41. cp = 95000;
  42. }
  43. }
  44. tot = np*cp;
  45. cout <<"Costo del platillo: "<< cp <<endl;
  46. cout <<"Total a cobrar: "<< tot;
  47.  
  48. }
  49. int main()
  50. {
  51. Banquete ban;
  52.  
  53. int pr = ban.leerCantPersona();
  54. ban.presupuesto(pr);
  55.  
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement