Goals Project 2 Practice using Booleans and conditional structures Practice writing functions Practice calling functions from...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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') 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')
Expert Answer:
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Consider the following reaction at 800. K: N2(g) + 3F2(g) 2NF3(g) An equilibrium mixture contains the following partial pressures: PN2 = 0.021 atm, PF2 = 0.063 atm, and PNF3 = 0.48 atm. Calculate Go...
-
Why might the number 112 be assigned to Accounts Receivable and the number 1120708 to Carl Erickson, a customer?
-
a. An autoregressive model is given by: Yt = 20.58 + 0.046 yt-1 + 0.01Yt-2 where Y, = sales of a product. Explain the meaning of the terms in this autoregressive model. b. Write the expressions for...
-
What is object-oriented modeling? How does it differ from Unified Modeling Language (UML)?
-
Welcome Inns is a chain of motels serving business travelers in Arizona and southern Nevada. The chain has grown from one motel in 2007 to five motels. In 2010, the owner of the company decided to...
-
2-1. GASB Concepts Statement No. 3 discusses various methods of communicating financial accounting information to users. One method is using required supple- mentary information (RSI). What is RSI,...
-
If a person has lost his memory in an accident, which of the following part of the brain have gotten injured (a) Diencephalon (b) Medulla oblongata (c) Cerebellum (d) Cerebrum
-
A point mutation occurs in the middle of the coding sequence for a gene. Which types of mutationsilent, missense, nonsense, and frameshiftwould be most likely to disrupt protein function and which...
-
What are the two main functions of tumor-suppressor genes?
-
Define the following terms: genomics, functional genomics, and proteomics.
-
Which step(s) in the double-strand break model for recombination would be inhibited if each of the following proteins was missing? A. RecBCD B. RecA C. RecG D. RuvABC
-
An individual has the genotype Aa Bb Cc and makes an abnormal gamete with the genotype AaBc. Does this gamete violate the law of independent assortment or the law of segregation (or both)? Explain...
-
SAD paid $240,000 in net wages to its employees in August. Employees' tax was $24,000, employees' national insurance was $12,000 and employer's national insurance was $14,000. Employees had...
-
In Exercises, find the equation of the tangent line at the given point on each curve. 2y 2 - x = 4; (16, 2)
-
Below, we will investigate the profit maximizing choice in the two steps that first involve a strict focus on the cost side. A: Consider again (as in the previous exercise) a production process that...
-
People are often amazed at the quality of produce that is available in markets far away from where that produce is grown-and that it is often the case that the average quality of produce is higher...
-
Consider your tastes for right and left shoes. A: Suppose you, like most of us, are the kind of person that is rather picky about having the shoes you wear on your right foot be designed for right...
-
You have two regions, A and B, of differently doped silicon, with the regions joined together to make a continuous silicon crystal. When the positive terminal of a battery is connected to region...
-
In Figure P32.33, what combinations of positive bias (input signals) A, B, C, D allow the light bulb to light up? Data from Figure P32.33 A B OR JOR AND D
-
Suppose a transistor consists of a very narrow \(p\)-type material sandwiched between two very wide regions of \(n\)-type material. (a) Is the charge on the \(p\)-type region positive or negative,...
Study smarter with the SolutionInn App