0% found this document useful (0 votes)
129 views10 pages

Mock P2 Ais Cie Igcse Computer Sci

Uploaded by

Aala Solih
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)
129 views10 pages

Mock P2 Ais Cie Igcse Computer Sci

Uploaded by

Aala Solih
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
You are on page 1/ 10

Ahmadhiyya International School

Mock Exam
Grade 10

CANDIDATE
CLASS
NAME
CENTRE CANDIDATE
NUMBER NUMBER

COMPUTER SCIENCE 0478/22


Paper 2 Problem Solving and Programming 22 March 2022
1 hour 45 minutes
Candidates answer on the Question Paper.
No Additional Materials are required.
No Calculators allowed
READ THESE INSTRUCTIONS FIRST

Write your Centre number, candidate number and name on all the work you hand in.
Write in dark blue or black pen.
You may use an HB pencil for any diagrams or graphs.
Do not use staples, paper clips, glue or correction fluid.
DO NOT WRITE IN ANY BARCODES.

Answer all questions.


DO NOT ATTEMPT TASKS 1, 2 AND 3; these are for information only.
You are advised to spend no more than 40 minutes on Section A (Question 1).
No marks will be awarded for using brand names of software packages or hardware.
At the end of the examination, fasten all your work securely together.
The number of marks is given in brackets [ ] at the end of each question or part question.
The maximum number of marks is 50.
For Examiner’s Use

