0% found this document useful (0 votes)
10 views16 pages

CAPE Computer Science 2023 Unit 1 Paper 2

The document provides an overview of computer memory types, including ROM and RAM, as well as the function of surge protectors and voltage regulators. It discusses the roles of supercomputers and microcomputers, highlights the importance of displays and peripherals for gaming, and outlines basic programming concepts such as algorithms, code translation, and error detection. Additionally, it includes examples of code structure, logic errors, and a simple function for calculating the sum of an array.

Uploaded by

Kimk
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)
10 views16 pages

CAPE Computer Science 2023 Unit 1 Paper 2

The document provides an overview of computer memory types, including ROM and RAM, as well as the function of surge protectors and voltage regulators. It discusses the roles of supercomputers and microcomputers, highlights the importance of displays and peripherals for gaming, and outlines basic programming concepts such as algorithms, code translation, and error detection. Additionally, it includes examples of code structure, logic errors, and a simple function for calculating the sum of an array.

Uploaded by

Kimk
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/ 16

ROM is read only memory used to permanently

store data, while RAM is random access


memory which is volatile and temporarily stores
data

A surge protector is a curcuit that protects your


device from voltage spike, ensuring the longevity
of your device and its battery.
A voltage regulator ensure that constant and
stable level of voltage is being sent to your
device.
A supercomputer are devices that are use for
high-performing tasks and calculations such
as for weather forecating, nuclear research.

A microcomputer in a personaly computer


used by a single user to complete more
simpler day to day tasks

Display (Monitor)
A high-quality display is crucial for an immersive
gaming experience.

Peripherals like Keyboard and mouse


While not part of the PC itself, the right peripherals
can improve your gaming experience.

Memory (RAM)
RAM allows the computer to store and quickly access
data that’s actively being used by the system.
Fetch -- the control unit get the instructions from
main memory and sends it to the CPU
Decode -- The CU breaks the instruction n down into
parts; opcode and operands
Execute -- the ALU does any logical or arithmetic
operations and the result is stored in a register or
memory
A multiplexer is a digital switch that selects one of
many input signals by a select line and forwards it
to a single output line.
5.5 is positive ~ sign = 0
exponent = 3 = 011
mantissa ~ 5.50 = 101.10
move decimal point 3 places to the left
since the exponent is 3
= 0.10110 ~ mantissa

togeher = 0 011 10110

-11 = 00001011
flip = 11110100
add 1 = 11110101
Top-Down: Breaks a big problem into smaller parts.

Bottom-Up: Starts with the smallest component and


builds a solution by combining them to form a larger
system.

Clearly understand and state the problem


that needs to be solved.

Break the problem into smaller, manageable


parts, and identify the objectives, inputs,
outputs, and any constraints.

Coming up with multiple solutions and


choosing the best one
Translate/ write the code into a programming
language and check if it works correctly.

bill = 0, menuOption = 0, numOfMeals = 0,


START
Print "Please enter choice: 1-Jam, 2-Bar, 3-Tri, 0-exit"
Read menuOption
while (choice <> 0) do
if (choice =1) then
bill = bill + (12 * 1.04 )
numOfMeals = numOfMeals + 1
if (choice =2) then
bill = bill + (10 * 1.03 )
if (choice =3) then
bill = bill + (8 * 1.01 )
numOfMeals = numOfMeals + 1
Print "Please enter choice: 1-Jam, 2-Bar, 3-Tri, 0-exit"
Read menuOption
endwhile
Algorithm 1 - because it depends on the value of A
to stop

When x reaches 15
2 wrong sign used while i <= 14
3 assignment wrong cube= i*i*i

5 wrong count i = i+2


Translation
Compiler -- Translates the entire code at once before execution
Interpreter -- Translates and executes code line-by-line

Output
Compiler -- Generates an executable file
Interpreter Does not produce a separate file

Error Detection
Compiler -- Shows all errors after compiling
Interpreter -- Stops after the first error

Assembly changes the high-level code into


low-level machine code that a computer can
understand. Linking then joins this machine code
with other needed parts, like libraries, to make a
full program. This lets the same code run on
different computers if the right tools are used.
struct customer {
int custID;
float custbal;
}

struct customer Andrew;


Andrew.custID = 1230
Andrew.custBal = 33.55
scanf ("%f", $p);
Andrew.Bal = Andrew.bal - (1.09 * p)
A mistake in the logic or meaning of the code.

The code has correct syntax, but produces wrong or


unexpected results

a watch is a tool used to monitor the value of


variables as the program runs

int arraySum (int arr[]), int size) {


int c = 0, sum = 0;
for (c=0; c<size; c++)
{
if (arr[c] <= 50)
sum = sum+arr[c];
}
return sum;
}
5 5 6
4 5 10
3 5 13
2 5 15
1 5 16

You might also like