Question
QUESTION 2: (40) Suppose we want to compile a student academic report for a high school learner in grade 12 (matric). A matric learner is
QUESTION 2: (40)
Suppose we want to compile a student academic report for a high school learner in grade 12 (matric).
A matric learner is enrolled for 6 study units (subjects), namely: English, Mathematics, Life Orientation, History, Computer literacy, Geography. The learner has to pass at least four subjects, including English, to complete grade 12. The subject pass mark is 50%.
Write a program that prompts the learner to key in their marks for each subject. The program should include the following functions:
A function studentDetails, that prompts the learner to key in their personal details
name,surname, and schoolName. (3)
A function getMarks, that prompts the learner to key in a mark for each of the six subjects, and validate the marks. Do not accept marks lower than 0 or higher than 100. (3)
A function calcAverageYearMark, to calculate and display the average of the 6 Subjects. This function should be called just once by main, and should be passed the 6 Subject marks. (6)
A function minMax, to find and return the lowest and the highest of the 6 subject marks
passed to it as the subject with the lowest mark; (6)
A function passOrFail, to determine whether the student has passed or failed grade 12. (9)
A function awardDistinction to determine which of the subjects have received distinctions. A subject receives a distinction if the mark is 75% and above. Also a student has
passed with distinction if the average mark is 75% and above. (3)
A function codeSymbol, to convert each mark to a symbol (A, B, C, D, E, F) and a code
(7,6,5,4,3,2,1). The symbol and code should be printed next to the mark in the student report.
The same should be calculated and displayed for the average mark. (6)
A function to Display the student report. (4)
Use the table below to determine the student symbol and code attained.
CODE | SYMBOL | MARK |
7 | A | 80 - 100% |
6 | B | 70 - 79% |
5 | C | 60 - 69% |
4 | D | 50 - 59% |
3 | E | 40 - 49% |
2 | F | 30 - 39% |
1 | FF | 0 - 29% |
Execute your program using the following data:
| John Africa (Kings College) | Mary Smith (Green valley High) | Thuli Booi (Gauteng girls ) |
English | 50% | 48% | 82% |
Mathematics | 76% | 80% | 66% |
Life Orientation | 40% | 75% | 62% |
History | 62% | 70% | 76% |
Computer literacy | 56% | 86% | 86% |
Art | 38% | 72% | 78% |
You have to submit the program code and output.
Sample run:
Please key in your name:
John Africa
Please key in the name of your school:
Kings College
Key in your mark for English:
50
Key in your mark for Mathematics:
76
Key in your mark for Life Orientation:
40
Key in your mark for History:
62
Key in your mark for Computer literacy:
56
Key in your mark for Art:
38
***********************************************
**** STUDENT ACADEMIC RECORD
This program inputs the learner marks of matric level subjects and prints the student final report.
***********************************************
****
Name: John Africa School: Kings College
Subject Mark | Symbol Code |
English 50% | D 4 |
Mathematics 76% | B 6 |
Life Orientation 40% | E 3 |
History 62% | C 5 |
Computer literacy 56% | D 4 |
Art 38% | F 2 |
Average Year Mark: 53.67 with Symbol D and code 4
Outcome: Passed
The highest mark was 76%
The lowest mark was 38%
***************************************************
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