0% found this document useful (0 votes)
62 views6 pages

Mock Test 1 (Answers)

The document contains sample questions and answers related to programming concepts. It provides example code, flowcharts, and explanations of programming techniques. The questions cover topics like functions, variables, data types, selection statements, and data structures. Scoring guidelines are provided for each question to assess student responses.

Uploaded by

ibrahim
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)
62 views6 pages

Mock Test 1 (Answers)

The document contains sample questions and answers related to programming concepts. It provides example code, flowcharts, and explanations of programming techniques. The questions cover topics like functions, variables, data types, selection statements, and data structures. Scoring guidelines are provided for each question to assess student responses.

Uploaded by

ibrahim
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/ 6

Question Answer Mark

Number
1(a) Award 1 mark for any of the following up to a
maximum of 2 marks.
 Check the length and width are entered
 Convert feet to (square) metres
 Calculate the amount of square
metres/area
 Multiply the price for one square metre by
the number of square metres required
 Deduct the discount if more than 20
square metres are ordered (2)

Question Answer Mark


Number
1(b) Award 1 mark for any of the following up to a
maximum of 3 marks.

 Number of feet in one metre


 How to calculate area/square metres
 Price for one square metre
 Discount rate (if 20 or more square metres
are ordered) (3)

Question Answer Mark


Number
1(c) Award 1 mark for the appropriate variable and 1
mark for a correct data type and an additional
explanation.
 Variable: Length or Width (1)
 Data Type: Real/Floating Point (1) as the
measurement is likely to include a decimal
/ will need precision (1)

 Variable: Metres/Square Metres (1)


 Data Type: Integer (1) as the number
required has to be rounded upwards to the
nearest whole number (1)

 Variable: Cost (1)


 Data Type: Real/Floating Point (1) as the
price per square metre contains a decimal
(1) (3)
Question Answer Mark
Number
1(d) Award one mark for identification and one
additional mark for appropriate expansion.

 INPUT to allow the user to enter their


measurements (1) so that it can be
assigned to a variable (1)
 ROUND to round the number of metres up
(1) to the nearest whole number (1) (4)

Question Answer Mark


Number
1(e) Award one mark for identification and one
additional mark for each appropriate expansion
up to three marks.

An IF statement will only check once (1) whereas


a WHILE will check continuously (1) until valid
data is entered (1)

Accept any other relevant phrasing/wording. (3)

Question Answer Mark


Number
1(f) Award one mark for identification and one
additional mark for each appropriate expansion
up to three marks.

To ensure that the measurements entered are


within two boundaries (1) to ensure that the data
entered is more reasonable (1) such as
measurements should be >0 (and below a pre-set
value) (1) (3)
Question Answer Mark
Number
1(g) POSSIBLE ALGORITHM:

Guidance:
1 mark for each of the following points:
 Decision box showing correct logic for checking
that the length AND width have been entered
(e.g. length AND width >0) (1)
 Yes route correctly labelled and leads to running
the function ‘calculate’ (1)
 No route correctly labelled, leads to error
message and prompts user to re-enter the
measurements (1)
 Appropriate conventions for a flow chart (e.g.
correct BCS symbols, correct data flow) (1) (4)
Question Answer Mark
Number
2(a) Award one mark for each correct value in the
table up to a maximum of four marks.

Data Entered Problem Value


3 3 (Variable Inputted)
yes 3 (no calculation)
yes 2 (3-1=2)
no 2 (no calculation)
yes 1 (2-1=1)

Additional guidance- allow follow through for


incorrect values that result from correct
application of a process that uses previously
incorrect value.
(4)

Question Answer Mark


Number
2(b) Award one mark for identification and one
additional mark for appropriate expansion up to
four marks.
 Frequently used code only needs to be
written once (1) reducing development
time (1)
 Improves reusability of code/allows
sections of code to be shared with others
(1) by creating self-contained blocks of
code (1)
 To make the programming code more
efficient/reduces the amount of code to be
loaded (1) which therefore increases the
performance (of the code) (1)
 To reduce the amount of errors in the code
(1) if the code needs to be adapted it only
needs changing once (1)
 Aids problem solving (1) by allowing
complex problems to be broken down
(deconstruction) (1) (4)
Question Answer Mark
Number
2(c) An explanation of why the function is defined
before it is called such as:

The programming language used is


interpreted language (1) so the programming
code is run in sequence (from top to bottom)
(1) by defining it (the function) first it will be
loaded into the memory (1) so it is ready to
be executed when called (1)

Accept any other relevant phrasing/wording. (4)

Question Answer Mark


Number
2(d) Award one mark for identification and one
additional mark for appropriate expansion up to
three marks.

 The problems variable is declared at the


start of the program (1) but it needs to be
changed inside a function (1) the global
command enables the variables declared
outside of a function to be accessed/
updated (by other parts of the program)
(1)
If not, the problems variable (in part D) would
only be assigned the value locally (1) so other
functions/other parts of the code would use the
original value (1) causing the program to produce
incorrect results/not function correctly (1)
(3)

Question Answer Mark


Number
2(e) A explanation of why the error has occurred such
as :

User input is defined as a string (1). The IF


statement then compares this variable against an
integer/the value 0 (1). As they are not the same
data type the comparison cannot be made (1) (3)
Question Answer Mark
Number
2(f) Award one mark for identification and one
additional mark for appropriate expansion up to
three marks.

Not all lines of the code need to be executed (1)


as the program will attempt to solve a varying
number of problems with a printer (1) therefore
the selection statements will execute the correct
part of the code (that solves their specific
problem) (1) (3)

Question Answer Mark


Number
3(a) Award one mark for each identification up to a
maximum of three marks.

 Incorrect operator has been used / a less


than operator (<) should have been used
 First ELSE should be an IF statement
 Incorrect variable has been printed/ status
has been misspelt (3)

Question Answer Mark


Number
3(b) Award 1 mark for identification and 1 additional
mark for appropriate expansion up to a maximum
of 3 marks each.

 There are multiple distinct data sets (1)


which have to be stored separately but in
related structures (1) this structure allows
a set of scores for each student that can
be accessed by a single identifier (1) (3)

You might also like