2. Test Scores File: test_scores.py Write pseudocode for the main() part of a program that asks the user to enter 4 test scores between 0 and 100, then displays a JCU grade for each score and also the average test score. When you have written the pseudocode for main, implement your solution in Python code and test it with a range of meaningful data. Remember that we've done the JCU grades question before, so copy your function from that practical code file. Sample Output Score: 3 Score: 50.5 Score: 66 Score: 100 Score 3.0, which is N Score 50.5, which is P Score 66.0, which is C Score 100.0, which is HD The average score was 54.875 Enhancements When you have that working... We asked for 4 scores. Have a look at your code... did you use 4 as a numeric literal or a constant? Change 4 to 3... Did you have to change the program in more than one place? If so, then you've missed one of the things we've taught... As a strong guideline: if you need to use the same literal more than once, you should turn it into a constant . Do this now if you haven't already. Add error-checking to the test score inputs to ensure they are between 0 and 100. You should be getting good at this by now :) but do notice that it's easy to do this kind of "iterative development" where you don't try and get it working all at once. Error-checking is a common feature to add after you have the core functionality working. Add a feature that shows the user what the trend is. If the last score in the list is higher than the average, then the trend is "positive", otherwise it's "not positive". Upgrade your print outputs so the output is formatted nicely like: Score 1: 3 Score 2: 50.5 Score 3: 66 Score 4: 100 Score 1 was 3.0, which is N Score 2 was 50.5, which is P Score 3 was 66.0, which is C Score 4 was 100.0, which is HD The average score was 54.875 The trend is positive
2. Test Scores
File: test_scores.py
Write pseudocode for the main() part of a program that asks the user to enter 4 test scores between 0 and 100, then displays a JCU grade for each score and also the average test score.
When you have written the pseudocode for main, implement your solution in Python code and test it with a range of meaningful data.
Remember that we've done the JCU grades question before, so copy your function from that practical code file.
Sample Output
Enhancements
When you have that working...
-
We asked for 4 scores. Have a look at your code... did you use 4 as a numeric literal or a constant?
Change 4 to 3... Did you have to change the program in more than one place?
If so, then you've missed one of the things we've taught...
As a strong guideline: if you need to use the same literal more than once, you should turn it into a constant .
Do this now if you haven't already. -
Add error-checking to the test score inputs to ensure they are between 0 and 100.
You should be getting good at this by now :) but do notice that it's easy to do this kind of "iterative development" where you don't try and get it working all at once. Error-checking is a common feature to add after you have the core functionality working. -
Add a feature that shows the user what the trend is.
If the last score in the list is higher than the average, then the trend is "positive", otherwise it's "not positive". -
Upgrade your print outputs so the output is formatted nicely like:
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images