Question
Hi, I am seriously stuck with a Phython program. I cannot seem to work out the loops needed to get this program to execute correctly.
Hi,
I am seriously stuck with a Phython program. I cannot seem to work out the loops needed to get this program to execute correctly. Can anyone help?
Thank you.
Students in a course need to do lab assignments and take tests. Course grade is calculated from these scores. Write a program to calculate course grade. You must write and use the following two functions.
1) A main function: First, ask the user how many labs there are. Use a loop to enter lab scores and store them in a list. Display the list of lab scores. Second, ask the user how many tests there are. Use a loop to enter test scores and store them in another list. Display the list of test scores. Third, tell the user that the default weights for labs and tests are 50 and 50. If the user wants to use the default weights, enter D. Otherwise, enter C. If the user chooses to use default weights, call the grade_calculator function and pass the list of lab scores and the list of test scores as two arguments. Do not pass any arguments about weights. If the user chooses not to use default weights, ask the user to enter the weights for labs and tests, respectively. Then call the grade_calculator function and pass the list of lab scores, the list of test scores, lab weight and test weight as four arguments. You are free to use positional or keyword arguments.
2) A grade_calculator function: This function has four parameters: lab score list, test score list, lab weight and test weight. Use default parameter for lab weight and test weight. Default values are 50 and 50. First, calculate and display average lab score. Second, calculate and display average test score. Third, use average lab score, average test score, lab weight and test weight to calculate course grade. Display course grade.
The following is an example. Default weights are used.
How many labs? 3
Enter a lab score: 87
Enter a lab score: 93
Enter a lab score: 90
Lab scores: [87.0, 93.0, 90.0]
How many tests? 2
Enter a test score: 85
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