Professional Documents
Culture Documents
ANSWERS;
(ii)
Qn 2; A program was designed to receive scores of one student in ten
subjects; the program should display the scores, calculate and display
the sum and average score of one student from this scenario.
(i) Write an algorithm in pseudocode or pseudicode or flow chart
to design the program.
(ii) Use a C++ program to implement it.
ANSWER;
(i) Initialize sum to 0.
Initialize average to 0.
Initialize count to 0.
Repeat the following steps
a. Read the score for the subjects.
b. Add the increment score to sum.
c. Increment count by 1.
Calculate the average by dividing sum by count.
Display the sum and average.
(ii)
Qn 3; Write a C++ program for a function calculator.
ANSWER:
Qn 4; Write a C++ program for a function calculator which passes
parameters.
Qn 5; Write a C++ program regarding with file-handling to display five
lines.