MNS University of Engineering & Technology, Multan
Department of Computer Science Prepared by: Mr. M. Hassan Saleem
Object Oriented Programming
Lab1: Class/Object (Variables & Method/Functions)
Assignments Tasks Lists
• Task 1.1: Design a class Rectangle with variables length and width and create
methods to calculate area and perimeter.
• Task 1.2: Develop a class BankAccount with variables accountNumber and
balance and implement methods to deposit, withdraw, and display balance.
• Task 1.3: Create a class Car with variables brand, model, and price and write
methods to update price and display car details.
• Task 1.4: Write a class Employee with variables id, name, and salary and
implement a method to calculate annual salary.
• Task 1.5: Design a class Calculator with methods for addition, subtraction,
multiplication, and division, then create an object to perform operations.
Note:
These tasks also included in Lab Manual.
File name must be: Reg_AI_A/B_2_OOP_L_A1 e.g.: 22_AI_A_2_OOP_L_A1
Reg_Cy_Sec_A/B_2_OOP_L_A1 e.g.: 22_Cy_Sec_A_2_OOP_L_A1
Share this Assignment in Google Class Room of your section with Name & Roll
no. otherwise not accepted.