Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

PROGRAM DESIGN EXAMPLE 2:

Design a program that will check if a student has passed or failed an assessment. The pass mark for a
course is 50%. Each student is to provide their name, sin and percentage they received in the
assessment. Inform the student of their status whether passed or failed.
You are required to:
1. Write a table of steps (Operations) that will be used in the program design. The table
should include the name of the program, inputs, Decisions (if any), Processes (if any),
and Outputs
2. Write the Pseudo Code for your program
3. Draw a Flow chart that will show how the above program operations will run.

ANSWER
1. Table of Steps (Operations)
From the given information in the question, the following operations will be
necessary for us to design the program

Program Name NHIMA Contributions Calculator


- Name
Inputs - SIN
- Percentage Received
Outputs - Status
- If the percentage received is greater than or equal to 50%, set
Decisions the status as Passed
- Else set the status as failed
- Set status as passed
Processes
- Set Status as failed
Note: Example 1 required you to display all the inputs in output. This question, however,
only requires that the status to be displayed in the output. In this question, we can see that
the decision will result in the process of setting the status to either passed or failed,
depending on the percentage received. This is shown in the pseudo code below.
2. Pseudo Code
Begin
1 Input: Name
2 Input: SIN
3 Input: Percentage Received
4 Decision: If the percentage received is greater than or equal to 50% [Flow chart: Yes]
5 Process: Set the status as passed [Status = Passed]
6 Else [Flow chart: No]
7 Process: Set the status as failed [Status = Failed]
8 Output: Status: {Status}
End
Note: On line 4 we have a decision to check. Line 5 shows the process that should run if the
decision on Line 4 is Yes. While line 6 checks if the decision on line 4 is No, the process on
line 7 will occur. The processes that occur after a decision check have been moved inwards
to show that their occurrence depends on the result of the decision. This is illustrated in the
Flow chart below.
3. Flow Chart

Begin

Input: Name

Input: SIN

Input: Percentage Received

Decision: If
Process: [No] Percentage [Yes] Process:
Status = Failed Received >= Status = Passed
50%

Output: Status

End

You might also like