0% found this document useful (0 votes)
5 views

c Programming Asses Ment

The document outlines a written assessment for ICT Technician Level 5 at Ziwa Technical Training Institute, covering multiple choice, short answer, and practical tasks related to programming concepts. It includes instructions for candidates, a marking scheme, and specific questions on programming languages, algorithms, data types, and practical coding tasks in C. The assessment aims to evaluate the candidates' understanding and application of computer programming principles.

Uploaded by

nicksonwekesa603
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)
5 views

c Programming Asses Ment

The document outlines a written assessment for ICT Technician Level 5 at Ziwa Technical Training Institute, covering multiple choice, short answer, and practical tasks related to programming concepts. It includes instructions for candidates, a marking scheme, and specific questions on programming languages, algorithms, data types, and practical coding tasks in C. The assessment aims to evaluate the candidates' understanding and application of computer programming principles.

Uploaded by

nicksonwekesa603
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

DEVELOP COMPUTER PROGRAM

Jan – March 2025

ZIWA TECHNICAL TRAINING INSTITUTE

BUILDING AND CIVIL ENGINEERING DEPARTMENT


ICT TECHCIAN LEVEL 5
J25

WRITTEN ASSESSMENT

Time: 3 HOURS

INSTRUCTIONS TO CANDIDATE

1. Marks for each question are indicated in the brackets.


2. The paper consists of TWO sections: A and B.
3. Answer ALL the questions in both sections
4. Candidates are provided with a separate answer booklet

This paper consists of THREE (3) printed pages.


Candidates should check the question paper to ascertain that all pages
are printed as indicated and that no questions are missing.
Page 1 of 8
Section A: Multiple Choice Questions (10 Marks)

Answer all questions. Each question carries 1 mark.

1. Which of the following is a low-level programming language?

a) Python
b) Java
c) Assembly
d) C++

2. What is the primary purpose of an algorithm?

a) Designing databases
b) Defining data types
c) Solving a problem step-by-step
d) Formatting text

3. A variable is:

a) A constant value
b) A memory location to store data
c) A reserved keyword
d) A type of error

4. Which data type is used to store decimal numbers in C?

a) int
b) char
c) float
d) bool

5. The process of finding and fixing errors in a program is called:

a) Compiling
b) Debugging
c) Coding
d) Executing

Section B: Short Answer Questions (30 Marks)

Answer all questions. Each question carries 5 marks.

1. Define the following terms:

Page 2 of 8
a. Programming Language
b. Algorithm
c. Data Type
d. Variable
e. Function

2. Briefly explain the history of programming languages.


3. Describe the program development cycle and its stages.
4. Differentiate between primitive and derived data types with examples in C.
5. Explain the concept of an array and write a simple C code snippet to declare and initialize
an array of 5 integers.

Section C: Practical Task (30 Marks)

Answer one of the following tasks. Ensure your code is well-commented and easy to understand.

Option 1: Write a simple C program that:

 Declares two integer variables


 Takes input from the user for both variables
 Performs addition, subtraction, multiplication, and division
 Prints the results

Option 2: Develop a C program that uses a function to calculate the square of a number. The
function should accept one parameter and return the square of that number. Implement the
program using appropriate function declaration.

Option 3: Create a basic algorithm to find the largest number in a given array of 10 numbers.
Provide the algorithm in pseudocode and then implement it in C programming language.

End of Assessment

Page 3 of 8
ICT Technician Level 5: Develop Computer Program Answers

Total Marks: 70

Section A: Multiple Choice Questions (10 Marks)

1. c) Assembly
2. c) Solving a problem step-by-step
3. b) A memory location to store data
4. c) Float
5. b) Debugging

Section B: Short Answer Questions (30 Marks)

1. Definitions:
o Programming Language: A formal language comprising instructions used to
produce various kinds of output through computers.
o Algorithm: A step-by-step set of instructions to solve a particular problem.
o Data Type: Classification of data which determines the type of value a variable
can hold (e.g., int, float, char).
o Variable: A named storage location in memory used to store data.
o Function: A block of code that performs a specific task when called.
2. History of Programming Languages:
o 1940s: First-generation machine languages using binary code.
o 1950s: Assembly languages using symbolic representations.
o 1957: FORTRAN, the first high-level programming language.
o 1960s–1970s: Development of structured languages like C and Pascal.
o 1980s–Present: Object-oriented languages like C++, Java, and Python.
3. Program Development Cycle:
o Problem Identification
o Planning and Designing Algorithms
o Writing the Code
o Compiling and Debugging
o Testing and Execution
o Maintenance and Updates
4. Primitive vs Derived Data Types:
o Primitive Data Types: Basic types such as int, char, float, double.
o Derived Data Types: Formed using primitive data types, including arrays,
pointers, and structures.
o Example: int age = 25; // Primitive and int scores[5]; // Derived
5. Arrays:

