Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

The City School

Computing End of Year Examination – May 2023 Class 8


Mark Scheme

Section A (Objective)
Q 1. For each question below there are four options A, B, C, and D. Circle the best Option.
[6]
(a) GPIO to
A connect sensors, LEDs, Motors
B connect Audio devices only
C connect Keyboard, Mouse and peripherals
D connect monitor
(b) Rasbian is
A An Operating system
B An Application Software
C Graphic Software
D Utility Software
(c) Python can run on
A Mac
B Windows
C Unix
D All of the above
(d) Which statement is a programming conditional statement that, if proved true,
performs a function or displays information?

A If Statement
B Else Statement
C Loop
D None of the above
(e) To execute the program in Visual Basic we use

A F5

B F3

C Ctrl+C

D F2

(f)
If the user enter value 5 in number value what would be the output?
A Congratulations! You win

B Program will stop and shows nothing

C Program will show an error

D Program will show 7

Q 2. For each question below there are two options True and False. Circle the correct
answer. [7]

(a) In Python, IDLE stands for Individual Development Learning Environment.


A True B False
(b) In Visual Studio a Button control is used to generate a click event.
A True B False
(c) A good user interface has clumsy layout.
A True B False
(d) A For loop is used for repeating over a sequence.
A True B False
(e) In Python, a function is defined using the def keyword.
A True B False
(f) GPIO pins can simply be used to turn devices off
A True B False
(g) Raspbian is a Debian-based (32 bit) computer system for Raspberry.
A True B False

Q 3. Fill in the blanks. [7]

(a) AND, OR, NOT, XOR are Logical Operators.

(b) Private variables are variables that are accessible only to a certain part of the
program or code.

(c) Loop is a sequence of instructions that is repeated until a certain condition is


reached.

(d) Function is a type of procedure that returns a value that is passed on to the main
procedure to finish execution.

(e) A servo motor is an electrical device that can push or rotate an object with great
precision.

(f) SONAR is an acronym for Sound Navigation & Ranging.

(g) Python is a high-level programming language designed to be easy to read and simple
to implement
Section B (Subjective)

Q4 Answer the following questions.

(a) The user interface is the graphical layout of an application. A good interface makes it
easy for users to tell the computer.
Explain any three characteristics of a good Interface. [3]

Any Three

Clear
A clear interface helps prevent user errors, makes important information obvious, and
contributes to ease of learning and use.
Consistent
A clear interface helps prevent user errors, makes important information obvious, and
contributes to ease of learning and use.
Simple
The best interface designs are simple. Simple designs are easy to learn and to use and
give the interface a consistent look.
Direct
Users must see the visible cause-and-effect relationship between the actions they take and
the objects on the screen.
Responsive
Responsive also means the interface provides some form of feedback

Attractive
Every visual element that appears on the screen potentially competes for the user’s
attention.

(b) What is the output of the following program? [2]

Public Class Form1


Private Sub Button1_Click(sender As object, e As EventArgs) Handles
Button1.Click
Dim number As integer = 5
If number > 10 Then
MessageBox.Show(“The number is greater than 10”)
Else
MessageBox.Show(“The number is not greater than 10”)
Endif
End Sub
End Class

The number is not greater than 10.


(c) Explain the purpose of the following basic GUI Control in Visual Basic. [4]

It is used as a standard Windows Button. In most cases, the Button Control is used to generate
a click event.

It is used to display some informative text on the GUI which is not changed during runtime.

It is used to accept textual input from the user. The user can add strings, numerical values and
a combination of those.

Radio Button is one of the popular ways of limiting the user to pick just one option.

Q 5.
(a) The Raspberry Pi, a single-board computer (SBC), is a small credit card-sized
computing device that can be used for various purposes.
Describe Raspberry Pi Architecture. [3]

The Raspberry Pi has an ARM Architecture based Processor. With a high-speed


processor and 1 GB RAM, the PI can be used for many demanding projects like digital
image processing and many IoT and connected projects. The Raspberry Pi also consists
of a set of pins that allow it to communicate with other nearby electronic devices.

[award marks if having relevant jargon in the answer]

Q.5 (b) What is the role of logical operators in the conditional statement? Write down any 2
conditional statements using logical operators. [ _ /3]

Logical operators are used in conditional statements to evaluate multiple conditions and
determine whether a particular block of code should be executed. There are three main
logical operators in Visual Basic:

1. And: Evaluates to True if both conditions are True.


2. Or: Evaluates to True if at least one of the conditions is True.
3. Not: Negates the value of the condition, evaluating to True if the condition is False,
and False if the condition is True.

Example 1

If isWeekend = True And isSunny = True Then


Console.WriteLine("Let's go to the beach!")
Else
Console.WriteLine("Let's go to the movies.")

Example 2

If grade >= 60 Or attendance >= 80 Then


Console.WriteLine("Congratulations, you pass the class!")
Else
Console.WriteLine("Sorry, you failed the class.")
[1 mark for role and 1 mark for each example of conditional operator with logical operator]

Q.5 (c) Look at the picture below and label any three components [ __ /3]
A

E H
F G

A. GPIO Ports E. Micro USB Port


B. USB Ports F. HDMI Port
C. Memory Card Slot G. Camera Module
D. Ethernet Port H. Audio Jack

Q.6 (a) Ali installed LEDs using Raspberry Pi but it keeps on burning out. Why
do you think this was happening? [ __ /3]
It is happening because of the resistors. The resistor is a passive device that
controls or resists the flow of current to your device, for example if we don’t
use the resistor in the above experiment, the LED may allow too much current
to flow which can damage
both the LED and the Pi.
1 mark for resister (root cause of burnt)
2 marks for explanation
(b) The circuitry of LED blink is pretty simple, you just have to connect the electronic
component with raspberry pi properly as shown in the picture. Please mention the
names of the components attached. Write down the two features of GPIO pins in
Raspberry Pi. [3]

Four Components

The following components are required.

(a) 1 breadboard
(b) 1 LED
(c) 2 jumper wires
(d) 1 resistor: 220Ω/1KΩ

Any Two-point

1. GPIO pins can simply be used to turn devices on and off.


2. GPIO pins allow the Raspberry pi to be configured for different purposes, and interact
with different circuits.
3. It works with several types of electronic components, for example, motors, LEDs,
switches, etc.

[1 mark for components and 1 mark for each feature]

(c) Rabian is an Operating System for Raspberry Pi. Write down the three
responsibilities of an operating system in a Raspberry Pi? [3]

In a Raspberry Pi, the operating system is responsible for:

 Managing system resources, such as the CPU, memory, and storage.


 Providing a user interface, such as a desktop environment, for interacting with the
system.
 Running and managing applications, allowing multiple applications to run
simultaneously and sharing system resources between them.
 Providing a file system for organizing and storing data and files on the storage
device.
 Managing system security and providing access controls to prevent unauthorized
access to the system.
(d)
mport RPi.GPIO as gpio
import time as t
gpio.setmode(gpio.BCM)
gpio.setwarnings(False)
gpio.setup(18, gpio.BCM)
gpio.setup(23, gpio.OUT)
while True:
if gpio.input(18):
gpio.output(23,true)
t.sleep(1)
else:
gpio.output(23,false)

Please explain what is going to happen when the above code is executed. [3]

Used the conditional statements in while loop. According to the if condition, if the voltage is
detected on the GPIO18, then the Pi will turn on the LED, which is connected to GPIO23. The
voltages will be detected on GPIO18 when the button is pressed.

You might also like