Concept explainers
The following equation estimates the average calories burned for a person when exercising, which is based on a scientific journal article (source):
Calories = ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991 ) x Time / 8.368
Write a
Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
print('Calories: {:.2f} calories'.format(calories))
Ex: If the input is:
49 155 148 60
then the output is:
Calories: 736.21 calories
''' Calories = ((Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991) x Time / 8.368 '''
''' Type your code here. '''
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images
- Finish the program to compute how many gallons of paint are needed to cover the given square feet of walls. Assume 1 gallon can cover 350.0 square feet. So gallons = the square feet divided by 350.0. If the input is 250.0, the output should be: 0.714285714286arrow_forwardFind the numbers that can be written as the product of two nonnegative odd integers in succession and print them in increasing order. For each number found the program should check whether the number is a factor of a number chosen by the user and indicate this in the output. (For example, 35 is such a number as it can be written as the product of 5 and 7 (35=5x7), which are two odd numbers in succession). The user should specify how many such numbers they want to print, starting from a minimum valuearrow_forwardThe value of π can be approximated by using the following series:π=4(1-(1/3)+(1/5)-(1/7)+...+(1/(2n-1))+(1/(2n+1)))The following program uses this series to find the approximate value of π. However, the statements are in the incorrect order, and there is also a bug in this program. Rearrange the statements and remove the bug so that this program can be used to approximate π.#include <iostream>#include <iomanip>using namespace std;int main(){double pi = 0;long i;long n; cin >> n; cout << "Enter the value of n: "; cout << endl;if (i % 2 == 0) pi = pi + (1 / (2 * i + 1));else pi = pi - (1 / (2 * i + 1));for (i = 0; i < n; i++) { pi = 0;pi = 4 * pi;}cout << endl << "pi = " << pi << endl; return 0;}arrow_forward
- This program inputs the names of 5 students and the (integer) grades they earned in 3 tests. It then outputs the average grade for each student. It also outputs the highest grade earned in each test and the average of all grades in each test. Your output should look like this: Mary's average grade was 78.8% Harry's average grade was 67.7% etc... : : In test 1 the highest grade was 93% and the average was 89.2% In test 2........etc Your main method should be modular. Write a method that inputs the 5 names into an array (one dimensional), and returns this array to the main Write a method that inputs the 15 (integer) test grades into a (two-dimensional) array, and returns this array to the main Write a method that calculates the students averages and stores them in an array, and returns this array to the main Write a method that calculates the average grade for each test and stores them in an array, and returns this array to the main Write a method that determines the highest grade…arrow_forwardTeachers in most school districts are paid on a schedule that provides a salary based on their number of years of teaching experience. For example, a beginning teacher in the Lexington School District might be paid $30,000 the first year. For each year of experience after this first year, up to 10 years, the teacher receives a 2% increase over the preceding value. Write a program that displays a salary schedule, in tabular format, for teachers in a school district. The inputs are: 1. Starting salary 2. Annual percentage increase 3. Number of years for which to print the schedule Each row in the schedule should contain the year number and the salary for that year An example of the program input and output is shown below: Enter the starting salary: $30000 Enter the annual % increase: 2 Enter the number of years: 10 Year Salary 1 30000.00 2 30600.00 3 31212.00 4 31836.24 5 32472.96 6 33122.42 7 33784.87 8…arrow_forwardSimple python codearrow_forward
- Calories = ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991 ) x Time / 8.368 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output the average calories burned for a person. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:System.out.printf("%.2f", yourValue); Ex: If the input is: 49 155 148 60 the output is: Calories: 736.21 caloriesarrow_forwardThe following equation estimates the average calories burned for a person when exercising, which is based on a scientific journal article (source): Calories = ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991 ) x Time / 8.368 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output the average calories burned for a person. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print(f'calories: {calories:.2f} calories') Ex: If the input is: 49 155 148 60 then the output is: Calories: 736.21 caloriesarrow_forwardWrite a program that computes factorial for a desired number repeatedly until -1 is entered.Expected input and outputPlease enter a positive number for factorial calculation (-1 to end) :4factorial for 4 is 24Please enter a positive number for factorial calculation (-1 to end) :6factorial for 6 is 720Please enter a positive number for factorial calculation (-1 to end) :8factorial for 8 is 40320Please enter number for factorial calculation (-1 to end) :-1Submit 1 run of your program. It should have at least 5 inputs. The first three input as shown above and two other the inputs of your choice.Your program should work for any input. Do not add any logic in your code to limit the input. However for the run, try to limit your input between 1 and 15 just to keep the output simple.arrow_forward
- The following equation estimates the average calories burned for a person when exercising, which is based on a scientific journal article (source): Calories = ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991 ) x Time / 8.368 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output the average calories burned for a person. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print(f'Calories: {calories:.2f} calories')arrow_forwardProgram - python Ask the user to enter a number, and print the number out to the 2nd decimal place. For example, if they enter 10.686666666, your program will print 10.69.arrow_forwardA variable like userNum can store a value like an integer. Extend the given program to print userNum values as indicated. (Submit for 2 points). (1) Output the user's input. Enter integer: 4 You entered: 4 (2) Extend to output the input squared and cubed. Hint: Compute squared as userNum * userNum. (Submit for 2 points, so 4 points total). Enter integer: 4 You entered: 4 4 squared is 16 And 4 cub is 64!! (3) Extend to get a second user input into userNum2. Output sum and product. (Submit for 1 point, so 5 points total). Enter integer: 4 You entered: 4 4 squared is 16 And 4 cubed is 64 !! Enter another integer: 5 4 + 5 is 9 4 * 5 is 20 283902.1980792.goazgy7 LAB 1.16.1: Basic output with variables (Java) 0/5 АCTIVITY OutputWithVars.java Load default template. 1 import java.util.Scanner; 2 3 public class OutputwithVars { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int userNum = 0; 4 System.out.println("Enter integer: "); userNum = scnr.nextInt(); 10 11…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education