2324 Level L (Gr10 UAE - GULF) IGCSE Computer Science Course Questions Solutions
2324 Level L (Gr10 UAE - GULF) IGCSE Computer Science Course Questions Solutions
2324 Level L (Gr10 UAE - GULF) IGCSE Computer Science Course Questions Solutions
(108)
1. [T]
Data is processed in a computer by using logic gates that only have two states (0 or 1)
Section 2
The Binary, Denary, and Hexadecimal Systems
(1)
2. [G] B
(2)
3. [G] B
(3)
4. [G] B
(36)
5. [T]
(a) 32 16 8 4 2 1
1 1 1 0 1 1
59 = 32 + 16 + 8 + 2 + 1
So (59)10 = (111011)2
(b)
Register 1 0 0 1 1 1 0 1 1
Register 2 0 0 0 0 0 0 1 1 1 0 1 1
(c)
1 0 1 0 0 0 0 1 1 0 1 1
(39)
6. [T]
(a) The sequence of colors is: blue, green, white.
The time delay is: 7 seconds.
(b)
R1 R2
1 0 1 0 0 1 1 0 1
(c) • Sequence always starts from left to right
• So sequence would still be red, blue, then green
Section 3
Applications of the Hexadecimal Numbering System
(157)
7. [T]
• Easier for programmers to read and understand
• Easier to find errors
• Conversion to binary easier than conversion from denary to binary
• More values can be displayed
• Faster than binary for data entry
• Can represent 16-bit words as only 4 hexadecimal digits
• Easier convert hexadecimal digits back to binary, if needed
Section 4
Adding Binary Numbers
(109)
8. [T]
(a) 1 1 1 1
0 0 1 1 1 0 0 1
+ 0 1 0 0 1 0 1 0
1 0 0 0 0 0 1 1
(b) Error name: Overflow
Explanation: The value is larger than 255, so all the bits required to represent the value
cannot fit in the 8-bit register
Section 5
Logical Binary Shifts
(4)
9. [G] A
Section 6
Two’s Complement
1 0 0 1 0 0 0 0
1 0 0 1 0 0 1 0
Section 7
Text and Character Sets
11. (112)[T]
a) • All the characters and symbols that can be represented by a computer system.
• Each character and symbol is assigned a unique value.
(b) Each character is encoded using more bits.
Section 9
Representing Images
12. (115)[T] a.
i. • One square/circle of one colour
• The smallest component of the image
ii. • The number of pixels per set area
• The number of pixels wide by the number of pixels high
• The number of pixels in an image
1,024×1,024 210 ×210
b. Size of image in bytes = 8
= 23
= 217 bytes
217
Size of image in KiB = 210
= 27 = 128 KiB
Section 10
Measuring Data Storage
Section 12
Data Compression
14. (5)[G] E
15. (111)[T] (a) Reducing the file size
(b) C
(c) Lossy and lossless
16. (113)[T]
• A compression algorithm is used
• No data is removed in the process (original file can be restored)
• Repeated words/symbols are identified
• … and are indexed (put into a table)
• … and are replaced with their index
• … and their positions are stored (in the table)
• … and the number of times the word/pattern appears is stored (in the table)
Chapter 2
Data Transmission
Section 2
Methods of Data Transmission
(6)
1. [G] A
(162)
2. [T]
(116)
3. [T]
(a) • it has a header
• … that contains the destination address
• … that contains the packet number
• … that contains the originator’s address
• it has a payload
• it has a trailer.
(b) • parallel would allow fastest transmission
• … of the large amount of data
• data can be uploaded and downloaded …
• … but this does not have to be at the same time
• data is not required to travel a long distance
• … therefore skewing is not a problem
Section 3
The Universal Serial Bus (USB) Interface
(41)
4. [T]
(a) Universal Serial Bus: A standard method for transferring data between a
computer and a number of devices
(b) • Devices are automatically detected
• Plug only goes in one way
• Supports multiple data transmission speeds
• No need to restart the computer
• Faster transmission compared to wireless transmission
• USB are supported by different operating systems
• It is the standard adopted by industry standard
(c) • Maximum cable length is about 5 meters
• Current transmission rate is limited to less than 500 megabits per second
Section 5
Error-Detection Techniques
(7)
5. [G] B
(8)
6. [G] E
(118)
7. [T] (a)
Parity bit
Register A 0 1 0 0 1 0 1 0
Register B 0 0 1 1 0 1 1 0
Register C 1 0 0 1 1 1 1 0
(b) • In parity check, interchange of bits will not be detected
• The position of both changes will be highlighted
(c) Bit number 2
Byte number 5
Section 6
Data Validation and Verification
(42)
8. [T]
Field Name Validation Check Data that fails the validation check
Date of visit • format check • 2020/12/04
• 3rd March 2020
• type/character check • can’t be < 0 or > 2.5m
Patient’s height • range check • –5, five
• limit check • 8, –3
• type check • cannot be < 0 or > 99999999
8-digit patient ID • length check • 3142ABCD, 2131451, 136498207
• range check • –3, 851341625
• length check • 0773141621834
Telephone number • type/character check • 7H215GD
• format check • 01223/123456/8901234
Section 7
Error-Detection Techniques
(9)
9. [G] A
Section 8
Encryption
(117)
10. [T]
plain
algorithm/key
key/algorithm
cipher
understood
Chapter 3
Hardware
Section 3
The Von Neumann Architecture
(10)
1. [G] D
(43)
2. [T]
(a) • Controls operation of memory, input/output and the processor
• Interpret Instructions
• Sends instructions signals to other components
(b) Allows arithmetic (such as addition and subtraction) and logic (such as NOT,
OR, AND) operations to be executed
(160)
3. [T]
Program counter (PC):
Contains the address of the next instruction to be executed and it gets incremented,
after the current instruction is executed
Current instruction register (CIR):
Contains the instruction to be decoded or executed
Memory address register (MAR):
Contains the address of the memory location of the data to be accessed
Memory data register (MDR):
Contains the data to be fetched or copied
Index register (IR or XR):
Used in some arithmetic operations, to address arrays of data, and in calculation of
storage addresses.
(161)
4. [T]
Section 4
Performance of the CPU
(121)
5. [T]
(a)
• It sends control signals that manage the transfer of data and instructions within the
CPU
• It decodes an instruction using an instruction set
(b) (i) • to process an instruction
• to carry out a fetch-execute cycle
(ii) • It can now process two instructions simultaneously (where suitable)
increasing the performance.
Section 6
Embedded Systems
6. (123)
[T]
• it is built into a device
• it has a single purpose/limited/dedicated function
• it runs on firmware
• it does not have additional peripherals.
Section 7
Input Devices
(11)
7. [G] A
(12)
8. [G] B
(164)
9. [T]
(a) • An ADC converts an from analogue to digital
• An image is changed into pixels
• Each pixel has a binary value
• Pixels combine in a grid to form the image
• Each pixel has a color
• Pixels are saved sequentially in a file
• Data about the depth, color, and dimension is saved
• The file is stored using a photo file format (such as JPEG)
(b) • Shutter speed control
• Focus photos automatically
• Automatic flash
• Remove red-eyes that occur when the flash is used
• Anti-handshake
• Auto-capture
• Ability to modify photos after they have been captured by applying
special effects
• Smart operations such as face recognition
• Unwanted photos can be easily deleted
• Can be connected to a computer via a USB port or Bluetooth, that
allows wireless transfer of photos
(37)
10. [T]
(a)
Resistive Capacitive Infra-red
(b)
Resistive Capacitive Infra-red
(38)
11. [T]
• Red laser light is emitted to barcode
• Light is reflected back (black lines reflect less light than white lines)
• A sensor detect the light
• Different reflections have different binary values
• A microprocessor interprets the data
(39)
12. [T]
(a) QR (Quick Response) Code
(b) • Normal barcodes are one-dimensional whereas QR codes are two-
dimensional
• Normal barcodes consist of vertical lines whereas QR codes contain
‘squares’
• Normal barcodes can hold up to 30 digits whereas QR codes can hold
more than 7000 digits (bigger storage size)
• QR codes can be scanned using the built-in camera of a smart phone,
whereas normal barcodes are read using a red laser
• QR code can be read from any angle whereas barcode readers have to
be lined up with the barcode
• Normal barcodes are used at terminals whereas QR codes are used for
easier advertising
(c) • Barcode is scanned using a QR reader or a camera
• Read by a laser
• Processed using an app
• Light is reflected back
• White squares reflect more light than black square
• Squares containing data are decoded
(d) • Visitor scans the QR code
• App is used to read and interpret the QR code
• Links to a websites to access tourist information
• Information on QR code can be stored for future use
(40)
13. [T]
• It is a large interactive display that can be connected to a computer
• A projector displays the computer's desktop onto the IWB’s surface
• The computer can be controlled by users using users a pen or a finger
• The user can write on the IWB’s surface
• An IWB allows anything everything written on it
• Can use any application that runs on a computer
Section 8
Output Devices
(13)
14. [G] E
(44)
15. [T]
(45)
16. [T]
(47)
18. [T]
• A large number of tiny mirrors are used.
• The mirrors form a grid
• Each mirror creates one pixel in the image
• Mirrors can tilt away from or towards the light source
• The mirrors reflect the light towards a lens
• A color is produced using a color wheel
• Can be used to display images on a wall
(48)
19. [T]
• They use high powered lasers, that are controlled by computers, to cut
materials for industrial applications
• They make clean and precise cuts.
• They are very fast which increases their efficiency.
• Designs to be cut are first created using a software and then they are sent to a
3D cutter that builds the design
• 3D laser cutters recognize all x-y-z directions to make complex shapes
• They can cut crystal, metal, wood, and glass.
Section 9
Sensors
(49)
20. [T]
(a) • Sensors send information to the computer
• Information converted to a digital signal by an ADC
• Data compared to stored data in computer memory
• If it is identified as a drip in the outer pipe …
• … A signal is sent out by the computer (to the actuators)
• Use of DAC to convert signal to analogue
• Actuator/motor used to close valve in the inner pipe
• Message sent to screen in control room/alarm sounds
(b) • Computer response is much faster than a human
• 24/7 monitoring is possible/no breaks taken
• A human may miss “signs of leakage”/computer doesn’t get tired
• No/removes human errors (therefore safer)
(120)
21. [T]
(a) infrared sensor
(b) Type of integrated circuit that is contained on a single chip.
(c) • Sensor sends data/signal to microprocessor
• Data/Signal is converted from analogue data to digital data (using ADC)
• Value to compared to stored value(s)
• If value is outside range / matches …
• microprocessor sends signal to switch lights on
• … actuator used to switch light on/off
• … timer is set for 2 minutes
• Every time movement is detected the timer is reset
• When timer reaches 0/120/times out microprocessor sends signal to switch
lights off
• Process is continuous
Section 10
Primary Storage
(14)
22. [G] B & C
(51)
23. [T]
• ROM is non-volatile, RAM is volatile
• ROM is semi-permanent, RAM is temporary
• ROM has a smaller capacity than RAM
• Data can be written to and read from to RAM, ROM can only be read from
(53)
24. [T]
(a) Primary storage refers to the main memory of a computer. Primary storage is
directly accessed by CPU.
(b) RAM and ROM
(c) Secondary storage refers to all non-volatile storage devices located inside the
computer. Secondary storage is not directly accessed by the CPU.
(d) HHD and SSD
(e) Offline storage refers to any removable storage medium that must be
physically inserted into a system before using it.
(f) • CDs, DVDs, DVD-RAMs, Blu-ray disks (optical)
• USB flash memories (solid state)
• Removable (external) hard disk drives
(125)
25. [T]
• The data currently running
• The software currently running
• The instructions currently running
• The parts of the operating system currently running
Section 11
Secondary Storage and Offline Storage
(58)
26. [T]
(a)
Primary storage refers to the main memory of a computer. Primary storage can be directly
accessed by the CPU.
Secondary storage refers to all non-volatile storage devices located inside the computer.
Secondary storage cannot be directly accessed by the CPU.
Offline storage refers to removable storage medium that must be physically inserted into a
system before it can be used
(b)
Section 13
Optical Storage
(15)
27. [G] E
(55)
28. [T]
Section 14
Solid-State Storage Media
(16)
29. [G] C
(57)
30. [T]
• SSDs are more expensive than HDDs per megabyte
• SSDs consume less power than HDDs
• SSDs have faster access speed at loading up and copying files
• SSDs make little to no noise (silent) whereas HDDs make spinning disc
sounds
• SSDs are lighter in weight
• SSDs generate less heat
• SSDs are usually removable while HHDs are not
• SSDs are more reliable and have a lower failure rate than HDDs, as HDDs
have moving parts
(126)
31. [T]
non-volatile
transistors
grid
electrons
Section 15
MAC Address
(122)
32. [T]
(a) The diagram shows:
• a hard drive
• the hard drive portioned in some way to create virtual memory
• RAM
• an indication of pages transferred between the RAM and the virtual memory
Section 16
MAC Address
(124)
33. [T]
(a) • Storage consisting of servers
• … that are often in a remote location
• … that are often maintained/backed up by a third-party company
• Storage that is normally accessed using a network (often the internet)
(b) • The hard drive is partitioned to create virtual memory
• When RAM is full
• … pages of data that are not required …
• … are transferred from RAM to virtual memory
• When the data is required again the pages are transferred back to RAM
Section 18
MAC Address
(17)
34. [G] A
(50)
35. [T]
• Media Access Control (MAC) address is a unique number that identifies a
network device such as interface card of a computer
• A MAC address allows all devices to uniquely identify themselves on a
computer network (such as the Internet)
• A MAC address consists of 48 bits that are represented as 12 hexadecimal digits
in the form: MM – MM – MM – SS – SS – SS or MM:MM:MM:SS:SS:SS ,
where the first six hex digits represent the identification number of the
manufacturer of the device and the next six hex digits represent the serial
number of the device.
Section 19
IP Address
(18)
36. [G] A
(19)
37. [G] B
(119)
38. [T]
(a) • consists of values between 0-255 / 0-FFF
• values are separated by full stops / colons
• it is a unique address
• can be static or dynamic
• can be public or private
• can be IPv4 / have four groups of digits
• can be IPv6 / have eight groups of digits
• in IPv6 :: can replace groups of zeros.
(b) router
Chapter 4
Software
Section 1
Types of Software
(20)
1. [G] E
(21)
2. [G] B
Section 2
The Operating System
(65)
3. [T]
(a) • Prevents typing mistakes
• No need to type long and complex instructions
• User friendly, easier to select commands
• Faster than typing instructions
(b) • GUI uses pointing devices, windows, and icons (such as a mouse)
• Keyboards are used with command line interfaces
(c)
• Provides a user interface • Memory management
• Loads and runs software • Multiprogramming
• Handles input and output • Provides additional utility
• Processor management programs
• Spooling • Maintains user accounts
• Supports the user with error • Maintains security (such as
passwords and usernames)
messages
• Multitasking
• Handles interrupts
• File Management tasks such as saving loading, deleting, printing, renaming,
and copying files
• Controls the peripherals such as printers and disk drives
Section 4
Interrupts
(22)
4. [G] C
(67)
5. [T]
(a) – A signal sent from a device or software
– Requests processor time
– Interrupts have different priorities
(b) – Used to attend to certain tasks
– Used to make sure that high priority tasks are handled immediately
– The interrupt tells the CPU that its attention is needed
– A signal can be sent from a peripheral or internal device
– A signal can be sent from software
– The interrupt will cause the OS to pause current running process
– The OS/CPU/ISR will handle the interrupt
– They have different levels of priority
– Once interrupt is handled, the previous process is continued
– It enables multi-tasking to be carried out on a computer
(c) – Keyboard
– Printer
– Mouse
Section 5
Programming Languages
(23)
6. [G] B
(24)
7. [G] C
(127)
8. [T]
• syntax
• high-level
• translator
• machine code
• assembly
• low-level
(128)
9. [T]
(a) • it is easier/quicker to read, write, and understand
• it is easier/quicker to debug
• code is portable.
(b) • not able to directly manipulate the hardware
• may need to wait for translation before running
• program may be less efficient.
Section 7
Compilers and Interpreters
(70)
10. [T]
Section 8
Advantages and Disadvantages of Compilers and Interpreters
(94)
11. [T]
(a) B
(b) • Easier to understand and write for programmers as it is closer to
English
• Easier to debug
• Easier to test
• No need to understand architecture of a computer
• One-to-many when writing commands
• Not machine-specific, i.e. portable
(c) • Can address memory addresses directly
• Faster execution
• Code requires less storage
• No need for compilers or interpreters
(d) • Compiler produces object code whereas interpreter does not produce
object code
• Compiler translates whole program in one run whereas interpreter
translates and executes line at a time
• Compiler shows list of all errors whereas interpreter produces error
message each time an error encountered
• Compiler produces "stand alone code" whereas interpreter does not
• Compilation process is slow but resultant code runs quickly whereas
interpreted code runs slowly
Section 9
Sensors
(129)
12. [T]
(a) Software that provides useful functions for a programmer writing a computer
program
(b)
• Code editor
• Run-time environment
• Translator
• Error diagnostics
• Auto-completion
• Auto-correction
Chapter 5
The Internet
Section 4
Web Browser
(25)
1. [G] B
(73)
2. [T]
(a) – Hypertext markup language
– Used to create webpages
– Translated by a browser to display the content of webpages
– Uses tags to display/format content
(b)
Structure Presentation
• Instructs how the layout of the • Instructs how the content will be
content is displayed formatted
• (Mark-up) tags are used to define • Presentation is often stored in a file
the structure of the document called a CSS
• The CSS in then linked to the HTML
document to implement the
presentation requirements
• In a HTML document structure and presentation are often kept separate
• By keeping the presentation separate it is easier to update color/font
• Presentation and formatting can also be included within the tags
(c) – Displays web page
– Displays HTML files
– Interprets embedded scripts such as JavaScript
– Supports functions such as bookmarks and history
– Identifies protocols, such as HTTP and SSL
(74)
3. [T]
– Provides access to the internet – Provides access to email
– Gives users an IP address – Determines bandwidth
– Usually charge a monthly fee – Supports domain names
– Monitor usage – Provides online data storage
Section 6
Cookies
(26)
4. [G] E
Section 9
Cyberattacks
(77)
5. [T]
Method to protect the data
Security risk Definition Effect
(how to remove the risk)
- Firewall
- Identity theft or gaining - Strong passwords
The act of gaining illegal personal information - Anti-hacking software.
Hacking
access to a computer system - Deletion (amendment) (encryption will not forbid
of data the hacker from deleting the
data)
- Cause the computer to - Antivirus
crash, malfunction, run - Use software form known
slower source only
Program (software) that can - Can delete files (fill up - Don’t open emails
Viruses
replicate (copy itself) hard drive with data) attachments from unknown
- Can corrupt files senders (backing up won’t
protect the data if the virus
was copied)
- Creator sends fake email - The sender may gain - ISPs to filter phishing
pretending to be from a access to personal emails
well-known company… (financial) data - User should be careful when
Phishing - As soon as recipient
- Fraud or identity theft opening emails
opens/clicks on link in the
email, users is directed to
a fake website without
their knowledge
Method to protect the data
Security risk Definition Effect
(how to remove the risk)
- The creator can gain - Use of anti-spyware that
Malicious code installed on the
access to personal identify and remove the
hard drive of a user’s computer
(financial) data pharming code
or on actual web server to
Pharming - Fraud or identity theft - Only trust secure websites,
redirect a user to a fake
e.g. look for https
website without user’s
- Check the URL matches the
knowledge
intended site
- Steal user’s internet - Use of wired equivalent
The act of locating and using allocation by privacy
wireless internet connections downloading large - Set a complex passwords
War-driving illegally (it requires a laptop, documents - Use of firewalls
wireless network card and an - Hack into a Wi-Fi
antenna) network and steal
username…
- Creator can access all - Use of anti-spyware
A program that collects the typed data - Use of mouse to write the
information by monitoring - The program is able to password
Spyware
key presses on the keyboard install other spyware, - Use data entry methods
Key-logging
and send it to the person who read cookie, and such as drop-down boxes
sends the program (spyware) change the default
user’s browser
Section 10
Cybersecurity
(27)
6. [G] D
(28)
7. [G] C
(82)
8. [T]
Text based password
• Limited number of characters can be typed using the keyboard.
• Can be set and changed by the user
Biometric password
• Use physical measurements such as a fingerprint
• Input is compared to a previously stored human measurement
Difference
• Text based passwords are weaker than biometric passwords
• Biometric passwords are unique to a person. They cannot be hacked or shared.
(83)
9. [T]
– Suitable biometric device: retina scanner, voice recognition, fingerprint
scanner, or face recognition
– Sensors in biometric devices read input from users
– Input is converted from analogue to digital using an ADC
– Input is sent to the microprocessor
– Input is compared to stored data
– If input matches stored data, a user can enter
– If input does not match stored data, a user is declined entry
– Alert is sent to security staff
(86)
10. [T]
(a) SSL protocol
– uses encryption
– encryption is asymmetric / symmetric / both
– makes use of public and private keys
– data are meaningless without decryption key if intercepted
Firewall
– helps prevent unauthorized access
– checks that data meets criteria
– acts as a filter for incoming and outgoing data by blocking
unacceptable data
(b) Encrypt the data
… so it cannot be read by those not allowed to see it
Password protected (including biometrics passwords)
… to help prevent unauthorized access
Virus checking software
… helps prevent data corruption or deletion
… identifies and removes a virus in the system
… scans a system for presence of viruses
Spyware checking software
… helps prevent data being stolen/copied/logged
… scans a system for spyware
Drop-down input methods
… to reduce risk of spyware and keylogging
Physical method (locked doors, CCTV timeout, auto log-off)
… to help prevent unauthorized access
Network policies
… to inform users how to be vigilant
Access rights
… allows users access to data they are allowed to see
… prevents users from accessing data that they are not allowed to see
(87)
11. [T]
(a) – Login web pages are usually designed and implemented to be used
over a secure communication protocol known as HTTPS.
– Some banking systems ask customers to key in parts of their password
using drop-down boxes. This is an attempt to prevent spyware/key-
logging software.
– Users may be asked to input three random numbers
– Some banks enforce using the banks’ navigation tools instead of the
one supported by the browser.
(b) – Hackers get part of the password only
– Can ask for different characters/combinations each time
– Helps to defeat spyware
(c)
– PIN – Date of birth
– Name/user name – Email address
– Date last logged on – Recent activities
– Memorable word/phrase – Telephone number
– Memorable personal data – Customer number
(e.g. Mother’s maiden name) – Account number
(24)
12. [G] D
Chapter 6
Automated and Emerging Technologies
Section 2
Robotics
(130)
1. [T]
(a) • It has electrical components.
• It is programmable.
(b) • more efficient than a human
• more accurate than a human
• can lift larger and heavier equipment than a human
• can replace humans working in a dangerous environment
• reduces running costs, such as wages and overheads
• can produce consistent results/output
• can work 24 hours a day (do not need to take breaks)
Section 3
Artificial Intelligence
(131)
2. [T]
(a) • Collecting data
• Stores rules for using the data
• The ability to reason
• The ability to learn
• The ability to adapt
• The ability to change its own rules
• The ability to change its own data
(b) • Use machine learning algorithms …
• … to adapt its behaviour/rules/data
• Collects data about where it has been …
• … to make sure it does not repeat the same route
• Collect data about common obstacles/problems …
• … so, it knows how to react next time
• Store successful actions…
• …so, it knows what is most likely to work next time
(132)
3. [T]
(a) • It needs facts to generate the rules to make the decisions (The data it contains
is essential to the decision making process)
(b) • Rule base
• Inference engine
• Interface
(c) When a program has the ability to (automatically) adapt to its own processes and/or
data
Chapter 7
Algorithm Design and Problem Solving
Section 3
Structure Diagrams
(135)
1. [T]
Section 4
Flowcharts
(88)
2. [T]
negcount poscount neg pos zero count X negavge posavge
0 0 0 0 0 1 0
0 0 0 0 1 2 3
0 1 0 3 1 3 5
0 2 0 8 1 4 6
0 3 0 14 1 5 -4
1 3 -4 14 1 6 -1
2 3 -5 14 1 7 0
2 3 -5 14 2 8 0
2 3 -5 14 3 9 -4
3 3 -9 14 3 10 10
3 4 -9 24 3 11 stop -3 6
(89)
3. [T]
(139)
4. [T]
(a)
(b) • Use another counter and initialise to zero before looping
• Increment this counter when the number is less than zero
• Output this counter at the end
Section 5
Pseudocode
(29)
5. [G] D
(30)
6. [G] D
(92)
7. [T]
(a) total ← 0
FOR j ← 1 to 100
total = total + scores[j]
NEXT j
OUTPUT total
(b) Solution 1 Solution 2
total ← 0 total = 0
j ← 0 j = 0
WHILE j < 101 (or j <= 100) DO REPEAT
total ← total + scores[j] j = j + 1
j ← j + 1 total = total + scores[j]
ENDWHILE UNTIL j = 100
OUTPUT total OUTPUT total
(95)
8. [T]
(a) FOR j ← 1 to 1000
INPUT numbers[j]
NEXT j
(b) Solution 1 Solution 2
j ← 0 j = 0
WHILE j < 1001 (or j <= 1000) DO REPEAT
INPUT numbers[j] j = j + 1
ENDWHILE INPUT numbers[j]
UNTIL j = 1000
(93)
9. [T]
a. REPEAT…UNTIL
b. CASE…OF…OTHERWISE…ENDCASE
c. FOR…TO…NEXT
d. IF…THEN…ELSE…ENDIF
(137)
10. [T]
(a)
(b) total ← 0
FOR index ← 1 TO 50
total ← total + Number[index]
NEXT index
average ← total / 50
OUTPUT "The average is ", average
Section 7
Standard Methods of Solution
(134)
13. [T]
(a) Validation checks are used to test if the data entered is possible or reasonable.
Verification checks are used to test if the data input is the same as the data that was
intended to be input.
(b) Validation checks examples
• A range check tests that data entered fits within specified values.
• A length check tests that data entered has a specified number of characters.
• A type check tests that data entered is of a specific data type (integer, number,
string)
• A presence check tests that data is entered and not left empty.
• A format check tests that data entered has a specific format
Section 8
Validation Checks
(31)
14. [G] B
Section 10
Test Data
(96)
15. [T]
(a) Normal data: Data that the program is designed to handle. It is used to see if
the actual results are the same as the expected result(s).
Extreme data: the largest and smallest values that normal data can take; valid
data at the limits of acceptability. It can be applied on both numeric and
string values.
Abnormal (Erroneous) data: The program must not crash and should not
give wrong results; it should print or display error messages.
(b) (i) 3, 9, 11
(ii) 1, 12
(iii) 0, 13, -1
(138)
16. [T]
10.00
Boundary / abnormal data
The price should be rejected as the value is out of range
9.99
Boundary / extreme / normal data
The price should be accepted as the value is within normal range
ten
Abnormal data
Input should be rejected as the value is wrong type
Section 12
Test Data
(32)
17. [G] A
(136)
18. [T]
(a) • Line 2 should read: WHILE number <> 999 DO
• Line 3 should read: IF number >= 100 THEN
• INPUT number is missing from inside the loop, add INPUT number between line 5
and 6
• Line 7 should be removed.
(b) The test should be: IF Number >= 100 AND Number <= 200
(140)
19. [T]
• Line 4: WHILE Number <= 99 OR Number >= 1001
• Line 7: Num[Index] ← Number
• Line 9: NEXT Index
• Line 10: PRINT Count
(141)
20. [T]
(a) • Line 5 OUTPUT should be INPUT
• Line 6 UsefulEnergy should be UsefulEnergyOut
• Line 11 UNTIL TotalEnergyIn <> -1 OR UsefulEnergyOut <> -1 should
be UNTIL TotalEnergyIn = -1 OR UsefulEnergyOut = -1
(b) IF Efficiency >= 92 THEN
OUTPUT "A-rated"
ENDIF
Section 13
Writing and Amending Algorithms
(144)
21. [T]
// Declaration of variables and constants
(145)
22. [T]
// meaningful identifier names and appropriate data structures
// (variables, constants and the given arrays)
// to store all the data required
CONSTANT Distinction = 70
CONSTANT Merit = 55
CONSTANT Pass = 40
// initialisation processes for this scenario, initialising the running totals
// used for grades and combined totals
DistinctionNo ← 0
MeritNo ← 0
PassNo ← 0
FailNo ← 0
(146)
23. [T]
// meaningful identifier names and appropriate data structures to store
// the data required
DECLARE TeamCounter : INTEGER
DECLARE MatchCounter : INTEGER
DECLARE TeamPoints : INTEGER
DECLARE AwayWinNo : INTEGER
DECLARE HomeWinNo : INTEGER
DECLARE DrawNo : INTEGER
DECLARE LostNo : INTEGER
DECLARE HighestPoints : INTEGER
DECLARE LowestPoints : INTEGER
DECLARE TopTeam : INTEGER
DECLARE BottomTeam : INTEGER
CONSTANT AwayWin ← 3
CONSTANT HomeWin ← 2
CONSTANT Draw ← 1
CONSTANT Lost ← 0
Section 8
Arrays
(98)
2. [T] D
Section 9
String Handling
(151)
3. [T]
(a) DECLARE X : STRING
DECLARE Y : INTEGER
DECLARE Z : INTEGER
(b) (i) X ← "Programming is fun"
(ii) OUTPUT Length(X)
(iii) Y ← 16
Z ← 3
OUTPUT SubString(X, Y, Z)
(152)
4. [T]
Section 10
Subroutines: Functions and Procedures
(150)
5. [T] C
(153)
6. [T] (a) local (b) global
(154)
7. [T]
(a) i. FUNCTION Same(A : INTEGER, B : REAL) RETURNS BOOLEAN
IF A = ROUND(B,0) THEN
RETURN TRUE
ELSE
RETURN FALSE
ENDIF
ENDFUNCTION
ii. Z ← Same(X,Y)
Section 12
File Handling
(147)
8. [T]
• Data is not lost when the computer is switched off // data is stored permanently
• Data can be used by more than one program or reused when a program is run again
• Data can be backed up or archived
• Data can be transported from one place / system to another.
(149)
9. [T]
(a) open write
(b) • before trying to open the file
• check the file exists
• if the file does not exist, then output a suitable error message
Chapter 9
Databases
Section 2
Records, Fields, and Field Properties
(33)
1. [G] C
Section 5
Queries
(101)
2. [T]
(a) 9
(b) 6
(c) Ref no
(d) Sao Paulo, New York
(e) Delhi, Mumbai, New York, Tokyo (in this order)
(102)
3. [T]
(a) (i) 9
(ii) 7
(b) OR, CO, NJ, AK, NV (in any order)
(c)
Field: Ref Name of state Area Density Travel time to work
Table: USA Stats USA Stats USA Stats USA Stats USA Stats
Sort:
Show:
Criteria: >100 000 <25
Or:
(155)
4. [T]
(a)
(b) SELECT CatNo, Title
FROM 2018MOV
WHERE Genre1 = "Comedy";
(156)
5. [T]
(a)
• length check
• type check
• presence check
• format check
(b) 03 Nov Acoustic Evening
Chapter 10
Logic Gates
Section 3
Truth Tables
(34)
1. [G] NOR
(105)
2. [T]
(a) (i)
WORKING SPACE
0 0 1 1 0 1
0 1 1 0 0 1
1 0 0 1 0 1
1 1 0 0 1 0
(ii) NAND
(b)
WORKING SPACE
0 0 0 1 0 0 0
0 0 1 1 0 0 0
0 1 0 0 0 0 0
0 1 1 0 1 0 1
1 0 0 1 0 1 1
1 0 1 1 0 1 1
1 1 0 0 0 0 0
1 1 1 0 1 0 1
(106)
3. [T]
(a)
(b)
WORKING SPACE
0 0 0 1 1 0 0 0
0 0 1 1 0 0 0 0
0 1 0 0 1 0 1 1
0 1 1 0 0 0 0 0
1 0 0 1 1 1 0 1
1 0 1 1 0 1 0 1
1 1 0 0 1 0 1 1
1 1 1 0 0 0 0 0
(c)
A B X
0 0 0
0 1 1
1 0 1
1 1 0
Section 6
Solving Problems Involving Logic Expressions
(52)
4. [T]
Section 7
Solve Problems Involving Logic Circuits
(35)
5. [G] Z = (A NAND B) OR (B NOR C)
Section 8
Solving Problems Involving Truth Tables
(158)
6. [T]
(a)