This should be in Python, Thank you!! 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 functionality1. Ask the user to input the size...


This should be in Python, Thank you!!


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

Extracted 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 format="" your="" output="" the="" same="" task="" 1:="" random="" list="" input="" list="" size:="" 1="" input="" max="" int:="" 5="" generated="" list="" [5]="" average="" value="">
Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here