1- A hurricane hit Florida and the freezer is out of power!! Write a program that estimates the temperature in a freezer (in °C) given the elapsed time (hours) since the power failure happened. Assume this temperature (T) is given by 4t? T = t + 2 20 where t is the time since a power failure. You can tell that the freezer temperature is normally set to -20 °C. a) Your program should prompt the user to enter how long it has been since the start of the freezer power failure in whole hours and minutes. You should also sympathize with the user b) You would need to convert the elapsed time into hours. For example, if the user entered 2 30 (2 hours 30 minutes), you would need to convert this to 2.5 hours. c) Your program should then calculate the freezer temperature in Celsius degrees. Note: the temperature of the freezer should increase as the power failure time lapse increases. This is a good test to run your program at different times (t) and test for correctness of the program. d) Convert that calculated temperature to degrees Fahrenheit using the following equation: °F = (°C x 9/5) + 32 e) You should display the current temperature of the freezer in both °C and "F based on the time elapsed since the power failure. Use output formatting to round to 1 decimal point. f) Ice cream melts at about -10 °C. Write a condition that checks whether the current freezer temperature has reached -10 °C or not. Print the result of that condition check (either 1 or 0). That serves as a flag to the user; If the freezer has reached that temperature, the user should know that it's 'bye bye ice cream time'. g) Now, steak and meat get spoiled at about +4.5 °C. Write a condition that checks whether the current temperature is above 4.5 °C or not. Based on the result of this condition, print a message to the user and let them know to discard their meat and poultry products.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 20PE: When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making...
icon
Related questions
Question

in C

1- A hurricane hit Florida and the freezer is out of power!!! Write a program that estimates the
temperature in a freezer (in °C) given the elapsed time (hours) since the power failure happened.
Assume this temperature (T) is given by
4t2
T = -
– 20
t+2
where t is the time since a power failure. You can tell that the freezer temperature is normally
set to -20 °C.
a) Your program should prompt the user to enter how long it has been since the start of the freezer
power failure in whole hours and minutes. You should also sympathize with the user
b) You would need to convert the elapsed time into hours. For example, if the user entered 2 30
(2 hours 30 minutes), you would need to convert this to 2.5 hours.
c) Your program should then calculate the freezer temperature in Celsius degrees.
Note: the temperature of the freezer should increase as the power failure time lapse increases.
This is a good test to run your program at different times (t) and test for correctness of the
program.
d) Convert that calculated temperature to degrees Fahrenheit using the following equation:
°F = (°Cx 9/5) + 32
e) You should display the current temperature of the freezer in both °C and °F based on the time
elapsed since the power failure. Use output formatting to round to 1 decimal point.
f) Ice cream melts at about -10 °C. Write a condition that checks whether the current freezer
temperature has reached -10 °C or not. Print the result of that condition check (either 1 or 0).
That serves as a flag to the user; If the freezer has reached that temperature, the user should
know that it's 'bye bye ice cream time'.
g) Now, steak and meat get spoiled at about +4.5 °C. Write a condition that checks whether the
current temperature is above 4.5 °C or not. Based on the result of this condition, print a message
to the user and let them know to discard their meat and poultry products.
Transcribed Image Text:1- A hurricane hit Florida and the freezer is out of power!!! Write a program that estimates the temperature in a freezer (in °C) given the elapsed time (hours) since the power failure happened. Assume this temperature (T) is given by 4t2 T = - – 20 t+2 where t is the time since a power failure. You can tell that the freezer temperature is normally set to -20 °C. a) Your program should prompt the user to enter how long it has been since the start of the freezer power failure in whole hours and minutes. You should also sympathize with the user b) You would need to convert the elapsed time into hours. For example, if the user entered 2 30 (2 hours 30 minutes), you would need to convert this to 2.5 hours. c) Your program should then calculate the freezer temperature in Celsius degrees. Note: the temperature of the freezer should increase as the power failure time lapse increases. This is a good test to run your program at different times (t) and test for correctness of the program. d) Convert that calculated temperature to degrees Fahrenheit using the following equation: °F = (°Cx 9/5) + 32 e) You should display the current temperature of the freezer in both °C and °F based on the time elapsed since the power failure. Use output formatting to round to 1 decimal point. f) Ice cream melts at about -10 °C. Write a condition that checks whether the current freezer temperature has reached -10 °C or not. Print the result of that condition check (either 1 or 0). That serves as a flag to the user; If the freezer has reached that temperature, the user should know that it's 'bye bye ice cream time'. g) Now, steak and meat get spoiled at about +4.5 °C. Write a condition that checks whether the current temperature is above 4.5 °C or not. Based on the result of this condition, print a message to the user and let them know to discard their meat and poultry products.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning