HW05
HW05
WEEK 9
Create a class named Rectangle.
• Let the class have two variables named Length and Width.
• These variables will be obtained from the user
• Write C++ code to calculate the area and perimeter of the rectangle
by writing 2 functions with the object derived from this class.
• Create a class named Employee and keep Name, LastName and Salary
information in the class.
• Print employee information to the screen with the ShowInfo method
• IncreaseSalary method will increase the salary according to the
entered wage.
• Access the above 2 functions with the emp1 object created from the
employee class and print the information to the screen.
• Employee information will not be obtained from the user, it will be
filled in by you.
---Design a C++ class named Date that represents a date with day, month, and year.
• Requirements:
• Add member variables for day, month, and year (all integers).
• Provide a constructor that takes three arguments: day, month, and year.
• these arguments will be entered by the user
---Implement the following functions:
• Verify the date during construction. A valid date must comply with these rules:
• The month must be between 1 and 12.
• The number of days will take up to a maximum of 31
• If the date is invalid during construction, print an error message and set the object's member
variables to default values (for example, 1 for day, 1 for month, and 1 for year).
• Add member functions to access the day, month and year (e.g. getDay(), getMonth(), getYear()).