Mr. Jones, is a school teacher. He needs your helps in finding out whether a student passed or failed in the class. There are three subjects( English, Math, Science ) in which the test was given. Each of test has a max score of 100 points.
Program
Write a program to determine if a student passed or failed in the class based on the test score of the three subject tests.
Requirement
- The student must score a minimum of 60% in each of the subject tests.
- The student must score a minimum of 70% across all the three subject tests.
Input
- Name of the student.
- Student test scores in English, Maths, and Science tests.
Output
- Whether the student passed or failed the class based on the test scores.
- Overall % of the score across subjects and whether or not the student passed the class.
Test cases
No. | Student Name | English Score | Math Score | Science Score | Result | Explanation |
---|---|---|---|---|---|---|
1 | Tom Brady | 87 | 93 | 79 | % 86.33: Pass | |
2 | Jeff Duncan | 81 | 58 | 74 | % 71.00: Fail | Failed in Math < 60% |
3 | Lee Ma | 87 | 81 | 83 | % 83.66: Passed | |
4 | Lisa Meyers | 90 | 95 | 87 | % 90.66: Passed | |
5 | Raja Raman | 69 | 65 | 62 | % 65.33: Failed | Failed Overall < 70% |
6 | Deep Chandan | 81 | 92 | 85 | % 86.00: Passed |
Instructions
- Prompt the user to enter the input via the command prompt/shell or initialize it in variables.
- Write the logic to compute % of individual scores.
- Display the % scores received in all the tests along with Pass or Fail result.
Improvements
- Extends the program to allow Mr. Jones to enter the scores of multiple students once and display the result for all the students in a table.