0% found this document useful (0 votes)
33 views8 pages

QP - Software Development - L4 - Programming Fundementals

The document outlines the TVET National Comprehensive Assessment for the ICT sector, specifically focusing on Software Development at RTQF Level IV for the school year 2020-2021. It includes instructions for candidates, assessment sections with various programming-related questions, and tasks related to C++ programming concepts. The assessment is divided into three sections: compulsory questions, additional questions, and a choice of programming tasks.

Uploaded by

hiti protogene
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views8 pages

QP - Software Development - L4 - Programming Fundementals

The document outlines the TVET National Comprehensive Assessment for the ICT sector, specifically focusing on Software Development at RTQF Level IV for the school year 2020-2021. It includes instructions for candidates, assessment sections with various programming-related questions, and tasks related to C++ programming concepts. The assessment is divided into three sections: compulsory questions, additional questions, and a choice of programming tasks.

Uploaded by

hiti protogene
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

TVET NATIONAL COMPREHENSIVE ASSESSMENT

SCHOOL YEAR 2020-2021

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

Section A: All compulsory. 55marks

Section B: All compulsory 30marks

Section B: Choose only one (1) question 15 marks

Page 1 of 8

National Examination and P.O. BOX 1382, [email protected]


School Inspection Authority Kigali, Rwanda www.nesa.gov.rw
SECTION A: ANSWER ALL THE QUESTIONS 55 marks
Q1. Define the following terms. /5 marks

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

Operator Operation Value of Sum Value of


before Sum after

Addition Sum+=2 8

Subtraction Sum&=3 8

Division Sum=Sum||4 8

Multiplication !Sum 8

Modulus Sum%=6 8

Q6. Answer by true or false /5marks

Page 2 of 8

National Examination and P.O. BOX 1382, [email protected]


School Inspection Authority Kigali, Rwanda www.nesa.gov.rw
a. In computer programming, a program is not limited to a linear of
sequence of instructions during its process. It may also repeat code
or take decision.
b. A program written in high-level language is called a source code.
We need to convert the source code into machine code and it is
accomplished by compilers and interpreters.
c. To specify the kind and size of value to be stored in a variable we
use data type.

d. It is not allowed to use special characters in naming a variable,


except when you are working with pointers.
e. Recursive function is referred to as a user defined function that calls
itself.

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

National Examination and P.O. BOX 1382, [email protected]


School Inspection Authority Kigali, Rwanda www.nesa.gov.rw
Q8. Analyze the following code and give its output. /4Marks

#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;
}

Q9 Choose the correct answer according to the expression /5marks

i) A continue statement causes execution to skip to / 1Mark


A. The return 0; statement
B. The first statement after the loop
C. The statement following the continue statement
D. The next iteration of the loop

ii) int i = 4;
int x = 6;
double z;

z = x / i;
Page 4 of 8

National Examination and P.O. BOX 1382, [email protected]


School Inspection Authority Kigali, Rwanda www.nesa.gov.rw
printf(“z=%.2f\n”, z);
What will print when the sample code above is executed? (1mark)
a) Choice 1 z=0.00
b) Choice 2 z=1.00
c) Choice 3 z=1.50
d) Choice 4 z=2.00
e) Choice 5 z=NULL

iii) A pointer pointing to a variable that is not initialized is


called ____ / 1Mark

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

Answer Term Meaning


A. Description of
1. Correspond to….. 1. Flowchart computer program
Page 5 of 8

National Examination and P.O. BOX 1382, [email protected]


School Inspection Authority Kigali, Rwanda www.nesa.gov.rw
without strict
programming
language

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.

5. Correspond to….. E. Memory location to


5. Variable store data or value

Q11.The use of functions offers flexibility in the design, development, and


implementation of the program to solve complex problems. What are the
advantages of using functions in programming? /5marks

SECTION B: ATTEMPT ALL QUESTIONS 30 marks

Q.11 Rewrite the following program using nested if condition./10marks

Page 6 of 8

National Examination and P.O. BOX 1382, [email protected]


School Inspection Authority Kigali, Rwanda www.nesa.gov.rw
1. #include <iostream>
2. using namespace std;
3. int main() {
4. char oper;
5. float num1, num2;
6. cout << "Enter an operator (+, -, *, /): ";
7. cin >> oper;
8. cout << "Enter two numbers: " << endl;
9. cin >> num1 >> num2;
10.
11. switch (oper) {
12. case '+':
13. cout << num1 << " + " << num2 << " = " << num1 +
num2;
14. break;
15. case '-':
16. cout << num1 << " - " << num2 << " = " << num1 - num2;
17. break;
18. default:
19. // operator is doesn't match any case constant (+, -, *, /)
20. cout << "Error! The operator is not correct";
21. break;
22. }
23.
24. return 0;

Page 7 of 8

National Examination and P.O. BOX 1382, [email protected]


School Inspection Authority Kigali, Rwanda www.nesa.gov.rw
}

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

Q14. Write a program allows entering 15 numbers and sorting them in


ascending order, using arrays./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

National Examination and P.O. BOX 1382, [email protected]


School Inspection Authority Kigali, Rwanda www.nesa.gov.rw

You might also like