Question
In python: Goals: Developing problem-solving skills, using 2-D lists and functions Problem: You have been asked to write a program that will aid a high
In python: Goals: Developing problem-solving skills, using 2-D lists and functions Problem: You have been asked to write a program that will aid a high school teacher with grades in the course. The students have a 6-digit numeric student number, and scores from 10 assignments. Your program should contain the following functions. One function should prompt the user to enter the 6-digit student number and the 10 assignment scores (the assignment grades should be entered as floating point numbers) for each student and store this information into a 2-d list. The information for each student should be contained in a separate row. The number of students in the class should be passed to this function as an input parameter. (Hint: review and modify the function Make2Dlist given in the file 2dlistexamplesdemo.py given in the module for week 9) One function should output the 2-D list in a formatted manner. This function should accept the 2-D list as an input parameter. Then using formatting techniques given on pages 68 through 73 of your textbook output the 2-D list using field width of 8 for the student numbers, and a field width 7 for each of the assignment grades. The assignment grades should be displayed with 2 decimal places. This function should not return anything. One function should accept the 2-D list and create a 1-D list containing the minimum value for each assignment and another 1-D list containing the maximum value for each assignment. Both these 1-D lists should be returned to the function call. Below is some code that is an example. You should modify it appropriately # using columns in 2D arrays twoDlist = [['Sam', 45, 76, 88, 99, 72], \ ["Ally",66,99,84, 82, 96], \ ['John', 58, 78, 90, 93, 70], \ ['Marie', 77, 73, 85, 88, 92], \ ['Bob', 81, 83, 85, 91, 88], \ ['Grace', 92, 95,87, 82, 90]] # find minimum of each numeric column mincolumns = [] for colnumb in range(1,6): minval = twoDlist[0][colnumb] Programming Project 4 2 CMPSC 101-Spring 2018 for ri in range(1,len(twoDlist)): if twoDlist[ri][colnumb] < minval: minval = twoDlist[ri][colnumb] mincolumns.append(minval) Finally, your program should contain a main function (yes call it main) that will prompt the user to enter the number of students, call the function to fill the 2-D list, call the function to display the 2-D list, call the function to determine the maximum and minimum scores for each assignment, and print the 1-D lists containing the maximum and minimum scores. The output should look similar to that given below. The maximum scores for each assignment are: [99.78, 97.0, 95.7, 99.9, 98.56, 90.2, 97.47, 98.14, 93.1, 98.5] The minimum scores for each assignment are: [67.8, 45.26, 55.12, 50.3, 46.2, 56.1, 47.98, 38.99, 49.62, 40.5] For 10 points of extra credit: Create another function that will accept the 2-D list and create a 1-D list containing the total score for each student and return the 1-D list containing the total to main. This function should be called from main and main should display the 1-D list of totals.
This is what I have so far
#import tkinter import tkinter class MyGUI: def __int__(self): #create main window self.main_window = tkinter.Tk() #create 2 frames, one for checkbuttons and one for regular button widgets self.top_frame = tkinter.Frame(self.main_window) self.bottom_frame = tkinter.Frame(self.main_window) #create 2 label widgets for top frame self.label1=tkinter.Label(self.top_frame, text='We Are') self.label2=tkinter.Label(self.top_frame, text='Penn State') #pack the labels that are in the top frame. #use the 'side=top' argument to stack them on top one another self.label1.pack(side='top') self.label2.pack(side='top') #create 2 label widegts for bottom frame self.label3=tkinter.Label(self.bottom_frame, text='We Are') self.label4=tkinter.Label(self.bottom_frame, text='Penn State') #Pack bottom frame labels so they are from left to right by #using the "side='left'" argument self.label3.pack(side='left') self.label4.pack(side='left') #pack the frames self.top_frame.pack() self.bottom_frame.pack() #enter the tkinter main loop tkinter.mainloop() #create an instance of the MyGUI class my_gui = MyGUI()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started