fixed Makefile, updated driver
git-svn-id: svn://anubis/gvsu@73 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
parent
44793226d8
commit
a28700667a
@ -8,6 +8,8 @@ public class LoanApplication
|
||||
|
||||
public void run()
|
||||
{
|
||||
PrintSpooler spooler = PrintSpooler.getSpooler();
|
||||
|
||||
try
|
||||
{
|
||||
for (;;)
|
||||
@ -26,6 +28,22 @@ public class LoanApplication
|
||||
|
||||
System.out.print("Enter the principal balance: ");
|
||||
double principal = Double.parseDouble(br.readLine());
|
||||
|
||||
int type = 0;
|
||||
while (type < 1 || type > 2)
|
||||
{
|
||||
System.out.println("Please select whether the loan is a simple interest loan or an amortized loan:");
|
||||
System.out.println("Select:");
|
||||
System.out.println(" 1) simple interest loan");
|
||||
System.out.println(" 2) amortized loan");
|
||||
type = Integer.parseInt(br.readLine());
|
||||
}
|
||||
|
||||
Loan loan = (type == 1)
|
||||
? new SimpleLoan(name, rate, years, principal)
|
||||
: new AmortizedLoan(name, rate, years, principal);
|
||||
|
||||
spooler.printDocument(loan.process());
|
||||
}
|
||||
}
|
||||
catch (Exception e) { }
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
all: *.class
|
||||
all: $(patsubst %.java,%.class,$(wildcard *.java))
|
||||
|
||||
%.class: %.java
|
||||
javac $^
|
||||
|
Loading…
x
Reference in New Issue
Block a user