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, 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 TASK 1: Random List Input list size: 99 Input max int: 10 Generated list [9, 10, 2, 10, 1, 4, 3, 10, 6, 1, 9, 3, 6, 6, 1, 10, 4, 7, 2, е, 7, 5, е, 5, 5, 7, 3, 7, е, 5, 4, 4, 6, е, 6, 10, 2, @, 1, 2, 3, 4, 10, 10, 4, 2, 4, е, 7, 5, 7, 1, 1, 3, 6, 3, 4, 6, 2, 9, 9, 10, 5, 1, 2, 5, 7, 5, 8, 6, 1, 10, е, з, 6, 1, 8, 3, 2, 8, 7, е, 1, 4, 9, 8, 9, 7, 5, @, е, 1, 4, 1, 4, е, 9, 6, е] Average value - 4.5354

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
100%

python code easy way pls thank you

Two functions you need to implement:
generateRandomlList( 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, 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 1list
[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
---- TASK 1: Random List
Input list size: 99
Input max int: 10
Generated list
[9, 10, 2, 1е, 1, 4, 3, 1е, 6, 1, 9, 3, 6, 6, 1, 10, 4, 7, 2, @, 7, 5, 0, 5, 5,
7, 3, 7, е, 5, 4, 4, 6, е, 6, 10, 2, @, 1, 2, 3, 4, 10, 10, 4, 2, 4, @, 7, 5, 7,
1, 1, 3, 6, 3, 4, 6, 2, 9, 9, 10, 5, 1, 2, 5, 7, 5, 8, 6, 1, 10, 0, 3, 6, 1, 8,
3, 2, 8, 7, е, 1, 4, 9, 8, 9, 7, 5, в, е, 1, 4, 1, 4, @, 9, 6, 0]
Average value = 4.5354
Transcribed Image Text:Two functions you need to implement: generateRandomlList( 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, 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 1list [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 ---- TASK 1: Random List Input list size: 99 Input max int: 10 Generated list [9, 10, 2, 1е, 1, 4, 3, 1е, 6, 1, 9, 3, 6, 6, 1, 10, 4, 7, 2, @, 7, 5, 0, 5, 5, 7, 3, 7, е, 5, 4, 4, 6, е, 6, 10, 2, @, 1, 2, 3, 4, 10, 10, 4, 2, 4, @, 7, 5, 7, 1, 1, 3, 6, 3, 4, 6, 2, 9, 9, 10, 5, 1, 2, 5, 7, 5, 8, 6, 1, 10, 0, 3, 6, 1, 8, 3, 2, 8, 7, е, 1, 4, 9, 8, 9, 7, 5, в, е, 1, 4, 1, 4, @, 9, 6, 0] Average value = 4.5354
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

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