50
This document consists of 10 printed pages including the cover page
© AIS 2022
Ahmadhiyya International School Examinations [Turn over
MOCK EXAM 2021-22
- 2 of 10 -
Section A
You are advised to spend no longer than 40 minutes answering this section.

In preparation for the examination candidates should attempt the following practical tasks by
writing and testing a program or programs.
A program is needed to allow a Wildlife Park to sell tickets. A booking consists of one or more
tickets for the same day(s) and can be made up to a week in advance. A booking can be made for
a visit of one day or two consecutive days. A booking can have extra attractions included. A
booking will be valid for the day(s) chosen only.

Ticket Type Cost for one day Cost for two days
one adult $20.00 $30.00
one child (an adult may bring up to two children) $12.00 $18.00
one senior $16.00 $24.00
family ticket (up to two adults or seniors and three children) $60.00 $90.00
groups of six people or more, price per person $15.00 $22.50

Exam attraction Cost per person


lion feeding $2.50
penguin feeding $2.00
evening barbecue (two-day tickets only) $5.00

Write and test a program or programs for the Wildlife Park:


• Your program or programs must include appropriate prompts for the entry of data. Data must
be validated on entry.
• All outputs, including error messages, need to be set out clearly and understandably.
• All variables, constants and other identifiers must have meaningful names.

You will need to complete these three tasks. Each task must be fully tested.

Task 1 – displaying the ticket options and the extra attractions available
Set up your program to:
• display the options, attractions and prices for one-day tickets
• display the options, attractions and prices for two-day tickets
• show the days available for booking; assume that there are tickets available for any valid day.

Task 2 – process a booking


Extend your program for Task 1 to:
• input the tickets and extra attractions required, then calculate the total cost of the booking
• allocate a unique booking number
• display the booking details, including the total cost and the unique booking number
• repeat as required.

Task 3 – ensuring each booking is the best value


Check that the total for each booking gives the best value and offer an alternative if this is not the
case.
For example, buying two family tickets is better than a group ticket for a group of 10 that includes
four adults and six children.

©AIS Computer Science - P2 Mock Exam – 2021-22 Grade 10


- 3 of 10 -
1. a. All variables, constants and other identifiers should have meaningful names.
(i) Name three arrays you used in Task 1 and state the purpose of each one. Note that the
arrays you list must be of three different data types. [3]
Array 1:

Purpose:

Array 2:

Purpose:

Array 3:

Purpose:

(ii) Name one constant you used in Task 1 and state the purpose of each one. [1]
Constant:

Purpose:

(iii) Write the program code / pseudocode to display the ticket options, extra attractions
available and the days available for booking. You should show your variables / constants /
arrays and declaration of data type clearly. [7]

©AIS Computer Science - P2 Mock Exam – 2021-22 Grade 10


- 4 of 10 -

©AIS Computer Science - P2 Mock Exam – 2021-22 Grade 10


- 5 of 10 -

b. Discuss how you plan to ensure best booking as required in Task 3? [2]

©AIS Computer Science - P2 Mock Exam – 2021-22 Grade 10


- 6 of 10 -

c. In Task 2, for each booking, a booking number needs to be given, total to be calculated and
number of days with week day names is required to be displayed in the end. Write the program
code used for: [7]
Booking number:

Display the day/s selected:

Total for family booking:

Total for group booking:

©AIS Computer Science - P2 Mock Exam – 2021-22 Grade 10


- 7 of 10 -
Section B
2. Study the following flowchart very carefully.

Start

num[3]={ 9 , 5, 7 }

i=1

NO
i<=3 Print “Done”

YES
Stop
j=i+1

NO
j<=3

i j temp num (i) num (j) output


YES
1 2 9 5 9
3
num[ i ] > num[ j ] 4
NO 2 3 9 7 9
4
YES
3 4
temp = num[ i ]
num[ i ] = num[ j ] 4 done
num[ j ] = temp

j=j+1

i=i+1

a. Trace the above flowchart and write down the value of num ( i ) and num ( j ) when i was 1. [3]

num ( i ) = num ( j ) =

b. Guess the purpose of the above flowchart. [1]

©AIS Computer Science - P2 Mock Exam – 2021-22 Grade 10


- 8 of 10 -
3. Study the pseudocode given below carefully.
Declare passw( 6) as string
Read passw(6) f rom f ile
passw( 6) = ( "T", " !", "O", "w ", "$", " # " )
attempt = 0
WHILE attempt < 2
INPUT "Ent er the f irst character", f $
IF passw(1) <> f $ THEN
PRINT "Access denied"
ELSE
INPUT " Enter the f if th character", f v$
IF passw( 5) <> f v$ THEN
PRINT " Access denied"
ELSE
INPUT " Enter the sixth character ", sx$
IF passw( 6) <> sx$ THEN
PRINT " Access denied"
ELSE
PRINT " Access granted"
END IF
END IF
END IF
attempt = attempt + 1
END WHILE

a. Trace the above pseudocode for the following sets of inputs:

Set 1: t, T, $, 3
Set 2: T, 4, T, $, # [4]

attempt f$ fv$ sx$ output


0 t Access denied
1 T $ 3 Access denied
2

0 T 4 Access denied
1 T $ # Access granted
2

©AIS Computer Science - P2 Mock Exam – 2021-22 Grade 10


- 9 of 10 -
b. What is the purpose of the above algorithm? [1]

c. The above algorithm has a bug which cannot be found with the given test data. Identify the
error. [1]

d. Write down the steps to be taken to correct the algorithm. [2]

4. Define the following with a suitable example for each. [6]


a. Totalling

b. Counting

c. Inbuilt function

©AIS Computer Science - P2 Mock Exam – 2021-22 Grade 10


- 10 of 10 -
5. A single-table database, CCTV needs to be set up to store details of CCTV Cameras for sale.

Face
CCTVID Brand Type Resolution Price Motion detection stock
detection

a. Suggest the data type for each of the required fields listed below. [5]

Field Name Data Type


CCTVID
Brand
Type
Resolution
Price
Face detection
Motion detection
Stock

b. Name the field that is suitable to be the key field. [1]

c. Give a validation check that could be used on stock data. [1]

d. The following results were output when a query was run.

Face
CCTVID Brand Resolution Price
detection
D101 Hikvision 2688x1520 Yes $125.00
B105 Bosch 1920x1080 No $100.00

Complete the query-by-example grid that caused the above records to be output. [5]
Field
Table
Sort
Show     
Criteria
or

©AIS Computer Science - P2 Mock Exam – 2021-22 Grade 10

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy