QP - Software Development - L4 - Programming Fundementals
QP - Software Development - L4 - Programming Fundementals
SECTOR: ICT
TRADE: SOFTWARE DEVELOPMENT
RTQF LEVEL: IV
MODULE CODE AND TITLE: SFDPF401, PROGRAMMING
FUNDAMENTALS
DURATION: 3HOURS
INSTRUCTION TO CANDIDATES:
Instructions: This Assessment Consists three (3) sections A, B and C
Page 1 of 8
a. Program
b. Variable
c. Loop
d. Array
e. Class
Q2. What are the basic concepts used in the Object-Oriented Programming
language? /5marks
Q3. Give the difference between local and global variables. /2marks
Q4 List the Components of a C++ function. /5 marks
Q5. Complete the following table: /5marks
Addition Sum+=2 8
Subtraction Sum&=3 8
Division Sum=Sum||4 8
Multiplication !Sum 8
Modulus Sum%=6 8
Page 2 of 8
Q7. Analyze the following code and give its output. /4Marks
#include <iostream>
using namespace std;
void foo(int*pValue)
{
*pValue=75;
}
int main(int argc, char** argv) {
int nValue;
foo(&nValue);
cout<<"nValue="<<nValue<<endl;
return 0;
}
Page 3 of 8
#include<iostream>
using namespace std;
int main()
{
int a=6,b=12,c,d;
b%=a;
c=(d=1,d+2);
d+=2;
b/=5;
cout<<”This means that:”<<endl;
cout<<”A IS=”<<a<<”\n B IS=”<<b<<”\n C IS=”<<c<<”\n D
IS=”<<d<<endl;
}
ii) int i = 4;
int x = 6;
double z;
z = x / i;
Page 4 of 8
A. Void Pointer
B. Null Pointer
C. Empty Pointer
D. Wild Pointer
iv) Default constructor has ____ arguments. / 1Mark
A. No argument
B. One Argument
C. Two Argument
D. None of these
v) Which one of the following variable names is NOT valid? /1 Mark
A. Choice 1 go_cart
B. Choice 2 go4it
C. Choice 3 4season
D. Choice 4 run4
E. Choice 5 _what
Q10. Match the following terms with their meaning respectively. /5marks
B. Pictorial or graphical
2. Correspond to….. 2. Computer Program representation of an
algorithm /
pseudocode
C. Program that
3. Correspond to….. 3. Pseudocode converts high level
language into
machine language
D. Sequence of
4. Correspond 4. Compiler instructions given to
to….. the computer to
perform a specific
task.
Page 6 of 8
Page 7 of 8
Q12. What are the difference and similarities between constructor and
destructor? /10marks
Q13. Using class, write a program to display the sum of all numbers from 1
to 10./10marks
SECTION C : CHOOSE ONLY ONE QUESTION 15marks
Q15. Information needed to record a book is book name, price and number
of pages. Write a C++ program using structure to record information of five
different books and then display them on the screen /15marks
Page 8 of 8