Mod 2. Change the loan calculation statement to a method call statement.
a. Currently the program calculates the property's monthly loan payment by using the annual
interest rate, the loan amount and the number of years for the loan in the calculation given.
Comment out this calculation.
b. You need to replace this monthly payment calculation statement with a statement that calls the
method calculatePayment and passes the appropriate parameters to the method.
c. You must pass four parameters to the calculatePayment method: (1) property cost (type
double), (2) down payment (type double), and (3) number of years (integer), and (4) type of
property (type char).
d. The calculatePayment method is described in the next numbered item below.
7. Mod 3. Write the calculatePayment method. Write the code for the method
named calculatePayment.
. Place this method definition code below the main method of the existing program
class.
. Include the modifier static in the method header.
The calculatePayment method must:
a. Take four parameters as input: (1) property cost (type double), (2) down payment (type
double), and (3) number of years (integer), and (4) type of property (type char).
b. Declare a local variable: annualInterestRate, 7.5% of type double.
c. Calculate payment by using the formula given in the main method. Note: For Lab
Exercise Part A, the property type is not used in the payment calculation. In Lab Part B, the
property type will be used.
d. Return a result of type double, namely the calculated payment for the month.
8. Mod 4. Write the getPropertyTypeName method.
. Place this method definition code below the main method of the existing program
class.
. Include the modifier static in the method header.
The getPropertyTypeName method must:
a. Take one parameter as input: the property type as a value of type char.
b. Determine the full name of the property type: Residential, Commercial, or Agricultural.
c. Return the full name of the property type as a string.
9. Mod 5. Display information on all properties. Your program must display all the information
on all the properties, one property per line. Use an output string as in previous lab exercises. For
each property, the displayed information must include the following on one line, with each item
labeled:
a. The property cost.
b. The loan amount.
c. The type of property (Residential, Commercial, or Agricultural). Call the
getPropertyTypeName method to get the full name of the property type for each property. Pass
the value of the variable propertyType as parameter to the method.
d. The calculated payment for the month.
e. The number of years for the loan.
10. Mod 6. Apply formatting to all displayed monetary values of type double so that they always
show a dollar sign and show two digits to the right of the decimal. To implement the formatting,
follow the instructions provided in Lab assignment #2.