Beruflich Dokumente
Kultur Dokumente
Identify the Problem Solving Process (input, process, output) and write and an algorithm
(flowchart or pseudocode) to input, calculate and display the following:
v) The marks obtained by a student (*Note: Assume that, the maximum mark that
can be obtained by a student in this quiz is 100.0%)
Analysis
Objective : Calculate the percentage of the questions answered correctly and incorrectly
by a student and the mark obtained by a student.
Output : Percentage of the question answered correctly, percentange of the question
answered incorrectly and the mark obtained by a student.
Input : Number of questions answered correctly and number of questions answered
Incorrectly.
Process : percentange of the question answered correctly = (number of questions answered correctly / 40) * 100
percentange of the question answered incorrectly = (number of questions answered incorrectly / 40) * 100
Design
BEGIN
DECLARE float percentCorrect, percentIncorrect,mark,
numberCorrect, numberIncorrect
READ numberCorrect, numberIncorrect
CALCULATE percentCorrect = (numberCorrect / 40) * 100
percentIncorrect = (numberIncorrect / 40) * 100
mark = (numberCorrect*5– numberIncorrect*2)/200*100
DISPLAY percentCorrect, percentIncorrect, mark
END
Flowchart
BEGIN
numberCorrect, numberIncorrect
END