Menu

[Solved] You are tasked with creating a program that will give statistics regarding the top_100 data

use python language write Code ,show screenshots will be great !

Task 2: Descriptive Statistics Menu (35 marks)
You are tasked with creating a program that will give statistics regarding the top_100 data. The program is to present a console menu that will allow users to give a column and statistic (e.g, “Duration” and “Average”) and receive the appropriate information in return.
Top 100 Information Centre
##########################
1. Minimum
2. Maximum
3. Average
4. Sum
H. Help
Q. quit
>>>
Your code should have the following functionality:
 The menu function is to repeatedly ask the user for input until the user enters the value to quit.
 The menu is the handle both uppercase and lowercase input.
 If a user enters an column that is out of range, then the menu will ask for a valid column.
 Only columns with numeric data can be given to Average and Sum, otherwise the menu will ask
for a valid column.
Note: You are NOT allowed to use any built‐in Python functions other than range(), len(),
input(), print(), upper(), int() and isinstance().

Function header: menu(top_100)
Input: top_100: the top_100 table read from the target file and processed in Assignment 1.
Output: Console output. Based on user commands
Below is example output for selecting the minimum of column 3, using the following sample data in
place of the processed top_100 list. The user first inputs an invalid column and is taken back to the main
menu so they may try again. The user then selects minimum again and gives a valid column index and is
then presented with the column minimum. The user then selects quit from the menu.
sample_data = [[4,3,2,9],
[9,8,7,6],
[2,4,6,1],
[1,3,5,7]]
menu(sample_data)

Examples:
Top 100 Information Centre
##########################
1. Minimum
2. Maximum
3. Average
4. Sum
H. Help
Q. quit
>>> 1
Minimum
Enter a column index:
>>> 10
Please enter a valid index.
Top 100 Information Centre
##########################
1. Minimum
2. Maximum
3. Average
4. Sum
H. Help
Q. quit
>>> 1
Minimum
Enter a column index:
>>> 3
1
Top 100 Information Centre
##########################
1. Minimum
2. Maximum
3. Average
4. Sum
H. Help
Q. quit
>>> H
To select an option, press enter the key corresponding to the menu option.
e.g 1 for Minimum.
Then enter a valid column index. Note, it is invalid to get the average and
sum of string data
File
Home
Insert
Page Layout
Formules
Data
Review
View
Developer
Heli
A1
X
THE SCOTTSTHE SCOTTS
G
H
A
B
С
D
E
F
27 Hot Girl BData
Formulas
view
Review
Develope
File
Home
Insert
Page Layout
X
f
A1
THE SCOTTSTHE SCOTTS
B
D
E
F
G
54 SlideH.E.R. FeaturinFile
Home
Insert
Page Layout
Formulas
Data
Review
VIEW
Developer
A1
THE SCOTTSTHE SCOTTS
B
D
F
G
H
74 TurksNAV Gunna & Travis刚建视图
關規
換
高级
EO PDF Word PDF
目单页 双页
GO
4 /6
SAR
-
向幻灯片全屏背曼富查找 [截图和对比
SCE
回首页
question
x +
Task 2: Descriptive Statistics Menu第第
转换
页面
高级
PDFsWord PDF
后单页
BE
ср
4
| /671
适合
幻灯片全解「引围查找的对比
question
X +
Your code should have the following functionality:视图
第辑
4916
页面
高级
PDF#Word PDF
单页|双页
COⓇOT 4 7671
RE
幻灯片全屏背景 區首批截图和对比图全文却注
OTT
question
x +
Below is example output for selectPDF Word PDF
會单项双页
GO 15/611
-适合宽容
回 幻灯片全展趋
question
X +
Examples:
Top 100 Information Centre
###
# # # # # #
1. Minimum
2. M在三天下
视图
注释
打印
PDF Word Z PDF
目单页|双页
CD005 /6页 适合宽度
向幻灯片全屏背
岛国就可
回首页
question
x +
Top 100 Information Centre
################注释
教炉
页面
高级
PDF Word
EPDF
目单
页面双页
CO
5/65
G适合安度
幻灯片全屏背虽我此
首页
question
X +
Top 100 Information Centre
#####
###
1. Minimum
2.页面
O PDF Word EPDF
目单軍政页
CO
16
/60
-适合宽度
OXH A E
首页
question
x +
Top 100 Information Centre
# ###
###
1. Minimum
2. Maximum
3
Top 100 Information Centre
##########################
1. Minimum
2. Maximum
3. Average
4. Sum
H. Help
Q. quit
>>> Q
Process finished with exit code 0

Expert Answer


Python code: # defining menu function def menu(data): # this while loop will run until the break statement executes because condition for while is passed as True while(True): # printing menu print(“\nTop 100 Information Centre”) print(

OR


Leave a Reply

Your email address will not be published. Required fields are marked *