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.
1
Expert's answer
2012-11-06T10:23:01-0500
#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

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS