Font size
WorksheetsPSPD REVISION
Total questions: 66
Worksheet time: 37mins
1. First generation language is also known as __________________.
Machine language
Symbolic language
Mnemonic language
Assembly language
Programming language is _____________________________
A process or person who writes the program.
A set of step-by-step instructions performed to solve a particular problem.
A planning process for a sequence of instruction to be executed by the computer.
A set of rules and reserved words that can be used to tell a computer what are the operations to be done.
What is the output based on the pseudo code given if the value for Quiz1=6, Quiz2=8 and Quiz3=10?
Start
Input Quiz1, Quiz2, Quiz3
Total = Quiz1 + Quiz2 + Quiz3
Result = Total / 3
Output Result
End
8
24
0
16
State the best output for ATM machine transaction system.
Choose language
Print receipt
Enter pin number
Enter amount of money to withdraw
If x=3, y=10, and z=2, find the value of W
W=((x*y)==(y/z))||((y==0)&&((x+z) !=y))
3
2
1
0
Based on the Figure below, determine the output if the input mark is 80
if (mark>80)
display result (“Congratulation!”)
else
display result (“Try Again”)
Try Again
Congratulation and Try Again
Congratulation!
Try Again!
The workers salary of an electronic factory are paid by the number of hours worked, which is RM 2.50 per hour. Total income earned will be cut by 10% for their contributions. Calculate the net income earned by an employee.
What are the inputs for the above problem?
RM 2.50 per hour
10% for their contribution
Electronics factory workers
The number of hours worked
“All the collection of information will be used into this phase to design a flowchart and pseudo code”
Which phase is involved in the statement?
Implement the algorithm
Design the algorithm to solve the problem
Maintain and update the program
Test and verify the completed program
As a payroll officer, you are required to calculate the salary of the workers. The salary include a basic salary and overtime payment. The overtime payment will be calculated based on the number of hours work, where 1 hour=RM20. Display the total salary of the workers.
What is the suitable formula that shows the process ?
Overtime=hour_work*20;
Salary=basic_salary+overtime;
Overtime=hour_work*20;
Salary=overtime;
Salary=basic_salary+overtime;
Salary=basic_salary+20;
Search the best answer to describe a compiler.
It can translate assembly language to machine language
It does a conversion line by line as the program is running
It is general purpose language providing very efficient execution
It coverts whole of a higher level program code into machine code in one step
Recognize the translator used to translate C++ into the machine language.
Compiler
Interpreter
Syntax
Assembler
There are ……………… phases in programming life cycle.
Six
Five
Seven
Eight
Which of the following is the CORRECT arrangement for maintenance of a program?
i. Adjustment
ii. Measurement
iii. Testing
iv. Replacement
ii, iii, iv and i
iv, i, iii and ii
iii, ii, i and iv
i, ii, iii and iv
Based on the statement below , identify the phase in problem solving concept.
“Process of entering data, program and instructions into the computer system using input devices”
Input
Process
Output
Planning
Based on the statement below, choose the correct phase involved in Programming Life Cycle.
· This stage is the general definition of the task
· It includes the specification of inputs and outputs, processing requirements, system constraints, and error handling methods
Specify the problem
Analyze the problem
Design the algorithm
Maintain and update the program
Identify THREE (3) major tasks in the phase Analyse the Problem
i. Review the requirements
ii. Meet with system analyst and users
iii. Identify input, processing, output and data components
iv. Coding a program involves translating the solution algorithm
i, ii and iii
i,ii and iv
i,iii and iv
ii,iii and iv
Among the list below, identify which is NOT involve in phase Maintain and Update the Program.
Measurement
Updating
Adjustment
Relocation
Consider the following codes:
Begin Line 1
sum = 0 Line 2
input num1, num2, num3 Line 3
sum = num1+num2 +num3 Line 4
Print “Your total is”, sum
End If num1 = 8, num2 = 7, num3 = 9; and the codes were executed as is what would be the result:
Your total is 24
Your total is sum
"Your total is", 24
"Your total is 24"
Which data type is used to store:
100
Integer
Double
Boolean
String
Which data type is used to store:
TRUE
Boolean
Double
String
Integer
What is a variable?
A storage location of memory which can change
A random area to store things in.
Something that changes
Something that can only store numbers
What type of data would you store your age in years?
Real
Integer
String
Boolean
What data type would you store a vehicle's registration plate?
Real
String
Boolean
Integer
Which value is a String?
64
"cat"
True
0.5
What is an Integer?
A data type that contains whole numbers. eg: 3, 45, 124
Numbers with decimal point. eg: 0.5, 2.45, 56.04
Group of characters between quotation marks. eg: "dog"
Data type that can only be True or False.
Which data type is used to store:
"&"
Character
String
Integer
Real
What data type would you use to record someone's height so that it could be used in a calculation?
Text
String
Numeric
Boolean
subtraction
What is != ?
Fill in the blank to get 1 outputted from this code:
int main() {
int a = 2;
int b = 13;
cout<< b _ a <<endl;
}
(a)
True or False. This code will output 0
cout<< 23 % 2 <<endl;
True
False
Fill in the blank to get 0 outputted from this code:
int main() {
cout<< 12 ___ 12 <<endl;
}
-
+
==
%
What is the only function that all C++ programs must contain?
start()
system()
main()
program()
Which command in C++ moves the text to the next line?
\t
\n
\r
\s
What is the extension of C++ programs?
.c
.css
.cpp
.jsp
Which syntax is correct in printing an output in a C++ program?
print<<"Good Day!";
cout<<"Good Day!";
printf<<"Good Day!";
cout<<"Good"<<"Day!";
Insertion operator (<<) is used with?
cin
cout
both of the above
main
Which of the following correctly shows the hierarchy of arithmetic operations in C?
/ + * -
* - / +
+ - / *
/ * + -
Which of the following is not logical operator?
&
&&
||
!
When does the code block following while(x<100) execute?
When x is less than one hundred
When x is greater than one hundred
When x is equal to one hundred
while it wishes
Input/output function prototypes and macros are defined in which header file?
conio.h
stdlib.h
iostream.h
stdio.h
Which of the following is not a correct variable type?
int
real
float
char
