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
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
please help part one) Calories Burned Running on a particular-treadmill you burn 3.9 calories per minute....
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 10, 15, 20, 25, and 30 minutes. Must be in VBA using option explicit
Running on a particular treadmill you burn 3.4 calories per minute. Write a program that uses a loop to display the number of calories burned after 5, 10, 15, 20, 25, 30 and 35 minutes. C++
Running on a particular treadmill, you burn 4 calories per minute. Write an 80x86 assembly program that uses a loop to display the number of calories burned after 5, 10, 15, 20, 25, and 30 minutes. PLEASE WRITE an 8086 ASSEMBLY program!
Need the VBA code for excel Time to Burn Calories Assume you are afiness trainer and would lhke to help your clients better calculate the number of calories they burn on your treadmill Your treadmill burns 89 calories per minute. You desire to create a program which asks the person to enter the desired number of calories to burn and output the number of minures required on your treadmill Note: They might burn slightly more calories than their goal unless...
Write a program that calculates the calories burned while running over a given number of miles. While several factors determine how many calories are burned during a mile run, for this program, 90 calories are burned for every mile of running. The cumulative calories burned during a run can be calculated as: Calories * Distance For example, if a person runs 5 miles, the total calories burned is 450. After 3 hours, the person has burned 2 calories. The program...
Write a code using loop and flag function in python jupitior notebook: Ask the user for the number of items they bought. Also ask the price of each item they bought and quantity purchased. Display the total amount they owe. Ask the user for a number n. Calculate 1+2+3+….+n. Ask the user for a number n. Calculate 1*2*3*…*n. Ask the user for number of rows (r) and columns (c). Print * for r rows and c columns. Ask the user...
1. (sumFrom1.cpp) Write a program that will ask the user for a positive integer value. The program should use the for loop to get the sum of all the integers from 1 up to the number entered. For example, if the user enters 50, the loop will find the sum of 1, 2, 3, 4, ... 50. If the user enters a zero or negative number, a message should be given and the program should not continue (see Sample Run...
Lab 5-2 Nested Loops 2. Summation Of Numbers (using Nested While Loops) Part A: The program will calculate and display the total of all numbers up to a specific number (entered by the user). Only positive numbers are allowed. Part B: User-controlled loop Part A Input Validation loop Part A: Summation loop Examples: When 5 is entered the program will calculate the total as 1+2+...+5 and display 15. When 2 is enterered the program will calculate the total as 1+2...
Hi please help me with this zybooks question asap. Thanks 4.17 Chapter 4 Program: Sum of Numbers/C++ program Write a C ++ program that asks the user for a positive integer value by prompting "Enter a positive integer number: ", read in that number, then use a loop to get the sum of all the integers from 1 up to the number entered. For example, if the user enters 50, the loop will find the sum of 1, 2,3, 4…50....
PLEASE HELP!!!I need help with the following JAVA PROGRAMS. Please ready carefully. So this comes from tony gaddis starting out with java book. I have included the screenshot of the problems for reference. I need HELP implementing these two problems TOGETHER. There should be TWO class files. One which has TWO methods (one to implement problem 8, and one to implement problem 9). The second class should consist of the MAIN program with the MAIN method which calls those methods....