Sie sind auf Seite 1von 3

QUESTION 2

A quiz consists of 40 multiple-choice questions is evaluated based on the marking scheme


shown in the following table

MARKING SCHEME OF A QUIZ


Each question answered correctly Award 5 marks
Each question answered incorrectly Deduct 2 marks

Identify the Problem Solving Process (input, process, output) and write and an algorithm
(flowchart or pseudocode) to input, calculate and display the following:

i) A number of questions answered correctly

ii) A number of questions answered incorrectly

iii) The percentage of the questions answered correctly by a student

iv) The percentage of the questions answered incorrectly by a student

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

mark obtained by a student = (number of questions answered correctly * 5 - number of questions

answered incorrectly * 2) / 200 * 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

DECLARE float percentCorrect, percentIncorrect, mark ,

numberCorrect, numberIncorrect

READ numberCorrect, numberIncorrect

PROCESS percentCorrect = (numberCorrect / 40) * 100

percentIncorrect = (numberIncorrect / 40) * 100

mark = ( numberCorrect * 5 – numberIncorrect *2) / 200 * 100

DISPLAY percentCorrect, percentIncorrect, mark

END

Das könnte Ihnen auch gefallen