SlideShare a Scribd company logo
1 of 4
©2023 Kendege Technical & Vocational College Page 1
2920/203
OBJECT ORIENTED PROGRAMMING
JUNE 2023
TIME: 3 HOURS
KENDEGE TECHNICAL AND VOCATIONAL COLLEGE
DIPLOMA IN INFORMATION AND COMMUNICATION TECHNOLOGY
MODULE II
OBJECT ORIENTED PROGRAMMING
3 Hours
INSTRUCTIONS TO CANDIDATES
Answer ALL questions in answer booklet provided
All questions carry equal marks
Candidates should answer the questions in English
The paper consists of 3 printed pages
Candidates should check the question paper to ascertain that all the pages are printed as indicated
and that no question is missing
©2023 Kendege Technical & Vocational College Page 2
1 a) Outline three typical steps in writing an object-oriented program (6marks)
b) Study the following C++ program and answer questions that follow
#include <iostream>
using namespace std;
class Room {
public:
double length;
double breadth;
double height;
double calculateArea() {
return length * breadth;
}
double calculateVolume() {
return length * breadth * height;
}
};
int main() {
Room room1;
room1.length = 42.5;
room1.breadth = 30.8;
room1.height = 19.2;
cout << "Area of Room = " << room1.calculateArea() << endl;
cout << "Volume of Room = " << room1.calculateVolume() << endl;
return 0;
}
Interpret the program segment clearly outlining the access specifiers used (6 marks)
c) Write out the output of the above program (4 marks)
d) Explain the terms state and behavior as used in object-oriented programming (4 marks)
2 a) With the aid of a C++ syntax code, explain an instance variable. (4 marks)
b) Mupyaro wrote a C++ program, the program failed to compile due to incorrect identifier
declarations. Explain three rules he should have followed (6 marks)
c) Explain three types of class access specifiers used in C++ programming (6 marks)
d) Distinguish between boolean and character literals as used in C++ programming (4 marks)
3 a) Write a C++ program to accept a string from the keyboard and store it in a file (8 marks)
b) With the aid of a syntax code, explain the use of break and continue statements (6 marks)
c) Describe namespace as used in a C++ program (2 marks)
d) Explain two types of exception in Object Oriented Programming (4 marks)
©2023 Kendege Technical & Vocational College Page 3
4 a) Explain three error handling techniques used in C++ programming (6 marks)
b) State two differences between static and non-static data members as used in programming
(4 marks)
c) With the aid of syntax code, explain how member functions can be accessed using pointers
(6 marks)
d) Distinguish between encapsulation and abstraction as used in object-oriented programming
(4 marks)
5 a) With the aid of syntax code, explain inline functions (4 marks)
b) Write a C++ program that would initialize the values (20, 50, 40, 10, 30) into an array. The program
then displays the sum, maximum and minimum of the values (8 marks)
c) Outline four characteristics of constructors as used in Object Oriented Programming
(4 marks)
d) With the aid of a syntax code, explain copy constructor (4 marks)
©2023 Kendege Technical & Vocational College Page 4
THIS IS THE LAST PRINTED PAGE

More Related Content

Similar to OOP.docx

Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
guest3f9c6b
 
C O M P U T E R P R O G R A M M I N G J N T U M O D E L P A P E R{Www
C O M P U T E R  P R O G R A M M I N G  J N T U  M O D E L  P A P E R{WwwC O M P U T E R  P R O G R A M M I N G  J N T U  M O D E L  P A P E R{Www
C O M P U T E R P R O G R A M M I N G J N T U M O D E L P A P E R{Www
guest3f9c6b
 
2009 Punjab Technical University B.C.A Object Oriented Proagramming Language ...
2009 Punjab Technical University B.C.A Object Oriented Proagramming Language ...2009 Punjab Technical University B.C.A Object Oriented Proagramming Language ...
2009 Punjab Technical University B.C.A Object Oriented Proagramming Language ...
Monica Sabharwal
 

Similar to OOP.docx (20)

Chap 02-1
Chap 02-1Chap 02-1
Chap 02-1
 
C programming-1.pptx
C programming-1.pptxC programming-1.pptx
C programming-1.pptx
 
22316-2019-Summer-model-answer-paper.pdf
22316-2019-Summer-model-answer-paper.pdf22316-2019-Summer-model-answer-paper.pdf
22316-2019-Summer-model-answer-paper.pdf
 
Oop december 2018
Oop december 2018Oop december 2018
Oop december 2018
 
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
Computer Programming Jntu Model Paper{Www.Studentyogi.Com}
 
C O M P U T E R P R O G R A M M I N G J N T U M O D E L P A P E R{Www
C O M P U T E R  P R O G R A M M I N G  J N T U  M O D E L  P A P E R{WwwC O M P U T E R  P R O G R A M M I N G  J N T U  M O D E L  P A P E R{Www
C O M P U T E R P R O G R A M M I N G J N T U M O D E L P A P E R{Www
 
Intro
IntroIntro
Intro
 
17432 object oriented programming
17432   object oriented programming17432   object oriented programming
17432 object oriented programming
 
FDS-CS8393 BME MODEL QP2.doc
FDS-CS8393 BME MODEL QP2.docFDS-CS8393 BME MODEL QP2.doc
FDS-CS8393 BME MODEL QP2.doc
 
Data Communication and networking.docx
Data Communication and networking.docxData Communication and networking.docx
Data Communication and networking.docx
 
BISH CS Modle Exit Exam.doc
BISH CS Modle Exit Exam.docBISH CS Modle Exit Exam.doc
BISH CS Modle Exit Exam.doc
 
Part - 2 Cpp programming Solved MCQ
Part - 2  Cpp programming Solved MCQ Part - 2  Cpp programming Solved MCQ
Part - 2 Cpp programming Solved MCQ
 
Oops 2018
Oops 2018Oops 2018
Oops 2018
 
Oop july 2017
Oop july 2017Oop july 2017
Oop july 2017
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
 
Sp 1418794917
Sp 1418794917Sp 1418794917
Sp 1418794917
 
2009 Punjab Technical University B.C.A Object Oriented Proagramming Language ...
2009 Punjab Technical University B.C.A Object Oriented Proagramming Language ...2009 Punjab Technical University B.C.A Object Oriented Proagramming Language ...
2009 Punjab Technical University B.C.A Object Oriented Proagramming Language ...
 
Semester ii
Semester   iiSemester   ii
Semester ii
 
Mcs 011 ignou question paper c language
Mcs 011 ignou question paper c languageMcs 011 ignou question paper c language
Mcs 011 ignou question paper c language
 
Pcd201516
Pcd201516Pcd201516
Pcd201516
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

OOP.docx

  • 1. ©2023 Kendege Technical & Vocational College Page 1 2920/203 OBJECT ORIENTED PROGRAMMING JUNE 2023 TIME: 3 HOURS KENDEGE TECHNICAL AND VOCATIONAL COLLEGE DIPLOMA IN INFORMATION AND COMMUNICATION TECHNOLOGY MODULE II OBJECT ORIENTED PROGRAMMING 3 Hours INSTRUCTIONS TO CANDIDATES Answer ALL questions in answer booklet provided All questions carry equal marks Candidates should answer the questions in English The paper consists of 3 printed pages Candidates should check the question paper to ascertain that all the pages are printed as indicated and that no question is missing
  • 2. ©2023 Kendege Technical & Vocational College Page 2 1 a) Outline three typical steps in writing an object-oriented program (6marks) b) Study the following C++ program and answer questions that follow #include <iostream> using namespace std; class Room { public: double length; double breadth; double height; double calculateArea() { return length * breadth; } double calculateVolume() { return length * breadth * height; } }; int main() { Room room1; room1.length = 42.5; room1.breadth = 30.8; room1.height = 19.2; cout << "Area of Room = " << room1.calculateArea() << endl; cout << "Volume of Room = " << room1.calculateVolume() << endl; return 0; } Interpret the program segment clearly outlining the access specifiers used (6 marks) c) Write out the output of the above program (4 marks) d) Explain the terms state and behavior as used in object-oriented programming (4 marks) 2 a) With the aid of a C++ syntax code, explain an instance variable. (4 marks) b) Mupyaro wrote a C++ program, the program failed to compile due to incorrect identifier declarations. Explain three rules he should have followed (6 marks) c) Explain three types of class access specifiers used in C++ programming (6 marks) d) Distinguish between boolean and character literals as used in C++ programming (4 marks) 3 a) Write a C++ program to accept a string from the keyboard and store it in a file (8 marks) b) With the aid of a syntax code, explain the use of break and continue statements (6 marks) c) Describe namespace as used in a C++ program (2 marks) d) Explain two types of exception in Object Oriented Programming (4 marks)
  • 3. ©2023 Kendege Technical & Vocational College Page 3 4 a) Explain three error handling techniques used in C++ programming (6 marks) b) State two differences between static and non-static data members as used in programming (4 marks) c) With the aid of syntax code, explain how member functions can be accessed using pointers (6 marks) d) Distinguish between encapsulation and abstraction as used in object-oriented programming (4 marks) 5 a) With the aid of syntax code, explain inline functions (4 marks) b) Write a C++ program that would initialize the values (20, 50, 40, 10, 30) into an array. The program then displays the sum, maximum and minimum of the values (8 marks) c) Outline four characteristics of constructors as used in Object Oriented Programming (4 marks) d) With the aid of a syntax code, explain copy constructor (4 marks)
  • 4. ©2023 Kendege Technical & Vocational College Page 4 THIS IS THE LAST PRINTED PAGE