|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectMortgage
public class Mortgage
Mortgage.java
Solution for CS 201 HW 1 problem 1
Program to calculate and print the monthly mortgage payment for a given principal, interest rate, and loan duration
Documentation copied from sample documentation by Daniel Scharstein
| Constructor Summary | |
|---|---|
Mortgage()
|
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
Main simply calls test method. |
static double |
mortgage(double principal,
double interest,
double years)
Calculates monthly mortgage from parameters. |
static void |
print(double principal,
double interest,
double years)
Prints one-line information about mortgage. |
static void |
test()
Prints information about mortgages for interest rates between 5 and 10 in 0.25 increments. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Mortgage()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
public static double mortgage(double principal,
double interest,
double years)
principal - the principal in dollarsinterest - the interest in percentyears - the duration of the mortgage in years
public static void print(double principal,
double interest,
double years)
principal - the principal in dollarsinterest - the interest in percentyears - the duration of the mortgage in yearspublic static void test()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||