You are on page 1of 1

COMSATS University Islamabad, Wah Campus

Lab Assignment # 2
Department of Computer Science

Program/Class: BSE 3A Date: 16 March 2022


Subject: Object Oriented Programming Instructor: Samia Zaffar
_______________________________________________________________________

Classes, Objects and Constructors [CLO2]

Lab Assignment:

Activity 1:
Create a class Rectangle. It has two data members that represent the length and width of
rectangle. Create three constructors (no argument, parametrized and copy constructor).The
method calculateArea() will return the area of rectangle. The runner class will create an objects of
Rectangle class and area function will be called.

Activity 2:
Write a class Date. As date is composed of three attributes, namely month, year and day; so the
class contains three private Data Members. Create three constructors (no argument, parametrized
and copy constructor) and method display().Create three date objects using constructors and get
user input and display valid date values.

You might also like