readings from a fridge, as described in Question 9. Write a program that prints the hour at which the temperature first reached its maximum value. Assume position 0 is the reading at midnight (which will be printed as 0 : 00), position 1 is the reading at 1am (1 : 00), etc. The list has at least 1 and at most 23 readings. Write the corresponding code beneath each comment. Use variable names appropriate to the problem at hand instead of the generic names used by the pattern.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question

Consider again a list of hourly temperature readings from a fridge, as described in Question 9. Write a program that prints the hour at which the temperature first reached its maximum value. Assume position 0 is the reading at midnight (which will be printed as 0 : 00), position 1 is the reading at 1am (1 : 00), etc. The list has at least 1 and at most 23 readings.

Write the corresponding code beneath each comment. Use variable names appropriate to the problem at hand instead of the generic names used by the pattern. The first step has been done for you. Note that the output is expected to have a space before and after the colon.

For example:

Input Result
[4.7]
0 : 00
[4.7, 3]
0 : 00
[4.7, 3, 4.8]
2 : 00

start of code follows

 

Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Lists
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT