
    g                     2    d Z  G d d      Z	  G d d      Zy)z~
Problem 2: BMI Calculator
Write a class called Person that has 3 attributes: name, height, and weight. The class should have
c                   &    e Zd ZdZd Zed        Zy)Personz
    A class representing a person with name, height (in meters), and weight (in kilograms).
    The BMI (Body Mass Index) is dynamically calculated using the formula:
        BMI = weight / (height ** 2)
    c                 .    || _         || _        || _        y N)nameheightweight)selfr   r   r   s       @c:\WORK\www\ai.huynhdous.com\UCI\Inter_Python\week_5_homework.py__init__zPerson.__init__   s    	    c                 :    | j                   | j                  dz  z  S )z-Calculates and returns the BMI of the person.   )r   r   )r	   s    r
   BMIz
Person.BMI   s     {{dkkQ.//r   N)__name__
__module____qualname____doc__r   propertyr    r   r
   r   r      s     
 0 0r   r   c                       e Zd ZdZd Zd Zy)LinearModelz
    A class representing a simple linear model following the equation:
        y = mx + b
    where:
        - m is the slope
        - b is the intercept
        - x is the input variable
    c                      || _         || _        y r   mb)r	   r   r   s      r
   r   zLinearModel.__init__%   s    r   c                 :    | j                   |z  | j                  z   S )zRReturns the predicted value y for the given input x using the equation y = mx + b.r   )r	   xs     r
   predictzLinearModel.predict)   s    vvzDFF""r   N)r   r   r   r   r   r   r   r   r
   r   r      s    #r   r   N)r   r   r   r   r   r
   <module>r      s#   0 0"# #r   