fork download
  1. /*******************************************************************************
  2.  * Aiden Stannard // CS1A // Chapter 5 Homework: Challange 4# // 10/03/2026
  3.  *
  4.  * Calories Burned
  5.  *
  6.  * This program outputs the number of calories burned after an amount of time
  7.  * in minutes, starting from 10 and ending at 30 in increments of 5 minutes.
  8.  *
  9.  * Inputs:
  10.  * NO INPUT
  11.  *
  12.  * Output:
  13.  * The number of calories burned after __ Minutes is __
  14.  ******************************************************************************/
  15. #include <iostream>
  16. using namespace std;
  17.  
  18. int main()
  19. {
  20. const float cal = 3.9; // Amount of Calories burned after 1 minute
  21. int minutes = 10;
  22.  
  23. while (minutes <= 30)
  24. {
  25. cout << "The number of calories burned after " << minutes << " Minutes is "
  26. << cal * minutes << endl;
  27. minutes += 5;
  28. }
  29. return 0;
  30. }
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
The number of calories burned after 10 Minutes is 39
The number of calories burned after 15 Minutes is 58.5
The number of calories burned after 20 Minutes is 78
The number of calories burned after 25 Minutes is 97.5
The number of calories burned after 30 Minutes is 117