0% found this document useful (0 votes)
3 views4 pages

2019 programming concepts

This document is an examination paper for the National Certificate in Information Technology, specifically focusing on Programming Using C++. It includes instructions for candidates, a series of questions covering various C++ programming concepts, and requirements for answering the exam. The questions address topics such as C++ syntax, operators, variable scope, arrays, structures, mathematical functions, file handling, and object-oriented programming concepts.

Uploaded by

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

2019 programming concepts

This document is an examination paper for the National Certificate in Information Technology, specifically focusing on Programming Using C++. It includes instructions for candidates, a series of questions covering various C++ programming concepts, and requirements for answering the exam. The questions address topics such as C++ syntax, operators, variable scope, arrays, structures, mathematical functions, file handling, and object-oriented programming concepts.

Uploaded by

Panashe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 4
ZIMBABWE, MINISTRY OF HIGHER AND TERTIARY EDUCATION, SCIENCE AND TECHNOLOGY DEVELOPMENT HIGHER EDUCATION EXAMINATIONS COUNCIL (HEXCo) NATIONAL CERTIFICATE IN iY INFORMATION TECHNOLOGY SUBJECT: Programming Using C++ (Theory) PAPER NO: 317/18/S02A DURATION: 3 Hours OCTOBER/NOVEMBER 2019 EXAMINATION REQUIREMENTS Answer booklet e INSTRUCTIONS TO CANDIDATE Answer ALL questions This paper consists of 4 printed pages, ER NO; 3 *12/18/S02A PROGRAMMING USING C++ (THEORY) QUESTION 1 in Show the #includex omanip.h includec le void main () cout<< “E cout <<“ \n Table of << num << “is: \n \n"; for (i= 1;i<=10; i++) ra number’ coutce setw (3) **" fei cesetw (4) << s> (mark vi), Comma (1 mark vii) * Asterisk 4 20 (1 mark) viii): Colon (1 mark) QUESTION 2 ‘ a) Define the following C++ terms: 4 i) Unary operators. (Qm ii) Binary operators PAPER NO: 317/18/02, See 18/S02A -PROGRAMMING USING Ct+ (THEORY) >) Explain the purposi Fn Ge peg arbese of comments and give two (2) ways of inserting them . (6 marks) Explain the concepts of C++ variable scope and the two (2) s ofa variable. Fi pe marks) QUESTION 3 ») Ina program, statement iteratively m may be executed sequentially, selectively or Explain the meaning of this statement (9 marks) b) Give the syntax of the following: i) Ifstatement (2 marks} i) Switch statement (2 marks} iii) For loop (2 marks) i) While loop (2 marks) UESTION 4 a) Define the term array (2 marks) b) Write code to: i) Initialise values 97, 69, 18, 46, 83 to an array named arr. (2 marks) ii) Assign the value, 20, to the 5t element in the array named arr. (2 marks) iii) - Add all the values of array arr and display on screen using for loop. (4 marks) Wizanee. QUESTION 5 Given the following declaration: struct addr st int houseno; « char street [30]; char city [20]; char state [20]; ae pirat struct emp rite code segment te ‘put details of five employees, (10 marks) xplain the purpose of the following mathematical functions and character ons with the aid of an example Double pow (double base, double exp); (2 marks) «€ b) Double sqrt (double num); (2 marks) € Int islower (int ch); (2 marks) Int isalnum (int chy (2 marks} ©) Int toupper (int ch); * STION 7 Define the term file in C++ and elaborate on the fstream.h library. a) (4 marks) b) Write code to demonstrate how one can open a file and close it. (3 marks) c) Differentiate between get () and put () functions. (2 marks) o ovestion Define the following object oriented programming concepts: a) Object b) Class c} Data abstraction d) Data encapsulation e) Modularity

You might also like