Question: Goals Project 2 Practice using Booleans and conditional structures Practice writing functions Practice calling functions from another function Notice: For each project, you can










Goals Project 2 Practice using Booleans and conditional structures Practice writing functions Practice calling functions from another function Notice: For each project, you can submit at most ten times. In case of issues, you should approach TAs during office hours instead of wasting your submission chances. Description The university is developing a course management system that automatically calculates final final grades based on the grading criteria of each course, including attendance, homework, midterm, final and late submission. If the calculated final grade is above a certain threshold, the student will pass the course, otherwise, they will fail it. The course management system team hired you to implement the decision process for any given course, which means you are required to write a Python program to read the score information from students and calculate the final grades to decide whether the student will pass the course. 1. Task 0: program set up and add brief description comments in the header area. 2. Task 1: implement the following functions that calculate points for each factor. calcLabScore calcQuizScore calcPresentationScore calcFinal ProjectScore calcLate Submission Score 3. Task 2: implement the make Decision function that does the following: Calculates the point for each factor by calling the corresponding functions. Uses the factor points and the weights to calculate the final grade and returns the grade point of the student. The weights of each factor are listed as follows: 40% 20% Presentation: 10% Final Project: 30% The lab score should multiply the factor points for late submission to get the final lab score. Lab: Quiz: 4. Task 3 implement the main function that does the following: Reads from the user the number of students n to process. Loops for n times, in each iteration, it calls make Decision, and prints the decision returned by the function. Task 0: Open a new, blank Python program window. Save the files as project02.py At the top of the file, enter the following: # CS 177 project02.py # {insert your name here} # Summarize the project in a few sentences Task 1: Use the following table to implement calcLabScore, calcQuizScore, calcPresentationScore, calcFi nal Project Score, calcLate SubmissionScore 1 2 3 4 5 nalprojec core, calclates Factor Lab Score Quiz Score Presentation Score Final Project Score Late Submission Score Value Ranges 0-200 0 sionscore 1 - 100 101-200 201-300 301 - 400 0-25 26- 75 76-100 0-50 0-2 3-4 5 or more Points Value * 0.5 0 25 50 75 100 0 50 100 Value * 2 100% 75% 50% Details: def calcLabScore (LabValue): The function returns Points for lab. def calcQuizScore (QuizValue): The function returns Points for quiz. def calcPresentationScore (PresentationValue): The function returns Points for presentation. def calcFinal Project Score (Final ProjectValue) : The function returns Points for the final project. def calcLateSubmissionScore (LateValue): The function returns Points for late submission. Task 2: implement the make Decision function def makeDecision (lab, quiz, pre, final, latesub) : You may think about the make Decision function as the grade calculator of this course. Given the five factors (lab, quiz, pre, final and late submission), it computes the final grade and returns two values: 1. the calculated final grade the final grade point as a string type A, B, C or D. Details: def calcLabScore (LabValue): The function returns Points for lab. def calcQuizScore (QuizValue): The function returns Points for quiz. def calcPresentationScore (PresentationValue): The function returns Points for presentation. def calcFinal Project Score (Final ProjectValue) : The function returns Points for the final project. def calcLateSubmissionScore (LateValue): The function returns Points for late submission. Task 2: implement the make Decision function def makeDecision (lab, quiz, pre, final, latesub): You may think about the make Decision function as the grade calculator of this course. Given the five factors (lab, quiz, pre, final and late submission), it computes the final grade and returns two values: 1. the calculated final grade the final grade point as a string type A, B, C or D. Useful Tip: when returning multiple values from a function, separate the values by a comma, return vall, val2, val3, A common mistake is returning a list: return [vall, val2, val3, ...] which in turn is a single returned value of a list type The score obtained for late submissions will be used to scale the points obtained for the labs. This can be done by multiplying the late submission score with the lab submission score to get the final lab score. The weights of each factor are listed as follows: Lab: Quiz: 40% 20% Presentation: 10% Final Project: 30% The corresponding grade points for scores are listed below: A: 90 score 100 B: 80 score < 90 C: 60 score < 80 D: any score below 60 Task 3 implementing the main function The main function serves as an entry to the program. The user input is typically read inside the main and the related functions are called to carry out the intended operation. Here is a suggested outline to implement main: # Read the number of students (n) from the user # Loop n times # For each iteration #Print the student number header # Read the factors from the user # Call make Decision to get the course final grade and # Final grade point # Print the grade point Comments: your program should have a header for each function and comments that explain the solution steps. Calling the main function Please use the following syntax to call the main function. # the main function def main (): #main implementation # # calling the main function if name - "I main "1 main () The reason is that this syntax allows treating your submitted python file as a library that can be easily imported from Python's command line. Sample Output Enter the number of students: 2 Student #1 Enter lab score: 180 Enter quiz score: 360 Enter presentation score: 80 Enter final project score: 45 Enter late submission score: 1 Decision (93.0, 'A') Student #2 Enter lab score: 130 Enter quiz score: 270 Enter presentation score: 80 Enter final project score: 40 Enter late submission score: 4 Decision: (68.5, 'C')
Step by Step Solution
3.54 Rating (144 Votes )
There are 3 Steps involved in it
Calculates And Returns Attendance Score Factor d... View full answer
Get step-by-step solutions from verified subject matter experts
