fork download
  1. // Ex1.cpp.cpp : Defines the entry point for the console
  2. #include<iostream>
  3. using namespace std;
  4.  
  5. class Ex1
  6. {
  7. int peppermint, wrappers = 0, day = 0, n1, i;
  8. public:
  9. void getdata()
  10. {
  11. cout << "Enter The NO. Of Peppermints left and Wrappers::";
  12. cin >> peppermint >> wrappers;
  13. }
  14. void calculatep()
  15. {
  16.  
  17. if (peppermint != 0)
  18. {
  19. if (wrappers % 7== 0)
  20. {
  21. peppermint = peppermint + (wrappers / 7);
  22. }
  23. for (i = peppermint;i >= peppermint;i--)
  24. {
  25. wrappers = wrappers + i;
  26. day = day + i;
  27.  
  28. }
  29. cout << "The Days are ::" << day << endl;
  30. }
  31. }
  32.  
  33. };
  34.  
  35.  
  36.  
  37. int main()
  38. {
  39. Ex1 ex;
  40. ex.getdata();
  41. ex.calculatep();
  42. return 0;
  43.  
  44. }
Success #stdin #stdout 0s 15240KB
stdin
p 
papagaio
stdout
Enter The NO. Of Peppermints left and Wrappers::