This program requires the main function and a custom value-returning function. In the main function, code these steps in this sequence: use a list comprehension to generate 50 random integers all from -40 to 40, inclusive. These represent Celsius temperatures. use an f_string to report the lowest and highest Celsius temperature in the list. determine if 0C is in the list. If it is report the index where it first occurs. If it isn't in the list, report that, too. use a random module method to create a sublist of 10 unique Celsius temperatures. sort this sublist in ascending order. pass the Celsius sublist as the sole argument to the custom value-returning function. In the custom function: use either a loop or a list comprehension to create a list of 10 Fahrenheit temperatures equivalent to the Celsius temperatures. A bonus of 3 points will be awarded if a list comprehension is employed. return the Fahrenheit list to main. Back in main: use a for loop and the range function to print a table showing the equivalent Celsius and Fahrenheit temperatures in columns with widths that you choose. include column headings and display the averages as shown below.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 8PE
icon
Related questions
Question
This program requires the main function and a custom value-returning function. In the main function, code these steps in this sequence: use a list comprehension to generate 50 random integers all from -40 to 40, inclusive. These represent Celsius temperatures. use an f_string to report the lowest and highest Celsius temperature in the list. determine if 0C is in the list. If it is report the index where it first occurs. If it isn't in the list, report that, too. use a random module method to create a sublist of 10 unique Celsius temperatures. sort this sublist in ascending order. pass the Celsius sublist as the sole argument to the custom value-returning function. In the custom function: use either a loop or a list comprehension to create a list of 10 Fahrenheit temperatures equivalent to the Celsius temperatures. A bonus of 3 points will be awarded if a list comprehension is employed. return the Fahrenheit list to main. Back in main: use a for loop and the range function to print a table showing the equivalent Celsius and Fahrenheit temperatures in columns with widths that you choose. include column headings and display the averages as shown below.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Linked List Representation
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