Question: Problem 1 Beverages such as coffee, hot chocolate, or tea are often served at temperatures between 1 6 0 and 1 8 5 degrees Fahrenheit.

Problem 1
Beverages such as coffee, hot chocolate, or tea are often served at temperatures between 160 and 185 degrees
Fahrenheit. However, beverages consumed at such high temperatures can cause scalding burns. According to a recent
research study, the optimal temperature to avoid burns when consuming a warm beverage is approximately 136 degrees
Fahrenheit.
To obtain a simple solution, let's assume that for EACH ice cube added to a hot beverage, the temperature of the beverage
will be reduced by 5% of the current beverage temperature.
Write a function to complete the following tasks:
Use the appropriate input mechanism to obtain the initial temperature (between 160 and 185 degrees Fahrenheit)
of the hot beverage.
Add an ice cube one at a time (assume the simple temperature reduction described above) until the temperature
of the beverage is optimal (i.e., below 136 degrees Fahrenheit). HINT: What type of loop should you use to
accomplish this task?
Count the number of ice cubes necessary to achieve an optimal temperature.
Use the appropriate output mechanism to output the number of ice cubes needed and the final temperature.
Solution (for an initial temperature of 160 degrees Fahrenheit):
numcubes =4
temp =130.3210
Problem 1 Beverages such as coffee, hot

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!