Concept explainers
Body Mass Index (BMI) helps in specifying the weight category a person belongs to, depending on their body weight. BMI is estimated using the following formula:
Write a
wherever required.
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
Absolute Java (6th Edition)
Additional Engineering Textbook Solutions
Problem Solving with C++ (10th Edition)
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Digital Fundamentals (11th Edition)
Starting Out with Python (4th Edition)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
- 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }arrow_forward22. One metric ton is approximately 2,205 pounds. Write a program that prompts the user to input the amount of rice, in pounds, a bag can hold. The program outputs the number of bags needed to store one metric ton of rice.arrow_forward(Statistics) This is the formula for the standard normal deviate, z, used in statistical applications: z=(X)/ X is a single value. refers to an average value. refers to a standard deviation. Using this formula, you need to write a program that calculates and displays the value of the standard normal deviate when X=85.3,=80,and=4. a. For this programming problem, how many outputs are required? b. How many inputs does this problem have? c. Determine a formula for converting input items into output items. d. Test the formula written for Exercise 7c, using the data given in the problem.arrow_forward
- Could you help me with this question. This course is Programming 1. This is the question, "A customer in a store is purchasing five items. Write a program that asks for the price of each item, and then displays the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 6 percent." Round your output to two decimal places.arrow_forwardCalories = ( (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_forwardCalories = ( (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('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 ''' I have put in so many codes and nothing is right. I am going nuts. I use python coding, and this example is on Zybooks. One person answered but I tried and still no luck. I tried to edit it and still no luck. i don't understand what I am doing wrongarrow_forward
- Summary During winter when it is very cold, typically, everyone would like to know the windchill factor, especially, before going out. Meteorologists use the following formula to compute the windchill factor, W: W = 35.74 + 0.6215 × T - 35.75 × V0.16 + 0.4275 × T × V0.16 where V is the wind speed in miles per hour and T is the temperature in degrees Fahrenheit. Instructions Write a program that prompts the user to input the wind speed in miles per hour, and the temperature in degrees Fahrenheit. The program then outputs the current temperature and the windchill factor. Your program must contain at least two functions: one to get the user input and the other to determine the windchill factor.arrow_forwardModify the provided code for the program that calculate the overtime hours to:a. calculate the weekly pay for week 1 and week 2 and b. then add them up to calculate the total pay earned for 2 weeks,c. then calculate the amount of taxes withheld based on 18% of the earned pay and d. finally calculate the net pay and display the earned pay, taxeswithheld and the net pay (see the output below) CODE: def calcWeeklyWages(totalHours, hourlyWage):# return the total weekly wages for a worked working totalHours,# with a given regular hourlyWage. Include overtime for hours over 40if totalHours <= 40:totalWages = hourlyWage*totalHoursprint("you had no overtime hours this week")else:overtime = totalHours - 40totalWages = hourlyWage*40 + (1.5*hourlyWage)*overtimeprint("your overtime hours this week are: ", overtime, "hours")return totalWages# main program (that you will need to modify)hours = float(input('Enter hours worked: '))wage = float(input('Enter dollars paid per hour: '))total =…arrow_forwardWrite a program calculating the area of a triangle with the length of the three sides as a, b, c, given by: where s is the semi-perimeter of the triangle, The perimeter of the triangle is given by P = a+b+c. Note: Use #include <math.h> preprocessor directive use the sqrt() function.arrow_forward
- A country charges income tax as follows based on one’s gross salary. No tax is charged on the first 20% of salary. The remaining 80% is called taxable income. Tax is paid as follows: 10% on the first $15,000 of taxable income; 20% on the next $20,000 of taxable income; 25% on all taxable income in excess of $35,000; Write a program to read a value for a person’s salary and print the amount of tax to be paid in dollars. Additional information: You may assume all data entered into your program is correctarrow_forwardA country charges income tax as follows based on one’s gross salary. No tax is charged on the first 20% of salary. The remaining 80% is called taxable income. Tax is paid as follows: 10% on the first $15,000 of taxable income; 20% on the next $20,000 of taxable income; 25% on all taxable income in excess of $35,000; Write a program to read a value for a person’s salary and print the amount of tax to be paid in dollars. Additional information: You may assume all data entered into your program is correct Write this program in C#arrow_forward11.5.1: Max and min numbers. Write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the three values. If the input is 7 15 3, the output is: largest: 15 smallest: 3 Your program should define and call two functions: Function LargestNumber(integer num1, integer num2, integer num3) returns integer largestNum Function SmallestNumber(integer num1, integer num2, integer num3) returns integer smallestNum The function LargestNumber should return the largest number of the three input values. The function SmallestNumber should return the smallest number of the three input values. Need program written in coral languagearrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr