The document is the final term examination for OOP course. It contains 4 questions assessing CLO-1 and CLO-2. Q1 and Q2 require implementing classes in C++ and Java with explanations. Q3 requires overloading the + operator in C++. Q4 requires developing a Swing application in Java to print a number table and clear it.
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0 ratings0% found this document useful (0 votes)
158 views2 pages
OOP Final Lab Exam
The document is the final term examination for OOP course. It contains 4 questions assessing CLO-1 and CLO-2. Q1 and Q2 require implementing classes in C++ and Java with explanations. Q3 requires overloading the + operator in C++. Q4 requires developing a Swing application in Java to print a number table and clear it.
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 2
Air University Kamra Campus
Department of Computer Science
Lab Final Term Examination
Subject: OOP Total Marks: 50
Course Code: CS112 Date: 27-March-2024 Class: BSCYS-II Duration: 3:00 Hrs. Semester: Spring 2024 Instructor name: Mr. Zohaib Sajjad
Read the following instructions carefully.
Mobile Phone, USB, or any other electronic device is strictly prohibited during the exam. If found, will be confiscated and strict action will be taken. Follow the proper naming format as provided by lab instructor. Anyone found guilty of using unfair means will have to face strict action according to Air University rules.
Q1: [CLO-1, C-3- APPLYING] [10]
Implement the following in C++: You are given a base class Animal that has a virtual function sound (). Create two derived classes, Dog and Cat, that override the sound () function to print "Woof!" and "Meow!" respectively. Write explanation of code line by line in comments.
Q2: [CLO-1, C-3- APPLYING] [10]
Implement the following in java: Write a class called “arithmetic” having two integer and one character as data members. It will ask user for input. It performs the operation on its integer members indicated by character member (+,-,*, /) For example * indicates multiplication on data members as d1*d2. Write a class with all necessary constructors and methods to perform the operation and print the result. Use Default constructor and Parameterized constructor. Write explanation of code line by line in comments.
Q3: [CLO-1, C-3- APPLYING] [10]
Implement the following in C++: Write any program that overload the + operator. Write explanation of code line by line in comments. Q4: [CLO-2, C-3- APPLYING] [20] Develop below mentioned application using Java Swing. User will enter the number and will click “Print Table” button it will print the table starting from 0 up to 10. When user clicks the “Reset Data” button, it will clear the created table field.