grd10 - 2022-23 - T2 - Mock - P2

You might also like

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

Ahmadhiyya International School

Mock Exam
Grade 10

CANDIDATE
CLASS
NAME
CENTRE CANDIDATE
NUMBER NUMBER

COMPUTER SCIENCE 0478/22


Paper 2 Algorithms, Programming and Logic 16 March 2023
1 hour45 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.


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 total mark for this paper is 75.

For Examiner’s Use

75
This document consists of 11 printed pages including the cover page
© AIS 2023
Ahmadhiyya International School Examinations [Turn over
MOCK EXAM 2022-23
- 2 of 11 -
1. Explain the following: [5]

2D Array:

Constant:

Flowchart:

2. Match the following: [5]

Pre-condition loop Case...otherwise..end case

Post-condition loop For...next

Finite loop While..end while

Nested condition statements Repeat...until

Simple conditional
If...then...else...end if
statement

©AIS Computer Science - P2 Mock Exam– 2022-23 Grade 10


- 3 of 11 -
3. Write an algorithm using pseudocode or otherwise to input and store Student Index, Student
Name, Height in meters and Weight in Kgs of 220 students of a grade. Calculate and output
BMI of each student. In the end calculate and output the average BMI of the class, count of
students whose weight is less than 50. Finally output the details of the student or students
whose weight is less than 50. Declare necessary variables and data structures including data
types. BMI=Weight /height2 [8]

©AIS Computer Science - P2 Mock Exam– 2022-23 Grade 10


- 4 of 11 -

4. Write an algorithm using Repeat...Until loop to input the number of chess moves each played
by 30 players. Make sure you validate the input, and re-input the value till it is correct. No
negative values are allowed. Finally output the lowest number of moves. [5]

©AIS Computer Science - P2 Mock Exam– 2022-23 Grade 10


- 5 of 11 -
6. The flowchart below calculates the number of tins of paint required to paint walls. The
flowchart inputs the height and width of a wall in metres, the number of doors and the
number of windows.
A value of –1 for the height stops the input. [6]

Complete the trace table for the input data:

3, 5, 1, 0, 3, 7, 0, 0, 3, 5, 0, 3, 3, 7, 1, 1, –1, 0, 0, 0

Area Tins Height Width Doors Windows

©AIS Computer Science - P2 Mock Exam– 2022-23 Grade 10


- 6 of 11 -
7. A computer-controlled production unit manufactures thin metal sheets as roofing material for
houses. The sheets need to be bent to get a shape. At different places it is heated and bent.
The manufacturing depends on temperature, tenacity of sheet, and width. The system is
continuously monitored by sensors.

Parameter Description Binary Value Conditions


0 < 232 ℃
T Temperature of sheet
1 > = 232 ℃
0 Breaks before 232 ℃
C Tenacity of sheet
1 Breaks after 232 ℃
0 < 36 cm
W Width of sheet
1 > = 36 cm

The manufacturing process stops and an alarm X will sound if:


Width of sheet < 36 cm AND (temperature of sheet < 232 ℃ OR breaks before 232 ℃)
OR
Width of sheet < 36 cm OR temperature of sheet < 232 ℃
a. Draw a logic circuit to represent the above monitoring system. [5]

b. Complete the truth table for the above logic circuit. [5]
T C W X
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1

©AIS Computer Science - P2 Mock Exam– 2022-23 Grade 10


- 7 of 11 -
8. A single-table database, MOBILES needs to be set up to store details of Mobile phones for
sale.

Item ID Brand Model Resolution 4G OLED Stock Price

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

Field Name Data Type


ItemID
Brand
Model
Resolution
4G
OLED
Stock
Price

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

c. Give two validation checks that could be used while entering stock data. [2]

d. The following results were output when a query was run by applying a criteria in 4G field

ItemD Brand Resolution 4G OLED Price


109 Samsung 2688x1520 Yes Yes $725.00
101 Apple 1920x1080 Yes No $1200.00

Complete the SQL statement that caused the above records to be output. [4]

SELECT ..............................................................................................................................

FROM .................................................................................................................................

WHERE ..............................................................................................................................

ORDER ..............................................................................................................................

e. Complete the SQL statement to display Brand, Model and stock of mobiles with OLED
technology. [4]
SELECT ..............................................................................................................................

FROM .................................................................................................................................

WHERE ..............................................................................................................................

©AIS Computer Science - P2 Mock Exam– 2022-23 Grade 10


- 8 of 11 -
9. Study the program carefully.
1 print "addition(a)"
2 print "subtraction(s)"
3 print "multiplication(m)"
4 print "division(d)"
5 print "exponentification(e)"
6 print "Quit(q)"
7 input num1
8 input num2
9 input option$
10 while option$<>"q" or option$<>"Q"
11 select case option$
12 case "a"
13 c = num1 + num2
14 print "sum is:";c
15 case "s"
16 c = num1 - num2
17 print "Difference is:";c
18 case "m"
19 c= num1*num2
20 print "Product is :";c
21 case "d"
22 c = num1/num2
23 print "Quotient is:";c
24 case "e"
25 c = num1^num2
26 print "Exponentification is:"c
27 end select
28 end while

a. What is the aim of the above program? [1]

b. Suggest one way you could minimise the lines in the program. [2]

c. What would be the output if the user input the option as “m”? [1]

d. What would be the output if the user input the option as “x”? [1]

©AIS Computer Science - P2 Mock Exam– 2022-23 Grade 10


- 9 of 11 -
10. 30 students from 6 schools participated in inter-school games. The school names are:
Oxford, Mount Berry, Scania, Republican, BES and MES. Each student had to participate
in 4 different games. In each game the lowest point awarded was 1 and the highest
awarded was 10. Use a 1D array to store student names and school names and a 2D array
to store the points they secured in each game. Validate the inputs using a While loop.
Calculate and output:
Total points scored by each student
Average points scored by each student
Count of students from each school
Total points scored by each school

©AIS Computer Science - P2 Mock Exam– 2022-23 Grade 10


- 10 of 11 -

©AIS Computer Science - P2 Mock Exam– 2022-23 Grade 10


- 11 of 11 -

[15]

©AIS Computer Science - P2 Mock Exam– 2022-23 Grade 10

You might also like