MIS 315 – Fall 2022. Programming Assignment #2.
Objectives: Functions, Lists, lists of lists
QUESTION 1.Build a list of lists called stud Grades, using the data in file DATA_PROJ2.txt, shown in canvas files.
Each row contains the data for one student, and it will be used to compute the final letter grade of the student. Data of one row are the following
Column 0: unique student id
Col 1: “L” for the usual letter grading (A, B, …) , ”Cr” for Credit/noCr
Col 2: major – col 3: transfer student? -Col 4 -year
Col 5: gpa – col6 project 1 grade –Col 7 project 2 grade
Col 8: exam 1 grade – col 9: eTo build the table stud Grades in the Python program, copy and paste one row at a time from the file DATA_PROJ2.txt into the table stud Grades . Insert commas and “[“ and “]” where needed to make stud Grades a correct list of lists .
This table MUST be in main()
Print table stud Grades, showing one row per line
QUESTION 2.Compute the average gpa. Compute how many students have their gpa greater than the average gpa.
PRINT both results from main()
You must use a function for this question, besides main(). The table stud Grades must be a parameter of this function . Both results must be returned to the calling program using a “return” statement and printed from main()
QUESTION 3. For each student, compute the final project grade based on the combination of grades for project 1 (col 6) and grade for project 2 (col 7) as follows
First step
newProj1grade = project1Weight*project1_grade
newProj2grade= project2Weight*project2_grade
Use : project1Weight = 2 project2Weight = 1.5 .Those are “global constants”
All rows have the same project1Weight. All rows have the same project2Weight
REMARK. I am not always respecting Python syntax and consistent in the use of variable names in this text. The names I use are descriptive of the data they hold, but you need to choose the variable names for your program
.Second step calculate:
projgrade = newProj1grade+ newProj2grade
Third, insert the value of projgrade at column 8 of stud Grades for each row.
You must use a new function for this question
Print the following from main(): rows for student id 1111, 4555, 9500 with columns 0, 6, 7, 8, 9, 10
QUESTION 4. For each student, compute the final exam grade based on the combination of grades for exam1 (col 9) and grade for exam 2 (col 10) as follows.
First, compute firstKmod as follows:
Kmod = 1.2 for juniors who are not transfer students (col 3), Is 1.4 for juniors who are transfer from CC, is 1.5 for other juniors, is 2 for sophomores or seniors and grading type “L” (col 1), 2.5 for sophomores with grading type Cr, 1 for all other students
Then
newExam1grade = Exam1Weight*Exam1_grade
newExam2 grade= Exam2Weight*Kmod*Exam2_grade
All students have the same Exam1Weight = 3
All students have the same exam2Weight=5
For each student, compute
examgrade = new Exam1grade+ new Exam2grade; append
Print the following from main(): rows for student id 1111, 4555, 9500 with columns 0, 9, 10, 11
You m ust use a new function for this question.
Last Completed Projects
topic title | academic level | Writer | delivered |
---|