Write a program that prompts for a person's age in years and heart beats rate per...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that prompts for a person's age in years and heart beats rate per minute. The program computes and output the number of heart beats since the person was born. You may assume that there are 365 days in a year. Note: Use constants whenever necessary Input/ Output Sample: input Enter the person's age in years: 21 Enter the heart beats rate per minute: 71 The estimated number of heartbeats since the person was born is: 7.8367c+08 2. One metric ton is approximately 2205 pounds. A bag can hold N pounds of rice. Write a program that prompts the user to input the amount of rice in tons and the bag's capacity in pounds. The program then outputs the number of bags needed to store the specified amount of rice. Example: If the amount of rice is 3 tons and the bag's capacity is 12 pounds, then there are 3 * 2205 = 6615 pounds of rice altogether and 6615 / 12 = 551.25 ≈ 552 bags. (Hint: you may use the ceil function) Start by writing an algorithm you can follow to solve the problem. Input/Output Sample: Enter the amount of rice in tons: 3 Enter the bag's capacity in pounds: 12 You will need approximately 552 bags to store the rice. 3. A real number with only one decimal place is entered. Write a program that reverses it. For example, if the input is 9.4, the answer should be 4.9. Input/Output Sample: input Enter a real number with one decimal place: 9.4 The reversed number is: 4.9 Chapter 4: Selection Statements 4. SEWA Bill: Write a program that prompts the user to enter the amount of consumed water in gallons and electricity in watts. The program calculates the bill assuming that the water and electricity rates are as in the following table: Water Gallons <200 200 and 850 > 850 Input/Output Sample: input Rate 0.75 1.15 2.75 Electricity Electricity Bill is AED 2000.43 Total Bill is AED 2346.06 Watts ≤ 2500 > 2500 Rate 0.5 0.8 Enter the amount of the water consumed in gallons: 300.546 Enter the amount of electercity consumed in watts: 2500.54 Water Bill is AED 345.628 input Objectives: . . . Basic practice on arithmetic operations. Basic practice on selection control. Basic practice on writing simple C++ programs. Exercise 1 2 3 4 5 Out of 2 2 2 2 2 Mark Write a program that prompts for a person's age in years and heart beats rate per minute. The program computes and output the number of heart beats since the person was born. You may assume that there are 365 days in a year. Note: Use constants whenever necessary Input/ Output Sample: input Enter the person's age in years: 21 Enter the heart beats rate per minute: 71 The estimated number of heartbeats since the person was born is: 7.8367c+08 2. One metric ton is approximately 2205 pounds. A bag can hold N pounds of rice. Write a program that prompts the user to input the amount of rice in tons and the bag's capacity in pounds. The program then outputs the number of bags needed to store the specified amount of rice. Example: If the amount of rice is 3 tons and the bag's capacity is 12 pounds, then there are 3 * 2205 = 6615 pounds of rice altogether and 6615 / 12 = 551.25 ≈ 552 bags. (Hint: you may use the ceil function) Start by writing an algorithm you can follow to solve the problem. Input/Output Sample: Enter the amount of rice in tons: 3 Enter the bag's capacity in pounds: 12 You will need approximately 552 bags to store the rice. 3. A real number with only one decimal place is entered. Write a program that reverses it. For example, if the input is 9.4, the answer should be 4.9. Input/Output Sample: input Enter a real number with one decimal place: 9.4 The reversed number is: 4.9 Chapter 4: Selection Statements 4. SEWA Bill: Write a program that prompts the user to enter the amount of consumed water in gallons and electricity in watts. The program calculates the bill assuming that the water and electricity rates are as in the following table: Water Gallons <200 200 and 850 > 850 Input/Output Sample: input Rate 0.75 1.15 2.75 Electricity Electricity Bill is AED 2000.43 Total Bill is AED 2346.06 Watts ≤ 2500 > 2500 Rate 0.5 0.8 Enter the amount of the water consumed in gallons: 300.546 Enter the amount of electercity consumed in watts: 2500.54 Water Bill is AED 345.628 input Objectives: . . . Basic practice on arithmetic operations. Basic practice on selection control. Basic practice on writing simple C++ programs. Exercise 1 2 3 4 5 Out of 2 2 2 2 2 Mark
Expert Answer:
Related Book For
Introduction To Probability And Statistics
ISBN: 9781133103752
14th Edition
Authors: William Mendenhall, Robert Beaver, Barbara Beaver
Posted Date:
Students also viewed these programming questions
-
Identify one sector that you think should be the main driver of Jamaica's economic development, and justify your choice. What challenges would this sector need to overcome to better stimulate...
-
Mention the types of maps
-
31% of American adults surveyed stated that giving up their phone for a day would be more difficult than giving up their significant other. In 2012, the United States population over the age of 18...
-
A limited partnership: Multiple Choice has an unlimited life. can opt to be taxed as a corporation. terminates at the death of any one limited partner. has at least one partner who has unlimited...
-
Estimate the value of f (a) by zooming in on the graph of f. Then differentiate to find the exact value of f (a) and compare with your estimate. -x. a - 1 38. f(x) = 1/V. 37. f(x) - 3x
-
After the War of the Rings, the surviving orcs of Moria, Mordor, Isengard, and the Misty Mountains formed a cartel controlling toxic waste disposal. Lands in the West had no alternative but to deal...
-
Exercise 2.229 plotted the Golden State Warriors point differential, Golden State points - Opponent points, each minute of one game during their record breaking 2015-2016 season. Adam Pearce of...
-
The U.S. Energy Department states that 60% of all U.S. households have ceiling fans. In addition, 29% of all U.S. households have an outdoor grill. Suppose 13% of all U.S. households have both a...
-
Based on the channel assignment and the channel use in Frequency Hopping FH communication system displayed in Fig. 3 below, find: a. The spreading code in the Transmitter b. The spreading code in the...
-
In this exercise, you create an application that allows the user to enter the gender (either F or M) and GPA for any number of students. The application should calculate the average GPA for all...
-
Home Internet Access In a recent year, a study found that 77% of adults ages 18-29 had internet access at home. A researcher wanted to estimate the proportion of undergraduate college students (18-29...
-
Given the information in Review Questions 4.1 and 4.2, explain what happens to the gains and relative prices of goods after trade begins. Questions 4.2 Suppose that Japan and Indonesia have the...
-
For an MA(2) model, the parameters have been estimated as 1 = 0. 8 and 2 = 0. 45. Check whether the parameters pass the invertibility condition.
-
Consider the model of endogenous population growth that we summarized in Figure 3.2. Figure 3.2. Suppose that the curve describing population growth rates always lies below the line describing growth...
-
Is economic equality feasible? Would other problems result from economic equality?
-
The study of moral principles is a. Christianity. b. ethics. c. CSR. d. philanthropy.
-
Moore Company purchased an item for inventory that cost $28 per unit and was priced to sell at $50. It was determined that the cost to sell is $30 per unit. Using the lower of cost or net realizable...
-
3M Company reports the following financial statement amounts in its 10-K report: a. Compute the receivables, inventory, and PPE turnover ratios for both 2018 and 2017. (Receivables turnover and...
-
Suppose you wish to estimate a population mean based on a random sample of n observations, and prior experience suggests that = 12.7. If you wish to estimate correct to within 1.6, with probability...
-
A study was conducted to compare the mean numbers of police emergency calls per 8-hour shift in two districts of a large city. Samples of 100 8-hour shifts were randomly selected from the police...
-
The results of an experiment to investigate product recognition for three advertising campaigns were reported in Example 11.14. The responses were the percentage of 400 adults who were familiar with...
-
Allister Company uses both debt capital and equity capital to fund new projects. The before-tax cost of debt capital is 12 percent. The cost of equity capital is 10 percent. Allister's effective tax...
-
Use an Internet search engine to identify three companies or agencies that use present worth analysis to make business decisions as evidenced in their annual reports.
-
Use the Internet to access ConocoPhillips's most recent annual report. a. What evidence do you find that ConocoPhillips continues to rely on present worth analysis in its corporate decision making?...
Study smarter with the SolutionInn App