0% found this document useful (0 votes)
12 views3 pages

Flowchart Program for Resident Skills and Parking Fees

The document outlines two programming tasks for a community center and an airport. The first task involves creating a flowchart to process resident information and display messages based on age and education level. The second task requires calculating parking fees based on the type of parking and duration, with specific conditions for shaded and open parking.

Uploaded by

Sinenhlanhla
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views3 pages

Flowchart Program for Resident Skills and Parking Fees

The document outlines two programming tasks for a community center and an airport. The first task involves creating a flowchart to process resident information and display messages based on age and education level. The second task requires calculating parking fees based on the type of parking and duration, with specific conditions for shaded and open parking.

Uploaded by

Sinenhlanhla
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

QUESTION 1

The Duncan Village community centre wants to help local residents learn some basic
skills. They can apply for government funding if they gather background information about
the residents. They need you to write a program that will help them to apply. For each
resident, they will input the following:
Gender, age, and highest grade passed at school (this will be a number between 1 and
12).

Draw a flowchart for a program that will accept the above input and do the following:

a) If the resident is under the age of 18, display the message “TOO YOUNG”.
b) If the resident is a female over 21, display the highest grade the resident passed
at school.
c) If the resident is over 30 and has passed grade 5 but has not passed grade 8,
display the resident’s age.

N.B: Please turn your paper sideways and draw the flow chart ‘down’ the two inside
pages.
NB: Include the messages
for your inputs inside each
INPUT SYMBOL for the
next flowchart as well

QUESTION 2

East London Airport has two types of parking for cars, shaded parking and open parking. It charges
visitors for parking based on the type of parking used. The minimum charge for shaded parking is
R 20.00 and open parking is R 10.00, which is the parking fee for the first 2 hours. Thereafter,
R 5.00 is charged for every hour or part thereof for shaded parking and R 3.00 for open parking.
A program is required to get the type of parking used (the user inputs S for shaded parking and O
for open parking) and the number of hours parked (hours is entered as a whole number). The
program calculates and displays the amount to be paid as the parking fee.
GENERAL CONDITIONS: 0 marks for any calculation, condition, display, accept etc. if any of the variables is not declared or wrong declaration or if the variable
do not contain a valid value.
0 for any step if the syntax is invalid.
0 marks for any unconnected (hanging shape)
0 marks if each step is not of the correct shape.

BEGIN If BEGIN or END is missing, subtract 1 mark from total marks.

Declare parkType As String


Declare hours as Integer
Declare parkingFee as Real

Accept statement: ½ mark each – Total 1 marks.


ACCEPT
parkType,
hours

Condition : 2 marks. The two branches must be labelled True/False or Yes/No


IF parkType = “S” TRUE
Calculation of parking fee : 1 mark.
AND hours <= 2

FALSE parkingFee = 20

TRUE
IF parkType = “S” Condition : 2 marks. The two branches must be labelled True/False or Yes/No
AND hours >2 Calculation of parking fee : 2 marks.
Give the total 7 marks if a student used nested if structure using simple
parkingFee = 20 + conditions for the calculation of parking fee for shaded parking.
FALSE (hours-2) * 5

TRUE
IF parkType = “O”
AND hours <= 2 Condition : 2 marks. The two branches must be labelled True/False or Yes/No
Calculation of parking fee : 1 mark.

FALSE parkingFee = 10

TRUE Condition : 2 marks. The two branches must be labelled True/False or Yes/No
IF parkType = “O” Calculation of parking fee : 2 marks.
AND hours >2 Give the total 7 marks if student uses a nested if structure for the calculation of
parking fee for open parking.
parkingFee = 10 +
FALSE (hours – 2) * 3

DISPLAY
parkingFee Display of parking fee: 1 mark.

END TOTAL: 16 MARKS

You might also like