65 859
Assignments Done
99,1%
Successfully Done
In October 2018

Answer to Question #17850 in C++ for jared

Question #17850
• Running on a particular treadmill you burn 3.9 calories per minute. Write a program that uses a loop to display the number of calories burned after 5, 10, 15, 20, 25 and 30 minutes. Use a while{} loop construct to solve this problem.
Expert's answer
#include <iostream>
using namespace std;

int main ()
{
inti = 0;
do
{
doublecalories = i * 3.90;
cout<< calories << " burnt after " << i << "
minute(s)" << endl;
i++;
}while(i <= 30);

system("pause");
return0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Assignment Expert
01.06.15, 17:05

Dear IBN, thank you for answer.

IBN
02.05.15, 19:32

i=10;
while(i<=30)
{
cout<<i*3.6<<" calories burnt in "<< i << "minutes";
i=i+5;
}

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions