Task1 2

You might also like

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

Task1 v1.

2 PRM P21 May June 2021-22

Task 1 – becoming a member of Friends of Seaview Pier Set up a system to enable people to become
members of Friends of Seaview Pier and for each new member enter:
• their first name and last name
• whether or not they wish to work as a volunteer ○ if they choose to volunteer,
identify the area from:
– the pier entrance gate
– the gift shop
– painting and decorating
• the date of joining
• whether or not they have paid the $75 fee.

All of this information needs to be stored using suitable data structures.

10 ConstMFee=75
15 TodaysDate=17052022 //This is exam date or todays date to find out membership expiry when needed
20 MCounter=1
30 Repeat //Main Loop Body
40 Print"Enter First Name"
50 Input FirstName[MCounter]
60 Print"Enter Last Name"
70 Input LastName[MCounter]

71 repeat // this is a sub loop for validation of isvolunteer input.


80 Print "Will you be a volunteer? Y/N"
90 Input IsVolunteer[Mcounter]
91 If IsVlunteer[Mcounter]<>'Y' or IsVlunteer[Mcounter]<>'N'
92 Then
93 Print "Invalid Input, Kindly Try again"
94 End If
95 Until IsVolunteer[Mcounter]='Y' or IsVolunteer[Mcounter]='N'
100 If IsVolunteer[Mcounter]='Y'

110 Then

120 print "where will you work?"


130 Print "1. Pier Entrance Gate"
140 Print "2. Gift Shop"
150 Print "3. Painting & Decorating"
155 Repeat // this is a sub loop for validation
156 Print "Enter Volunteer work Area, 1, 2, 3"
160 Input VWArea[Mcounter]
161 If VWArea[Mcounter] <> 1 or VWArea[Mcounter]<> 2 or VWArea[Mcounter]<>3
162 Then
163 Print "Invalid Input, Kindly Try again"
164 End If
Task1 v1.2 PRM P21 May June 2021-22

165 Until IsVolunteer[Mcounter]='Y' or IsVolunteer[Mcounter]='N'


170 Endif

175 Repeat // Validation routine for date input


180 Print "Enter date of joining DDMMYYYY"
190 Input DateOfJoining[Mcounter]
191 If DateOfJoining[Mcounter]> 31122023 or DateOfJoining[Mcounter] < 01012022
192 Then
193 Print "Invalid Input, Kindly Try again"
194 End If
195 Until DateOfJoining[Mcounter]<31122023 and DateOfJoining[Mcounter]>01012022
200 Print "have you paid the fee? $75"
210 Input IsMFeePaid[MCounter]

220 Print "Do you want to add more members Y/N"


230 Input EntryStatus
240 If EntryStatus='Y' then MCounter=MCounter+1
250 Untill EntryStatus='N'

You might also like