Write a python program that calculates the average percent scores of your courses and your overall term percent. Each course has a variable number of tests used to determine the course average percent. A custom function named grade_pct and main() must be used as below. The grade_pct function must be stored in a separate module file named as you choose. See Sample Output. In the main() function: import your module. prompt the user to enter the number of courses taken in the term. use a loop to: enter each course name. call the grade_pct function. print the average for the course accurate to one decimal place. print the overall term average accurate to one decimal place by averaging the course scores. In the grade_pct function: prompt the user for the number of tests in the course. prompt the user to enter the scores for the tests. return the average for the course. Sample Output (user inputs shown in boldface) Enter how many courses did you study? 2 Enter course name Algebra Getting data for Algebra course How many tests in this course? 2 Enter test score 80 Enter test score 90 Average for Algebra is 85.0% Enter course name Python Getting data for Python course How many tests in this course? 3 Enter test score 80 Enter test score 90 Enter test score 100 Average for Python is 90.0% Your average for the term is 87.5%
Write a python program that calculates the average percent scores of your courses and your overall term percent. Each course has a variable number of tests used to determine the course average percent. A custom function named grade_pct and main() must be used as below. The grade_pct function must be stored in a separate module file named as you choose. See Sample Output.
In the main() function:
- import your module.
- prompt the user to enter the number of courses taken in the term.
- use a loop to:
- enter each course name.
- call the grade_pct function.
- print the average for the course accurate to one decimal place.
- print the overall term average accurate to one decimal place by averaging the course scores.
In the grade_pct function:
- prompt the user for the number of tests in the course.
- prompt the user to enter the scores for the tests.
- return the average for the course.
Sample Output (user inputs shown in boldface)
Enter how many courses did you study? 2
Enter course name Algebra
Getting data for Algebra course
How many tests in this course? 2
Enter test score 80
Enter test score 90
Average for Algebra is 85.0%
Enter course name Python
Getting data for Python course
How many tests in this course? 3
Enter test score 80
Enter test score 90
Enter test score 100
Average for Python is 90.0%
Your average for the term is 87.5%
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images