0% found this document useful (0 votes)
27 views1 page

First Term Exam Questions

Uploaded by

Eram KUBWAYO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views1 page

First Term Exam Questions

Uploaded by

Eram KUBWAYO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

E.

S GAKOMA_SCHOOL_YEAR_2022_2023_FIRST_TERM_S5MCE_CSC_EXAM_DEC12_2022_MARKS_70_DURATION_120 Minutes
Q1. What is One dimensional array in C++ programming? Give the syntax and one example of one dimensional array declaration (6 marks)
Q2. What are the three factors to be considered when declaring a one dimensional array? (6marks)
Q3. Study the following C++ program and give the output produced after running it: (6marks)
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
const int SIZE =7;
int marks[] = {5, 3, 4, 6, 8, 2, 7};
int sum = 0;
double mean, Product=1;
for (int i = 0; i < SIZE; ++i) {
sum += marks[i];
Product = Product*marks[i];}
mean=sum/SIZE;
cout << fixed << "Sum is is: " << setprecision(2) << sum<< endl;
cout << fixed << "Mean is: " << setprecision(2) << mean<< endl;
cout << fixed << "Product is:" << setprecision(3) <<Product<< endl;
return 0;}
Q4. Explain the following concepts as used in C++ programming: (a) Functions (b) Arguments (c) Parameter passing (6marks)
Q5. Differentiate between library functions and user-defined functions. (6marks)
Q6.Suppose that your computer laptop is not connected to Internet. If there is no wireless connection, which of the following cables can be used to have the connection?
Describe the role of the remaining cables.: a)VGA (Video Graphic Array) cable; b)Network cable; c)AC Power cable. (6 marks)
Q7. write the names of the components (1-6) of the side of the laptop (6marks)

Q8.Write in full words the names of the following cables used to connect computer with external devices: (6 marks)
a) USB Cable b) VGA cable c) HDMI cable d)RJ 45 Cable
Q9.write the names of the components (1-6) of the side of the laptop (6marks)

Q10. a.What is a two dimensional array in C++ programming? b.Write the syntax of a two dimensional array declaration and write one example (6marks)
Q11. Consider a 2 by 3 array T : a. Write a declaration of T b. How many rows does T have? c. How many columns does T have? (10marks)
d. How many elements does T have? e. Write name of elements in second row f. Write the name of element in third column
g. Write a single statement that sets the elements of T in row 1and column 2 to zero h. Write a statement that inputs the values of T from keyboard
i. Write a statement that displays the elements of first row of T

You might also like