Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
22 views
20 pages
C++ Theory Papers
C++ and Database notes and question paper
Uploaded by
Josphat Mpofu
AI-enhanced title
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
Download
Save
Save C++ theory papers For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
22 views
20 pages
C++ Theory Papers
C++ and Database notes and question paper
Uploaded by
Josphat Mpofu
AI-enhanced title
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
Carousel Previous
Carousel Next
Download
Save
Save C++ theory papers For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save C++ theory papers For Later
You are on page 1
/ 20
Search
Fullscreen
ZIMBABWE MINISTRY OF HIGHER AND ‘TERTIARY EDUCATION, SCIENCE AND TECHNOLOGY DEVELOPMENT HIGHER EDUCATION EXAMINATIONS COUNCIL (HEXCO) NATIONAL CERTIFICATE “ IN INFORMATION TECHNOLOGY SUBJECT: Programming Using C++ PAPER NO: 317/18/S02A (Theory) DURATION: 3 Hours MARCH/APRIL EXAMINATION REQUIREMENTS Answer Booklet INSTRUCTIONS TO CANDIDATE Answer all questions This paper consists of 3 printed pages.PAP! ER NO: 17/18/8094 PROGRAMMING USING C++ (THEORY, QUESTION 1 8) Giving reasons, indicat invalid identifier: i) class private false college stud_Id le whether cach of the following is a valid or (10 marks) b) Write Pseudocode to determi whether it isa pass or a fail two marks. QUESTION 2 a) Evaluate the following expressions given that a = 10 and b = 5 i) at=b; ii) c= (a
=65); couts<"Age is greater than or equal to 65"<< endl; else couts<"Age is less than 65<
=65) Cout <<"Age is greater than or equal to 65° <
0) { cout<
=1) if (c % 2==0) , cout <
48:8(7<=8)II1(4) vy) (‘A°%2)==0 (10 marks) b) Distinguish between break and continue in C++ loops and use program segments to illustrate your answer. (8 marks) ¢) Explain the purpose of the “default” keyword in a switch statement. (2 marks) QUESTION 3 a) Explain the two (2) ways used to define member functions in C++ programming (4 marks) b) Differentiate a constructor from a destructor (4 marks) (10 marks) ¢) Explain any five (5) data types used in C++‘ing array a, Y declaration int numArray| | = (16, 4, 29, 42, -8, 6, b) Write Program Statements to ) Dis Play th © Sum of all the odd elements in the array (4 marks) i) Pin Pons d the largest element in the array (3 mark: - marks) Play the elements of the array starting with the last one iv) Set the fit = fifth element of the array to 34, (1 mark) Distinguish between the following )) Void function and value returning function ii) Pass by value and pass by address ii) Formal parameters and arguments iv) Global scope and local scope Function prototype and function definition (10 marks) v QUESTION 5 a) b) ¢) Declare a structure to hold the following product details: product number, product name and unit price for twenty different products in stock. (5 marks) Write a C++ code segment to display the details of all the products in (6 marks) stock. Determine the default file opening mode(s) for each of the following file classes i) ofstream ii) ifstream (6 marks) iii) fstream Determine the effect of the following C++ program segment. ofstream thisfile; thisfile.open(“we.txt’, ios:: outlios:: applios::binary); (4 marks) we / km,zImnabwe INNOUNISTRY OF HIGHER AND TERTIARY EDUCATION, VATION, SCIENCE AND TECHNOLOGY DEVELOPMENT | HIGHER EDUCATION EXAMINATIONS. COUNCIL (HEXCO) NATIONAL CERTIFICATE IN INFORMATION TECHNOLOGY SUBJECT: Programming using C++ (Theory) DURATION: 3 hours [ MARCH/APRIL 2022 EXAMINATION ] REQUIREMENTS PAPER NO: 317/18/S02A Answer booklet INSTRUCTIONS TO CANDIDATE Answer all questions. This paper consists of 5 printed pages.PAPER NO: 317/18/802 PROGRAMMING USING C+ THEORY QUESTION 1 Flow Chart BMI=weight/(height)? Uinderwei Display “Normal weight” Display “Overweight”PAPER No LIBLSO2A ~ PROGRAMMING USING CH TH R a) Given the above flow chart, write @ corresponding algorithm, (10 marks) b) Explain the following OOP terms: inictor Goan i) Data abs marke) ©) Differentiate between a run time and a compile time error, giving examples of cach. (4 marks) QUESTION 2 a) Give an cxample for each of the following components of a C+ program: Single line comment (2 marks) Pre-processor directive (2 marks) Global declaration (2 marks} C++ statement (2 marks) Local variable (2 marks) Convert the following mathematical expressions to valid C++ expressions: i) m=¥ety (3 marks) bet (2 marks) ae oy QUESTION 3 a) Determine the values of x, y and z after execution of the program segment. int x=10, y=12, 2= switch (x) { case 9: case 10: case 1 default: (6 marks)¢) 302A = PROGRAMMING USING c+ THEORY Aments explain the following control structures: i) While loop ii) For loop (3 marks) iii) If... else statement (3 marks) (3 marks) int array [5]=(13, 20, 64, 50, 29); Write code segment to perform the following: QUESTION 4 a) b) i) Subtract first element from last clement. ; - (2 ii) Find the average of clements in the array. e mare) iii) Display the array clements in reverse order, (3 marks) Given the following declaration: struct addr {int houseno; char strect [30}; char city [20]; B struct student { ° int studentno; char name [30]; addr address; } ITStudents [5]; (10 marks) Write a code segment to input details of five students. Write a function that accepts two integer parameters using the pass by reference method. ‘The function calculates and returns the sum of the two (8 marks) integers. Write a statement to display the value returned by the function in (b). (2 marks)A ee PAPER NO: 317/18/S02A ~ PROGRAMMING | (QUESTION 5 a) Explain the following methods as they are used in file processing: i) Is_open () (2 marks) i) eof () (2 marks) (2 marks) (2 marks) (2 marks) iii) getline () iv) close () v) open () class tructure of a C+t {10 marks) b) With the aid of an example describe the general s' wih definition.ZIMBABWE MINISTRY OF HIGHER AND TERTIARY EDUCATION, INNOVATION, SCIENCE AND TECHNOLOGY DEVELOPMENT HIGHER EDUCATION EXAMINATIONS COUNCIL (HEXCO) NATIONAL CERTIFICATE IN INFORMATION TECHNOLOGY SUBJECT: Programming Using C++ (Theory) PAPER NO: 317/18/S02A DURATION: 3 Hours REQUIREMENTS Answer Booklet INSTRUCTIONS TO CANDIDATES Answer all questions This paper consists of 4 printed pages.PAPER NO: 317/18/802A - PROGRAMMING USING C++ (THEORY) QUESTION 1. Outline any five (5) differences between object oriented programming a) (10 marks) (OOP) and procedural oriental programming (POP). Draw aflowchart for a program to calculate and display the sum of all ») integers from 1 to 30. (10 marks) UESTION 2 a) Complete the following table Escape Character Carriage return (10 marks) b) Indicate the most appropriate data type for each of the following variables i) Age ii) Married iii) Initial iv) Price v) Name (6 marks) QUESTION 3 Write code segments to illustrate the use of the following control structures a) If statement b) While loop c) — do...while loop d) for loop e) switch case (10 marks)PAPER NO: 317/18/S02A = PROGRAMMING US! ING C++ (THEORY) QUESTION 4 Given the following code segment: a) int mum[]= {10, 20, 30, 40, 50}; int t= 2 cout<
You might also like
C Greenbook
PDF
No ratings yet
C Greenbook
78 pages
Computer Science: 2022 XI 18 0230 Seat No. Time: 1 Hours First-Term Subject Code H4 7 0 5
PDF
No ratings yet
Computer Science: 2022 XI 18 0230 Seat No. Time: 1 Hours First-Term Subject Code H4 7 0 5
24 pages
Pyq Oops Ru
PDF
No ratings yet
Pyq Oops Ru
12 pages
330 - OSS - 2 Set ABC Computer Science
PDF
No ratings yet
330 - OSS - 2 Set ABC Computer Science
24 pages
Scanned Document 8
PDF
No ratings yet
Scanned Document 8
8 pages
Unit 5
PDF
No ratings yet
Unit 5
78 pages
CS
PDF
No ratings yet
CS
24 pages
Computer Science (41) - Final-2023
PDF
No ratings yet
Computer Science (41) - Final-2023
3 pages
CMT 211 PT
PDF
No ratings yet
CMT 211 PT
3 pages
Programming Fundamentals C++ NCCM221
PDF
No ratings yet
Programming Fundamentals C++ NCCM221
4 pages
BA Computer Application (Optional) V & VI Semester 2019-20 Onwards
PDF
No ratings yet
BA Computer Application (Optional) V & VI Semester 2019-20 Onwards
9 pages
Computer Science 15
PDF
No ratings yet
Computer Science 15
7 pages
2017 July
PDF
No ratings yet
2017 July
5 pages
Cosc102 Exam 14 - 15
PDF
No ratings yet
Cosc102 Exam 14 - 15
3 pages
SCS 202 24..25
PDF
No ratings yet
SCS 202 24..25
3 pages
Past Paper-1
PDF
No ratings yet
Past Paper-1
2 pages
2018 June
PDF
No ratings yet
2018 June
8 pages
The Kenya Polytechnic University College
PDF
No ratings yet
The Kenya Polytechnic University College
4 pages
Contentitemfile Clzh37sf12oeabni8luva8dy5
PDF
No ratings yet
Contentitemfile Clzh37sf12oeabni8luva8dy5
2 pages
01 QP SP 2 Cs
PDF
No ratings yet
01 QP SP 2 Cs
12 pages
Cit 3153 Object Oriented Programming I
PDF
No ratings yet
Cit 3153 Object Oriented Programming I
4 pages
Oops With C++ PYQ
PDF
No ratings yet
Oops With C++ PYQ
5 pages
Computer Science: 2024 III 09 0930 Seat No. Time: 3 Hours Subject Code H4 7 0 5
PDF
No ratings yet
Computer Science: 2024 III 09 0930 Seat No. Time: 3 Hours Subject Code H4 7 0 5
15 pages
SCS 202 - 23..24
PDF
No ratings yet
SCS 202 - 23..24
3 pages
Programming Using C++ (Practical)
PDF
No ratings yet
Programming Using C++ (Practical)
3 pages
W 2018 A - (Truexams - Com) - 1
PDF
No ratings yet
W 2018 A - (Truexams - Com) - 1
29 pages
PLUS ONE COMPUTER APPLICATION XMAS EXAM 24 ANSWER KEY - Hssreporter - Com
PDF
No ratings yet
PLUS ONE COMPUTER APPLICATION XMAS EXAM 24 ANSWER KEY - Hssreporter - Com
5 pages
2023 November Oop
PDF
No ratings yet
2023 November Oop
2 pages
2 Hours Instructions: Question One Other Two
PDF
No ratings yet
2 Hours Instructions: Question One Other Two
2 pages
Computer Science-: Chief Patron
PDF
No ratings yet
Computer Science-: Chief Patron
53 pages
Ics 2104 Object Oriented Programming I
PDF
No ratings yet
Ics 2104 Object Oriented Programming I
4 pages
Be - Artificial Intelligence and Data Science - Semester 3 - 2023 - November - Object Oriented Programming Oop Pattern 2019
PDF
No ratings yet
Be - Artificial Intelligence and Data Science - Semester 3 - 2023 - November - Object Oriented Programming Oop Pattern 2019
2 pages
Nov Dec 2023
PDF
No ratings yet
Nov Dec 2023
2 pages
Cit 2210 Computer Programming II
PDF
No ratings yet
Cit 2210 Computer Programming II
3 pages
Scanned Document 9
PDF
No ratings yet
Scanned Document 9
2 pages
CSC211 Test1
PDF
No ratings yet
CSC211 Test1
3 pages
Question Bank (2014-2017) : Computer Science
PDF
No ratings yet
Question Bank (2014-2017) : Computer Science
33 pages
Final Exam 2023 Code I-1
PDF
No ratings yet
Final Exam 2023 Code I-1
8 pages
Object Oriented Programming Using C++ PCIT102
PDF
100% (1)
Object Oriented Programming Using C++ PCIT102
27 pages
QB - Object Oriented Programming Using C++-2
PDF
No ratings yet
QB - Object Oriented Programming Using C++-2
25 pages
Cs111 Test - 1 - Solution
PDF
No ratings yet
Cs111 Test - 1 - Solution
10 pages
CPP Model Papers
PDF
100% (1)
CPP Model Papers
6 pages
Final Exam CPP
PDF
No ratings yet
Final Exam CPP
2 pages
C++ Practical Hexco 2022
PDF
No ratings yet
C++ Practical Hexco 2022
2 pages
CBSE Class 11 Computer Science Sample Paper 2018
PDF
No ratings yet
CBSE Class 11 Computer Science Sample Paper 2018
6 pages
Class Xi Computer Science Paper For Half Yearly Exam 2010
PDF
60% (5)
Class Xi Computer Science Paper For Half Yearly Exam 2010
8 pages
CS111 Exam
PDF
No ratings yet
CS111 Exam
19 pages
StMat Computer SC
PDF
No ratings yet
StMat Computer SC
45 pages
Sample Paper 7
PDF
No ratings yet
Sample Paper 7
6 pages
Programming in C++ Msuniv Question
PDF
No ratings yet
Programming in C++ Msuniv Question
6 pages
Sample Question Paper: Employee Employee Name, Employee ID Getdata, Putdata
PDF
No ratings yet
Sample Question Paper: Employee Employee Name, Employee ID Getdata, Putdata
7 pages
C++ 07 Batch by 09CE37
PDF
No ratings yet
C++ 07 Batch by 09CE37
9 pages
Cse2001 Object-Oriented-programming-with-c++ LTP 1.0 1 Cse2001
PDF
No ratings yet
Cse2001 Object-Oriented-programming-with-c++ LTP 1.0 1 Cse2001
4 pages
Eeb315 Final Exam 2016 PDF
PDF
No ratings yet
Eeb315 Final Exam 2016 PDF
6 pages
Psuc
PDF
No ratings yet
Psuc
2 pages