fork download
  1. //Andres Guzman CSC5 Chapter 3, P. 144, #7
  2. //
  3. /**************************************************************
  4. *
  5. * CALCULATE CALORIC SERVINGS
  6. * ____________________________________________________________
  7. * This program calculates the amount of calories eaten per cookie*
  8. * Computation is based on the formula:
  9. * cookie *= 30
  10. * ____________________________________________________________
  11. * INPUT
  12. * cookie : number of cookies eaten
  13. * OUTPUT
  14. * cookie *= 30 : each cookie multiplied by 30 representing calories for singular
  15. * cookie
  16. **************************************************************/
  17. #include <iostream>
  18. #include <cmath>
  19. using namespace std;
  20.  
  21. int main ()
  22. {
  23. int cookie;
  24. //
  25. //
  26. cout << "How many cookies were eaten: ";
  27. cin >> cookie;
  28. cookie *= 30;
  29. cout << "\nTotal Calories: " << cookie << endl;
  30. return 0;
  31. }
Success #stdin #stdout 0s 5300KB
stdin
40
stdout
How many cookies were eaten: 
Total Calories: 1200