Question: For RentHouse class, please note the following specifications: 1)owner attribute is an object of Person class. 2)Default values: late_months = 0, annual_rent = 1200, monthly_fine

 For RentHouse class, please note the following specifications: 1)owner attribute is

For RentHouse class, please note the following specifications: 1)owner attribute is an object of Person class.

2)Default values: late_months = 0, annual_rent = 1200, monthly_fine = 100, rent_length = 0, and total_payment = 0

3)extend() method increment the rent_length attribute by 1 (i.e., add rent_length by 1)

4)Inside the constructor of RentHouse initialize the discount according to the unit_name and owners age as follows: A) If the unit_name begins with letter A, give discount 0%. If the unit_name begins with letter B, give discount 5% B)If the person renting the house is of age > 65 years old, give additional discount of X%, where X is the last two digits of your student ID (Student ID = 8)

5)total_payment is calculated as: total_payment = annual_rent*rent_length*(1-discount/100) + late_months * monthly_fine.

6)info() method should print the info of a unit including the personal data of the owner of the rented unit as shown below (Hint: call method calc_payment() from inside info() method to update total_payment attribute before printing anything)

an object of Person class. 2)Default values: late_months = 0, annual_rent =

When the above code is run,you should obtain the display

1200, monthly_fine = 100, rent_length = 0, and total_payment = 0 3)extend()

*Subject : Object-Oriented Programming *Program Language : Python

Create two classes as defined in the following UML diagram \begin{tabular}{|l|l|} \hline \multicolumn{1}{|c|}{ Person } & \multicolumn{1}{|c|}{ RentHouse } \\ \hline \( \begin{array}{l}\text { name } \\ \text { age } \\ \text { phone_number } \\ \text { marital_status }\end{array} \) & \( \begin{array}{l}\text { owner } \\ \text { unit_name } \\ \text { annual_rent } \\ \text { late_months } \\ \text { monthly_fine } \\ \text { discount } \\ \text { total_payment } \\ \text { rent_length }\end{array} \) \\ \hline \( \begin{array}{l}\text { init_(name, age, } \\ \text { phone_number, marital_status) }\end{array} \) \\ \( \begin{array}{l}\text { set_name(name) } \\ \text { set_age(name) } \\ \text { set_phone_number(phone_num) } \\ \text { set_marital_status(status) } \\ \text { get_name() } \\ \text { get_age() } \\ \text { get_phone_number() } \\ \text { get_marital_status() }\end{array} \) & \( \begin{array}{l}\text { init__wner, unit_name,...) } \\ \text { set_owner(new_owner) } \\ \text { set_unit_name(unit_name) } \\ \text { set_annual_rent(rent) } \\ \text { set_late_months(months) }\end{array} \) \\ \( \begin{array}{l}\text { calc_payment() } \\ \text { extend() }\end{array} \) \\ get_owner_name() \\ get_unit_name() \\ get_annual_rent() \\ get_late_months() \\ get_monthly_fine() \\ get_rental_length() \\ get_discount() \\ get_total_payment() \\ \hline \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!