Font size
WorksheetsCS Prelim I
Total questions: 28
Worksheet time: 20mins
State the standard algorithm used in a program above?
Traversing an array
Input Validation
Running Total
Variable Assignment
There are 20 pupils in N5 Computing class. The teacher wants to use a loop to enter the pupils' marks into a program. State the type of loop that the teacher would use and explain why.
Fixed loop, because the teacher would type only 20 marks for 20 pupils in his class.
Conditional loop, because the Teacher will finish typing the marks in after the last pupil.
Fixed loop because it will repeat the code only for a certain amount of time.
Conditional loop because the code will be repeated until the condition is met.
Explain what is a wireframe used in program design?
The wireframe shows the user how the program might look at the end of the process.
It is used to plan the location of elements/objects used and the overall layout of the user interface.
Software developers often have to return to the implementation stage of an iterative development process following the testing stage. Explain why this is.
Correct any errors encountered and identified during the testing stage and modify the code accordingly.
To add extra features into the code which were proposed to be added after the test runs.
In case of any errors.
To make changes.
Explain how a bit mapped graphic is saved in computer's memory?
Bit-mapped graphics are stored in a computer's memory as a map of the grid.
Each grid is called a pixel, which is represented by the binary value stored as 1s and 0s.
Every pixel has a binary value assigned, which represents the colour it holds.
Map of pixels with bits.
State the part of the processor that temporarly stores pupils' grade.
Registers
Arithmetic and Logic Unit
Control Unit
Data Bus
State the part of the processor that calculates the average grade.
Registers
Arithmetic and Logic Unit
Control Unit
Address Bus
When executing the program it is translated into binary. Why does a high-level language need to be translated into binary?
A high-level language is a language used and recognized by humans.
The program is translated into machine code for the computer to understand the code, as the only values it can recognize are 1s and 0s.
It is the only thing computer understands.
Computer only read machine code.
Describe one advantage of using an interpreter and one advantage of using a compiler when translating code.
The interpreter translates one line of code at a time, and as soon as it encounters the error - it is communicated to the user.
The interpreter translates one line of code a time and communicates the presence of an error as soon as it is encountered allowing for the quick fix of errors and preventing replicating them.
The compiler runs faster than the translator as it only translates the program once and saves it as an object code.
When using compiler, the code itself is not needed to run the program because the translation of code and execution code are two separate processes.
Explain how a bit-mapped graphic is saved in the computer's memory.
Bit mapped graphics are being stored in a computer's memory as a map of grid.
Each grid is called pixel which is represented by the binary value stored as a 1s and 0s.
Every pixel has a binary value assigned which represent the colour it holds.
Map of pixels with bits in it.
Software developers often have to return to the implementation stage of an iterative development process following the testing stage. Explain why this is.
Correct any errors encountered and identified during the testing stage and modify the code accordingly.
To add extra features into the code which were proposed to be added after the test runs.
Explain what wireframe is used for in program design.
The wireframe is used to show the user how the program might look at the end of the process.
It is used to plan the location of elements/objects used and the overall layout of the user interface.
Prototyping
State the design technique used?
Flowchart
Structure Diagram
Pseudocode
An array
Explain how a variable is different than an array?
A variable is a data structure which holds only one data item of a specific data type.
An array is also a data structure, but it holds multiple items, which need to be of the same data type.
Which answer show correct array declaration for the names of 15 customers?
Dim Customers(14) As String
Dim Customers As String
Dim Customers (14) As Integer
Dim Customers(15) As String
The integer data type is used to store values of purchased tickets in variable tickets. Explain why integer data type is being used?
The integer is data type used to store whole numbers only.
Purchased tickets have to be counted and stored as a whole numbers.
It is impossible to purchase 0.5 of a ticket therefore the value for this variable cannot be stored as a decimal number.
Because it's full number.
Each of the letters of the message CLOSED NOW will be stored as an ASCII character. Calculate the number of bits required to store this message.
9 x 8 = 72 bits
10 x 8 = 80 bits
A test data which is outside of the values accepted by the program is called?
Exceptional
Extreme
Execusion
Syntax
Program accepts the numbers between 0 and 9 including both numbers. What type of test data is number 6?
Normal
Extreme
Execution
Exceptional
Program accepts the numbers between 0 and 9 including both numbers. What type of test data is number 9?
Normal
Extreme
Execution
Exceptional
Program accepts the numbers between 0 and 9 including both numbers. What type of test data is number -2?
Normal
Extreme
Execution
Exceptional
When testing the program which accepts string data , “44” is entered. As expected, an error message appears. Explain what type of error is this and why?
Execution
Syntax
The number passed into the program is outside of acceptable values.
The variable which stores text is declared as a string , therefore if the program receives the number 3 (integer data type) instead of the expected string data type it causes the program to crash.
State what design technique has been used?
Pseudocode
Flowchart
Structure Diagram
String Concatenation
State two programming constructs which are used in step 3.1
String Concatenation
Variables
An Array
Input Validation
Which one IS NOT a data type?
String
Integer
Char
Array
Which one IS NOT a data structure?
Running total
Array
Variable
Integer
Which one IS NOT a standard algorithm?
Traversing an array
Running Total
Input Validation
String Concatenation
State the name of a graphic object and select its attributes:
Straight Line.
Line thickness
Line colour
X,Y coordinates
Ellipse
Fill colour,
Outline colour
X,Y coordinates
