Professional Documents
Culture Documents
Question 1 (30 marks) 100-500 words per explanation and avoid plagiarism.
i. Explain the following datatypes in your own words without copying it from
anywhere.
a. int
b. float.
c. double.
d. string.
e. Bool.
ii. Write a program in C++ with the following datatypes. Use the 3 different variables
with the same data type. Explain the codes step by step.
a. int
b. float.
c. double.
d. string.
e. bool.
Question 2 (15 marks) 300-500 words per discussion and avoid plagiarism.
Discuss the following.
a. Pointers
b. Arrays
c. Structures
d. Classes
e. functions
i. Declare an array named name1 and put all the first five characters into it.
ii. Write a for loop with an if condition that will find and output the index value of a
searched character in the array. Let the program be such that the user will input the
character being searched for.
Question 4 (25 marks) avoid plagiarism.
Write the following program in c++.
i. Create a class of your own choice with 5 attributes.
ii. Create an object of named objone in the intmain() function
iii. Access attributes and set values for all the 5 attributes
iv. Print all the attribute values
v. Create a function in the class that add two number and access the function using the
oblject.
Question 6 (40 marks) 200-500 words per explanation and avoid plagiarism.
I. Explain the following in your own words without copying it from anywhere. Give
examples each in your explanation.
a. Class hierarchies
b. Algorithms
c. Flowcharts
d. Control structure
a. https://smallpdf.com/compress-pdf
b. https://www.ilovepdf.com/compress_pdf
Online Submission Instructions