Task 1- Random list of integers and computing the average Two functions you need to implement: generateRandomList( list size, maximum integer value) [returns a list] - This function should generate a list of random integers (between 0 and some maximum size). - The function has two parameters: (1) the size of the list and the maximum integer values. - The function should return the random list For example: if size = 3 and max int = 5 a valid random list would be [5, e, 1] computeAverage( a list ) [returns a float] This function takes in a list of integers. It should return the average value of all the elements in the list>

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

This should be in Python, Thank you!!

Task 1- Random list of integers and computing the average
Two functions you need to implement:
generateRandomList( list size,
- This function should generate a list of random integers (between 0 and some maximum size).
maximum integer value) [returns a list]
- The function has two parameters: (1) the size of the list and the maximum integer values.
- The function should return the random list
For example: if size = 3 and max int = 5 a valid random list would be [5, 0, 1]
computeAverage( a list ) [returns a float]
This function takes in a list of integers. It should return the average value of all the elements in the list>
You may assume the list has one or more items in it.
For example, the list [5, 0, 1] would return 5.3333..
Task 1 functionality
1. Ask the user to input the size of the list (assume the input is a number 1 or greater)
2. Ask the user to input the maximum size of the integer allowed in the list
3. Generate a random list using the function above
4. Compute the average of the random list using the function above
5. Print the generated list
6. Print out the average with four decimal places (i.e., XX.XXXX) [see below]
Examples of task 1 (user input in red)
TASK 1: Random List
Input list size: 10
Input max int: 100
Generated list
[13, е, 10, 84, 57, 8, 99, зе, зе, 15]
Average value = 34.6000
<- format your output the same
TASK 1: Random List
Input list size: 1
Input max int: 5
Generated list
[5]
Average value = 5.0000
Transcribed Image Text:Task 1- Random list of integers and computing the average Two functions you need to implement: generateRandomList( list size, - This function should generate a list of random integers (between 0 and some maximum size). maximum integer value) [returns a list] - The function has two parameters: (1) the size of the list and the maximum integer values. - The function should return the random list For example: if size = 3 and max int = 5 a valid random list would be [5, 0, 1] computeAverage( a list ) [returns a float] This function takes in a list of integers. It should return the average value of all the elements in the list> You may assume the list has one or more items in it. For example, the list [5, 0, 1] would return 5.3333.. Task 1 functionality 1. Ask the user to input the size of the list (assume the input is a number 1 or greater) 2. Ask the user to input the maximum size of the integer allowed in the list 3. Generate a random list using the function above 4. Compute the average of the random list using the function above 5. Print the generated list 6. Print out the average with four decimal places (i.e., XX.XXXX) [see below] Examples of task 1 (user input in red) TASK 1: Random List Input list size: 10 Input max int: 100 Generated list [13, е, 10, 84, 57, 8, 99, зе, зе, 15] Average value = 34.6000 <- format your output the same TASK 1: Random List Input list size: 1 Input max int: 5 Generated list [5] Average value = 5.0000
Expert Solution
steps

Step by step

Solved in 3 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.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education