Question

please help part one) Calories Burned Running on a particular-treadmill you burn 3.9 calories per minute....

please help

part one)

Calories Burned Running on a particular-treadmill you burn 3.9 calories per minute. Design a pro- gram that uses a loop to display the number of calories burned after 10, 15, 20, 25, and 30 minutes. 3

part two)


Sum of Numbers

Design a program with a loop that asks the user to enter a series of positive num bers. The user should enter a negative number to signal the end of the series. After all the positive numbers have been entered, the program should display their Sum



0 0
Add a comment Improve this question Transcribed image text
Answer #1

Note: Could you plz go through this code and let me know if u need any changes in this.Thank You
_________________


part one)

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

//Declaring constant

const double CALORIESBURNPERMIN=3.9;

//Displaying the output

for(int i=10;i<=30;i+=5)

{

cout<<"Calories Burned after "<<i<<" minutes:"<<i*CALORIESBURNPERMIN<<endl;

}

return 0;

}

_________________

Output:

__________________________

part two)

#include <iostream>
#include <vector>
using namespace std;

int main()
{
//Declaring variables
int num;
int sumPositive=0;
  
//Getting the number entered by the user
cout<<"Enter number :";
cin>>num;
  
//this loop continues to execute until the user enters -1
while(num>0)
{

sumPositive+=num;
  
cout<<"Enter number :";
cin>>num;
}
  
//Displaying the sum of positive numbers and negative numbers
cout<<"The Sum of Positive numbers:"<<sumPositive<<endl;

return 0;
}

___________________________

Output:

_______________Could you plz rate me well.Thank You

Add a comment
Know the answer?
Add Answer to:
please help part one) Calories Burned Running on a particular-treadmill you burn 3.9 calories per minute....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT