Let’s create a scenario for a cat crossing the street!
Cat: “Hey, I’m gonna cross the street
Dog: “Wait”
Cat: “What?”
Dog: “Look both ways before you cross”
the cat looks left
the cat looks right
Cat: “Crossing now”
The cat crosses the street
Guided instruction to implement this scenario in Scratch
Open Scratch and create a new project.
Select the “urban” backdrop by clicking on the “Choose a backdrop from library” button below the stage and choosing the “urban” backdrop.
Add the “dog2” sprite by clicking on the “Choose a sprite from library” button below the stage, selecting the “Animals” category, and choosing the “dog2” sprite.
Resize both sprites to a size of 50 by clicking on the sprite and using the “Size” block in the sprite’s code.
Position the dog sprite on one side of the street and the cat sprite on the other side as shown in the image provided. You can drag the sprites to the desired positions.
Horizontally flip all costumes for the dog sprite so that it faces to the left. To do this, click on the dog sprite, go to the “Costumes” tab, select each costume, and use the “Flip horizontally” button.
Copy the first costume of the cat sprite and place it in the third position. To do this, click on the cat sprite, go to the “Costumes” tab, select the first costume, and click on the “Duplicate” button. Then drag the duplicated costume to the third position.
Horizontally flip the third costume of the cat sprite. To do this, click on the cat sprite, go to the “Costumes” tab, select the third costume, and use the “Flip horizontally” button.
Now you have set up the sprites and costumes for the cat crossing the street scenario in Scratch. You can continue by adding scripts to animate the sprites and make the cat look left and right before crossing the street.
SD Cards (Secure Digital Cards) are a popular form of portable flash memory storage because of it’s small size , speed and durability. It’s used widely in digital video/photography to store media, and as expansion storage for other smart devices including phones , tablets etc.
It was created by a group of companies and has now become a standard for portable data storage.
SD Card readers are devices that allow for SD Cards to be read by the computer system and can be internal (built into) or externally connected via USB ports.
Below: An external SD Card Reader with an inserted Micro SD Card
Below: An internal SD Card Reader built into the computer’s system unit.
Why are SD Card Readers needed?
Because of it’s widespread use, it has become desirable to include SD card readers in newer computer systems to facilitate easier data transfer from device to device.
A common task that a user would face would be copying their media from their digital camera to their pc. In the past, this meant that the user would have to install the camera’s software and drivers on the pc, then connect a cable from the camera to the pc to access the media.
This process changes when a sd card reader is built in or connected to a computer, the user simply removes the sd card from the digital camera and inserts it into the sd card reader, where the media is immediately accessible as using any other portable secondary storage device.
Screen sizes are measured along the diagonal of the screen and is usually quoted in inches. For example, a typical computer monitor or laptop screen may be 15” in size.
Resolution
Screen resolution refers to the quality and level of detail that can be displayed on the screen. The screen is made up of a matrix of individual dots that can be coloured differently. Each dot is know as a picture element or pixel for short.
Example of pixels. Shows a zoomed section of an image to demonstrate how it is made up of pixels.
Maximizing the number of dots in a unit area of the screen will result in a sharper image with more detail , or as we say, a higher resolution image.
A monitor’s screen resolution is denoted as horizontal pixels x vertical pixels. e.g 1920 * 1080
How does Size and Resolution relate to each other?
It’s possible for a monitor with large screen to have a small resolution, to the average person, the screen may display images which are blocky, where the pixels are discernable and the image is not smooth.
It’s also possible to have a very small screen have a high resolution, as in the case of a high end smartphone.
Size and resolution consideration depends on where the screen needed, for example, having a large screen with a low resolution at a train station or airport is feasible since a lot of people can easily view the screen at once , however , we do not require the need to display detailed images, just formatted text or cursive fonts.
On the other side of the spectrum, a graphic artist travelling on a long train ride may opt to get his/her/them/they/us work done on a portable tablet computer which has a small but very high resolution stylus touch screen to allow for fine and detailed designs to be viewed while being created.
When developing a solution to a problem in program code, we usually aim to write a bit of code that implements part of the solution and run it to see if works.
Bugs can start here, they manifest as errors that prevent your code from being compiled or executed out right, or produce incorrect results.
It’s important to note in our context that programs written in source code must be translated to machine code , which is directly executable by your computer’s CPU.
The translation can take place
with the entire file, that is, the entire source code compiled into executable code or
line by line, i.e a single line of source code is interpreted as machine code, then executed and so on.
Syntax , Logical and Runtime Errors
The errors or bugs experienced while we develop our code can be classified into three types:
Syntax – this is were the rules for structuring the code are broken, or not followed which prevents the translation process – this applies to both the compiler and interpreter which performs these tasks. The result of a syntax error is that the entire program cannot be executed. The programmer must fix the errors and try running the program again.
Logical – this is where the translation process completes successfully, but when the program is run it produces incorrect results or undesired behavior. After producing the logical error, the program continues to run indefinitely or until it stops by reaching the end of code produced by the programmer.
For example, let’s say we were developing a solution that would prompt the user to enter 2 numbers, and output the sum, the following are some logical errors:
if the user entered 5.1 and 5, and the program outputs 10, this is an incorrect result
if the user entered 5.1 and 5, and the program doesn’t output anything – this is incorrect behavior
if the user entered 5.1 and 5, and the program continues to prompt the user to enter another and another indefinitely.
Runtime – this is where the program halts abruptly during execution and stops running (sometimes called a crash). It definitely passed the translation process, and can be run successfully in most cases (with or without logical errors), however some cases of user input or abnormal conditions of the computer system , the program crashes. Some reasons include:
the program attempts to divide by 0,
the program tries to access a memory location that it is not allowed to by the operating system
the operating system runs out of resources to provide to the program.
Video
Teacher Demonstration In class: bugs in Flowgorithm
Instruction: Students are instructed to rewrite the instructions in a concise and precise manner with the expectation that the recipient of the instruction is motivated to achieve the goals of the instruction; i.e. the recipient understands the intent of the instructions and is not subject trivial misinterpretation which can lead to faults.
Moving From documenting an activity to solving problems
When solving a problem the following the steps to be followed:
Information gathering;
Brainstorming;
Identification of resources;
Evaluation of pros and cons of multiple solutions;
NB - not all ports are mentioned in this post e.g ps2, serial, parallel ports etc. This content focuses on the requirements of our NCSE ICT syllabus.
Computer Ports
Computer ports can be found on the system unit and serves as points of connection to various peripheral devices via wired cabled or wireless transmission media.
A view of a system unit’s ports is shown below:
Output Devices And Ports
Video output to a computer monitor (or any other visual display unit [VDU]) can be achieved by sending signals from the system unit’s graphics circuits via specific display port over a cable and to the monitor/screen.
Two types of video ports are VGA and HDMI
VGA – Video Graphics Array
This technology has been around since 1978 , and is essentially a chipset for graphical display. A VGA cable connects one end to the system unit’s VGA port and the other to a VGA port on the VDU (Projector, computer monitor, Smart TV, etc)
The system unit’s VGA port is shown below:
Below is an image showing the end of the cable VGA Cable which connects the VGA Port:
Below is an image shown how the cable is intended to be connected via the port for our VGA technology:
Characteristics of VGA Technology
VGA technology,
is affordable and the cheapest option. VGA only Devices are very cheap, as opposed to other devices that include HDMI etc.
is widespread, popular and can be easily found world wide
can display up to 256 colors
Displays a reliable resolution for most applications, however other technologies can display sharper and clearer images at high resolution.
HDMI – High Definition Multimedia Interface
This is an another output technology which outputs high quality , high resolution video and sound via HDMI ports and cables. One cable’s end connects to the System unit’s hdmi port and the other to a VDU which can also output sound.
An image is shown below of an HDMI Cable:
An image is shown below of an HDMI Cableport on a VDU:
Communication Ports
Communication Ports allow for computer networking.
Ethernet port (RJ45)
This is a very common standard of networking which uses a wired cable connected via and ethernet port. The ethernet cable can be used to connect 2 PCs, or a pc to network hardware, or even one network to the next.
An image of an ethernet cable with a RJ45 connector end is shown next to a laptop’s RJ45 connector(Right). (The port on the left on the laptop is a RJ11 Connector used for land line phone connection):
A special type of port , USB – Universal Serial Bus
USB technology was developed with the intention to connect many device types to the computer system and/or each other via USB Ports and Cables. E.g networking 2 computer systems, connecting to game consoles to each other for playing videogames etc.
Devices include input , output , external storage devices, communications devices and specialized devices.
Input devices
Keyboard, Mouse, Graphics tablets
Output
Printers,VDUs, Audio
External storage devices
Flash Drives, External Hard Drives
Communications devices
Wireless Networking, Wireless Modems
Specialized devices
Security dongles, Video Cameras, Audio equipment, Midi Keyboards and Controllers.
Fire wire
Firewire is a standard similar to USB that was developed to connect multiple device types to the computer system.
Below is an image of a firewire port:
A firewire cable end:
Internal Ports – SATA and IDE
Within the computer’s system unit various ports, connectors and cables are used to connect devices internally so that they can be manipulated by the computer system
Mass storage devices, such as optical disk drives and hard drives, are connected to the system using two types of technologies:
IDE – Integrated Drive Electronics
SATA – Serial Advanced Technology Attachment
IDE – Integrated Drive Electronics
This was an earlier technology which was created for mass storage via the device and a multi wired cable in the form of a ribbon. This method of data transfer uses “parallel communication”. (At this level we will not delve into what parallel communication is, more so that we note that it is a defining characteristic of the technology.)
An IDE Hard drive is shown below with a space of connection to the ribbon cable on the bottom left:
An IDE ribbon cable is shown below for connection to either the storage device or the computer system’s circuitry (motherboard):
An IDE Connector on the computer system’s circuitry (motherboard)
SATA – Serial Advanced Technology Attachment
SATA was meant to be a an improvement over IDE Technology. SATA connects mass storage device via SATA Ports and Cabling. This method of data transfer uses “parallel communication”. By the nature of SATA Technology’s design it’s cabling is less bulky than IDE and less expensive making it more popular. Data transfer is much faster as compared to IDE with SATA transferring approximately 45 times faster than IDE Technology.
Below is a picture of a SATA hard drive:
A SATA Data Cable
Below is an image of SATA Cables connected to the computer system’s circuitry (Motherboard)
UPDATES TO THIS POST
28th Sept 2022 – Added “Smart TV with a HDMI port” as an example for a VDU.
pen down
repeat 3
move 200 steps
repeat 2
turn right 120 degrees
move 200 steps
end repeat
repeat 2
turn left 120 degrees
move 200 steps
end repeat
turn right 120 degrees
end repeat
Draw the shapes from the following snippets of scratch code:
Exercise 1
pen down
repeat 4
move 100 steps
turn right 90 degrees
end repeat
Exercise 2
pen down
repeat 3
move 100 steps
turn right 120 degrees
end repeat
Exercise 3
pen down
repeat 3
move 200 steps
repeat 2
turn right 120 degrees
move 200 steps
end repeat
repeat 2
turn left 120 degrees
move 200 steps
end repeat
turn right 120 degrees
end repeat