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...
-
The L-shaped object in FIGURE 11-41 consists of three masses connected by light rods. What torque must be applied to this object to give it an angular acceleration of 1.20 rad/s2 if it is rotated...
-
What amount of gain or loss on bond retirement should be included in the 20X4 consolidated income statement? a. $4,000 gain b. $4,000 loss c. $12,000 gain d. $16,000 loss
-
Under what conditions may a debt due within the next year (as measured at year-end) be reported as a noncurrent liability? Under what conditions may a long-term debt (as measured at year-end) be...
-
Fair Value Measurement Presented below is information related to the purchases of common stock by Lilly Company during 2010. (a) What entry would Lilly make at December 31, 2010, to record the...
-
Very confused with this question and how to solve You have credit card debt of $25,000 that has an APR (monthly compounding) of 16%. Each month you pay the minimum monthly payment only. You are...
-
Manitoba Exporters Inc. (MEI) sells Inuit carvings to countries throughout the world. On December 1, Year 5, MEI sold 10,000 carvings to a wholesaler in a foreign country at a total cost of 600,000...
-
The following information relates to the only product manufactured and sold by Namwela limited. K per Unit Selling price 50 Direct Material cost 14 Direct labour cost 16 Variable production overhead...
-
Which sentence is wrong for an Ethernet frame? An Ethernet frame contains destination and source MAC addresses An Ethernet frame contains destination and source IP addresses An Ethernet frame does...
-
Determine the indefinite integral 108 1088 +9x7+48x2 dx.
-
Which resource CANNOT be managed via shares, reservations, or limits? network bandwidth uptime disk IOPS CPU cycles RAM
-
Image transcription text Activity 2A Estimated Time 20 Minutes (10 minutes for presentation) Objective To provide you with an opportunity to summarise key concepts and ideas .and present to target...
-
Which one of the following statements is false? A full binary tree has an even number of vertices. A binary tree is an m-ary with m = 2. In an m-ary tree, each internal vertex has at most m children....
-
Checks that have not cleared the bank for a lengthy period of time are referred to as stale-dated checks. Periodically, these stale-dated checks need to be removed from the accounting records. The...
-
The following T-accounts show postings of selected transactions. Indicate the journal used in recording each of these postings a through e. Cash Accounts Receivable Inventory (d) 500 (e) 300 (b)...
-
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...
-
If you owned stock in a publicly traded company, in which group of companies in Exhibit 8-3 would you want your company to be? Assume Elizabeth buys the Boardman stock and consistently earns an 8...
-
What financial effect will result if the hospital does not work toward those goals?
-
If Elizabeth could earn a 17 percent return on an investment in Hoffman Company stock (or some other company), what would you advise her to do? Explain your reasoning.
Study smarter with the SolutionInn App