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

CS112L Lab9

The document outlines a lab manual for CS112L: Object Oriented Programming, detailing three tasks for students. Task 1 involves creating an 'Account' class and a 'SavingsAccount' subclass, Task 2 focuses on a 'Vehicle' class with a 'Car' and 'ElectricCar' subclass, and Task 3 requires developing a 'Person' class with 'Student' and 'Teacher' subclasses. Each task includes specific functionalities and scenarios to be implemented by the students.

Uploaded by

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

CS112L Lab9

The document outlines a lab manual for CS112L: Object Oriented Programming, detailing three tasks for students. Task 1 involves creating an 'Account' class and a 'SavingsAccount' subclass, Task 2 focuses on a 'Vehicle' class with a 'Car' and 'ElectricCar' subclass, and Task 3 requires developing a 'Person' class with 'Student' and 'Teacher' subclasses. Each task includes specific functionalities and scenarios to be implemented by the students.

Uploaded by

maleeka zahra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Ghulam Ishaq Khan Institute of Engineering Sciences and Technology, Topi

Faculty of Computer Science and Engineering

CS112L: Object Oriented Programming Lab


Week12 Lab 9(Lab10 Manual)

Lab Instructor: Mr. Junaid Ahmed

Tasks1:

Define a base class "Account" with attributes like "accountNumber" and "balance", along with
methods for depositing and withdrawing funds. Create a derived class "SavingsAccount" inheriting
from "Account", adding functionality for calculating interest and displaying balance. Implement a
scenario where a user opens a savings account, deposits funds, earns interest, and withdraws money.

Tasks2:
Define a base class "Vehicle" with methods for starting and stopping the engine, along with attributes
like "make" and "model". Create a derived class "Car" inheriting from "Vehicle" and adding features
like automatic transmission. Further, derive a class "ElectricCar" from "Car" and add functionality
for charging the battery. Simulate a scenario where an electric car is used, starting its engine, driving,
and then charging the battery.

Tasks3:
Develop a base class "Person" with attributes like "name" and "age", along with methods for
displaying information. Create two derived classes: "Student" and "Teacher", both inheriting from
"Person" and adding features specific to students and teachers respectively. Illustrate a scenario
where a school registers both students and teachers, displaying their information.

You might also like