Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA OR JAVAFX, NO PICTURE CODE PLS Loan.java // Implements Seriablizable to support object IO public class Loan implements java.io.Serializable { private double annualInterestRate; private

JAVA OR JAVAFX, NO PICTURE CODE PLS

image text in transcribed

Loan.java

// Implements Seriablizable to support object IO public class Loan implements java.io.Serializable { private double annualInterestRate; private int numberOfYears; private double loanAmount; private java.util.Date loanDate;

/** Default constructor */ public Loan() { this(2.5, 1, 1000); }

/** Construct a loan with specified annual interest rate, number of years and loan amount */ public Loan(double annualInterestRate, int numberOfYears, double loanAmount) { this.annualInterestRate = annualInterestRate; this.numberOfYears = numberOfYears; this.loanAmount = loanAmount; loanDate = new java.util.Date(); }

/** Return annualInterestRate */ public double getAnnualInterestRate() { return annualInterestRate; }

/** Set a new annualInterestRate */ public void setAnnualInterestRate(double annualInterestRate) { this.annualInterestRate = annualInterestRate; }

/** Return numberOfYears */ public int getNumberOfYears() { return numberOfYears; }

/** Set a new numberOfYears */ public void setNumberOfYears(int numberOfYears) { this.numberOfYears = numberOfYears; }

/** Return loanAmount */ public double getLoanAmount() { return loanAmount; }

/** Set a newloanAmount */ public void setLoanAmount(double loanAmount) { this.loanAmount = loanAmount; }

/** Find monthly payment */ public double getMonthlyPayment() { double monthlyInterestRate = annualInterestRate / 1200; double monthlyPayment = loanAmount * monthlyInterestRate / (1 - (Math.pow(1 / (1 + monthlyInterestRate), numberOfYears * 12))); return monthlyPayment; }

/** Find total payment */ public double getTotalPayment() { double totalPayment = getMonthlyPayment() * numberOfYears * 12; return totalPayment; }

/** Return loan date */ public java.util.Date getLoanDate() { return loanDate; } }

16.21 (Count-down stopwatch) Write a program that allows the user to enter time in seconds in the text field and press the Enter key to count down the see- onds, as shown in Figure 16.45d. The remaining seconds are redisplayed every second. When the seconds are expired, the program starts to play music continuously

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions

Question

4. Describe three kinds of personality units that are not traits.

Answered: 1 week ago