This assignment is about temperatures and requires the main function and a custom value-returning function. The value-returning function takes a list of random Fahrenheit temperatures as its only argument and returns a smaller list of temperatures that are below freezing.  The main function needs these steps in this sequence: create an empty list that will the hold Fahrenheit temperatures. use a loop to add 25 random integertemperatures to the list. All temperatures should be between 5 and 75, inclusive. use another loop to display all 25 temperatures on one line separated by spaces. report the highest and lowest temperatures in the list. 32 might be in the list. Report the index of the first instance of 32 or report that it didn't make the list. using slice syntax: print the first 10 temperatures in the list. print the middle 5 temperatures in the list. print the final 10 temperatures in the list. execute the custom value-returning function with the complete list as its only argument. report the number of elements in the list that was returned. sort the list of below freezing temperatures in high to low order use a loop to display all below freezing temperatures on one line separated by spaces.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question

Using Python

This assignment is about temperatures and requires the main function and a custom value-returning function. The value-returning function takes a list of random Fahrenheit temperatures as its only argument and returns a smaller list of temperatures that are below freezing.  The main function needs these steps in this sequence:

  • create an empty list that will the hold Fahrenheit temperatures.
  • use a loop to add 25 random integertemperatures to the list. All temperatures should be between 5 and 75, inclusive.
  • use another loop to display all 25 temperatures on one line separated by spaces.
  • report the highest and lowest temperatures in the list.
  • 32 might be in the list. Report the index of the first instance of 32 or report that it didn't make the list.
  • using slice syntax:
    • print the first 10 temperatures in the list.
    • print the middle 5 temperatures in the list.
    • print the final 10 temperatures in the list.
  • execute the custom value-returning function with the complete list as its only argument.
  • report the number of elements in the list that was returned.
  • sort the list of below freezing temperatures in high to low order
  • use a loop to display all below freezing temperatures on one line separated by spaces.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Program on Numbers
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT