Assignment (Q)
Assignment (Q)
Assignment (Q)
Lab Assignment # 2
Department of Computer Science
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.