Write a menu-driven program (repeating or non-repeating) that displays four choices to the user to calculate highest,lowest, total, and average of a list. Define the following four function that take a list as an argument as perform the desired operation: get_highest(nums) - displays the highest number in the list get_lowest(nums) - displays the lowest number in the list get_total(nums) - displays the total of the numbers in the list get_avg(nums) - displays the average of the numbers in the list You may use user-input to get numbers into the list or use your own list with fixed values. You do not need to return the value. Sample Run
-
Write a menu-driven program (repeating or non-repeating) that displays four choices to the user to calculate highest,lowest, total, and average of a list.
-
Define the following four function that take a list as an argument as perform the desired operation:
- get_highest(nums) - displays the highest number in the list
- get_lowest(nums) - displays the lowest number in the list
- get_total(nums) - displays the total of the numbers in the list
- get_avg(nums) - displays the average of the numbers in the list
You may use user-input to get numbers into the list or use your own list with fixed values. You do not need to return the value.
Sample Run
**** Menu ****
1. Display the highest number in the list
2. Display the lowest number in the list
3. Display the list total 4. Display the list average
5. Quit
Enter your choice (1-5): 1
The highest number in the list is 56
**** Menu ****
1. Display the highest number in the list
2. Display the lowest number in the list
3. Display the list total
4. Display the list average
5. Quit
Enter your choice (1-5): 5
Goodbye! Until next time
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images