Page 4 of 8
o An array is a collection of elements of the same data type stored in contiguous
memory locations.
o Example C Code to declare and initialize an array:

int numbers[5] = {10, 20, 30, 40, 50};

Section C: Practical Task (30 Marks)

Option 1: Basic Arithmetic Operations

#include <stdio.h>

int main() {
int num1, num2;
printf("Enter two integers: ");
scanf("%d %d", &num1, &num2);

printf("Addition: %d\n", num1 + num2);


printf("Subtraction: %d\n", num1 - num2);
printf("Multiplication: %d\n", num1 * num2);
if (num2 != 0) {
printf("Division: %.2f\n", (float)num1 / num2);
} else {
printf("Division by zero is not allowed.\n");
}

return 0;
}

Option 2: Square Calculation Using Functions

#include <stdio.h>

int square(int num) {


return num * num;
}

int main() {
int number;
printf("Enter a number: ");
scanf("%d", &number);
printf("Square of %d is %d\n", number, square(number));
return 0;
}

Option 3: Find Largest Number in an Array Pseudocode:

START
DECLARE array[10]
READ values into array
SET largest = array[0]
FOR each element in array

Page 5 of 8
IF element > largest THEN
SET largest = element
ENDIF
ENDFOR
PRINT largest
END

C Program:

#include <stdio.h>

int main() {
int array[10], i, largest;
printf("Enter 10 numbers: ");
for(i = 0; i < 10; i++) {
scanf("%d", &array[i]);
}

largest = array[0];
for(i = 1; i < 10; i++) {
if(array[i] > largest) {
largest = array[i];
}
}

printf("The largest number is: %d\n", largest);


return 0;
}

End of Answers

Page 6 of 8
ICT Technician Level 5: Develop Computer Program Marking Scheme

Total Marks: 70

Section A: Multiple Choice Questions (10 Marks)

Each correct answer earns 1 mark.

1. c) Assembly - 1 Mark
2. c) Solving a problem step-by-step - 1 Mark
3. b) A memory location to store data - 1 Mark
4. c) Float - 1 Mark
5. b) Debugging - 1 Mark

Section B: Short Answer Questions (30 Marks)

Each correct response earns up to 5 marks.

1. Definitions (5 Marks)
o Programming Language (1 Mark)
o Algorithm (1 Mark)
o Data Type (1 Mark)
o Variable (1 Mark)
o Function (1 Mark)
2. History of Programming Languages (5 Marks)
o Accurate timeline (2 Marks)
o Major milestones (2 Marks)
o Examples of programming languages (1 Mark)
3. Program Development Cycle (5 Marks)
o Clear description of all stages (1 Mark each for the 5 stages)
4. Primitive vs Derived Data Types (5 Marks)
o Explanation of Primitive Data Types with examples (2 Marks)
o Explanation of Derived Data Types with examples (2 Marks)
o Comparison (1 Mark)
5. Arrays (5 Marks)
o Explanation of concept (2 Marks)
o Correct C code to declare and initialize an array of 5 integers (3 Marks)

Page 7 of 8
Section C: Practical Task (30 Marks)

Evaluate one task based on the following criteria:

Option 1: Basic Arithmetic Operations

 Correct variable declaration (3 Marks)


 Proper input and output statements (5 Marks)
 Correct implementation of addition, subtraction, multiplication, and division (12 Marks)
 Code comments and readability (5 Marks)
 Program correctness (5 Marks)

Option 2: Square Calculation Using Functions

 Correct function declaration and definition (5 Marks)


 Correct input and output statements (5 Marks)
 Accurate function call and value return (10 Marks)
 Code comments and readability (5 Marks)
 Program correctness (5 Marks)

Option 3: Largest Number in an Array

 Clear and logical pseudocode (5 Marks)


 Correct array declaration and initialization (5 Marks)
 Proper loop implementation (5 Marks)
 Correct logic to find the largest number (10 Marks)
 Code comments and readability (5 Marks)

End of Marking Scheme

Page 8 of 8

You might also like