Professional Documents
Culture Documents
O Level Computer Science 2210 Pre Release Material Summer 2017
O Level Computer Science 2210 Pre Release Material Summer 2017
In Preparation for the examination candidates should attempt the following practical
tasks by writing and testing a program or programs.
− The Organizer of a senior citizens’ club has arranges outings for the members. For
each of these outings a coach is hired, meals at a restaurant are reserved and
tickets for the theater has booked. A program is required to work out the costs
and provide a printed list showing everyone on the outing.
− Write and test a program for the club organizer.
− Your program must include appropriate prompts for the entry of data.
− All variables, constants and other identifiers must have meaningful names.
You will need to complete these three tasks. Each task must be fully tested.
The minimum number of senior citizens needed for the outing to go ahead is 10; there
cannot be more than 36 senior citizens on the outing. A minimum of two carers go on the
outing. With an additional carer needed if more than 24 citizens go on the outing. Carers
do not have to pay anything for the outing. Workout the total cost per person for the senior
citizens.
Task 2
Record who is going on the outing and how much has been paid.
Using your results from Task 1, record the names of the people on the outing and the
amount they have paid; include the carers on the outing. If there are spare places on the
coach then extra people can be added; they are charged the same price as the other
citizens. Calculate the total amount of money collected. Print out the list of the people on
the outing.
Task 3
Identify the break-even point or profit that will be made on the outing.
Show whether the outing has made a profit or has broken even using the estimated cost
from the Task 1 and money collected from Task 2.
FaceBook : https://www.facebook.com/groups/olevelcomputers/
Task 2
1. Input and store (record) the names and amount of people going on outing in one
dimensional array and total the amount paid
2. Find out if there are extra seats available on the coach
3. If seats are available then include more people (extra people) on coach
4. As extra people have to pay the same amount, add total amount paid.
5. Output the list of all the people going on outing with their names and amount they
have paid
Task 3
Task 3 is all about finding the profit by subtracting the expected cost calculated in task
1 with the total of amount paid in task 2. But we also have to carefully add the meal and
ticket cost of extra people going on the outing in the expected cost, using formula :
expected amount = people x (meal cost + ticket cost) and then, expected cost =
expected cost + extra amount.
Solution (Pseudo Code)
Task 1
INPUT citizen
INPUT citizen
ENDWHILE
People citizen + 2
ENDIF
ENDIF
ENDIF
cost_per_person expected_cost/citizen
TASK 2
FOR c 1 to people
INPUT name(c)
INPUT amount(c)
seats 16 – people
ENDIF
seats 26 – people
ENDIF
seats 39 – people
ENDIF
Updated_people people
FOR d c to updated_people
INPUT name(d)
INPUT amount(d)
ENDIF
FOR c 1 to updated_people
OUTPUT (“The Citizens’ Name :”, name(c) ,” & the amount submitted :”, amount(c))
NEXT
Task 3
Profit 0, extra_amount 0
Sub Main()
‘TASK 1
people = 0
expected_cost = 0
cost_per_person = 0
‘TASK 2
For c = 1 To people
Console.Write("Enter the name of person on the outing : ")
name(c) = Console.ReadLine()
Console.Write("Enter the amount paid by the person : ")
amount(c) = Console.ReadLine()
amount_paid = amount_paid + amount(c)
Next
updated_people = people
For d = c To updated_people
Console.Write("Enter the name of person on the outing : ")
name(d) = Console.ReadLine()
Console.Write("Enter the amount paid by the person : ")
amount(d) = Console.ReadLine()
amount_paid = amount_paid + amount(d)
Next
End If
For c = 1 To updated_people
Console.WriteLine("The Citizens’ Name :" & name(c) & " and the amount
paid : " & amount(c))
Next
‘TASK 3
If people >= 12 And people <= 16 Then extra_amount = people * (14.0 + 21.0)
If people >= 17 And people <= 26 Then extra_amount = people * (13.5 + 20.0)
If people >= 17 And people <= 26 Then extra_amount = people * (13.0 + 19.0)
If profit > 0 Then Console.WriteLine(" The Profit Gained : " & profit) Else
Console.WriteLine("The Break Even Point Value : " & expected_cost)
Console.ReadKey()
End Sub
End Module