Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This will be the Loan server class public class Loan { private double annualInterestRate; private int numberOfYears; private double loanAmount; private java.util.Date loanDate; //Default construct

image text in transcribed

This will be the Loan server class

public class Loan

{

private double annualInterestRate;

private int numberOfYears;

private double loanAmount;

private java.util.Date loanDate;

//Default construct

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;

}

/*

* sets the annual interest rate

*/

public void setAnnualInterestRate(int annualInterestRate)

{

this.annualInterestRate = annualInterestRate;

}

/*

* this will return the number of years

*/

public double getNumberOfYears()

{

return numberOfYears;

}

/*

*this will set the number of years

*/

public void setNumberOfYears(int numberOfYears)

{

this.numberOfYears = numberOfYears;

}

/*

* this gets the loan amount

*/

public double getLoanAmount()

{

return loanAmount;

}

/*

* this will set the loan amount

*/

public void setLoanAmount(double loanAmount)

{

this.loanAmount = loanAmount;

}

/*

* Find the monthly payment

*/

public double getMonthyPayment()

{

double monthlyInterestRate= annualInterestRate/1200;

double monthlyPayment= loanAmount*

monthlyInterestRate/ (1- (1 / Math.pow(1 + monthlyInterestRate, numberOfYears * 12)));

return monthlyPayment;

}

/*

* Find total payment

*/

public double getTotalPayment()

{

double totalPayment = getMonthyPayment() * numberOfYears * 12;

return totalPayment;

}

/*

* Return loan date

*/

public java.util.Date getLoanDate()

{

return loanDate;

}

}

Loan Server: Write a server program to handle client requests for calculation of Loan payment amounts. The client sends loan information (annual interest rate, number of years, and loan amount) to the server. The server computes the monthly payment and total payment (using a simple interest calculation) and sends them back to the client. Create a simple User Interface (UI) for the client program to enter the loan information and submit the request to server. The payment information sent by the server should be displayed on the client Ul Use a Loan class that has annual interest rate, number of years, and loan amount as its data fields and pass the Loan object to the server. The server should be able to handle multiple clients. Submit the following files: Loan.java LoanServer.java LoanClient.java Loan Server: Write a server program to handle client requests for calculation of Loan payment amounts. The client sends loan information (annual interest rate, number of years, and loan amount) to the server. The server computes the monthly payment and total payment (using a simple interest calculation) and sends them back to the client. Create a simple User Interface (UI) for the client program to enter the loan information and submit the request to server. The payment information sent by the server should be displayed on the client Ul Use a Loan class that has annual interest rate, number of years, and loan amount as its data fields and pass the Loan object to the server. The server should be able to handle multiple clients. Submit the following files: Loan.java LoanServer.java LoanClient.java

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

Intelligent Information And Database Systems 6th Asian Conference Aciids 2014 Bangkok Thailand April 7 9 2014 Proceedings Part I 9 2014 Proceedings Part 1 Lnai 8397

Authors: Ngoc-Thanh Nguyen ,Boonwat Attachoo ,Bogdan Trawinski ,Kulwadee Somboonviwat

2014th Edition

3319054759, 978-3319054759

More Books

Students also viewed these Databases questions

Question

Define marketing.

Answered: 1 week ago

Question

What are the traditional marketing concepts? Explain.

Answered: 1 week ago

Question

Define Conventional Marketing.

Answered: 1 week ago

Question

Define Synchro Marketing.

Answered: 1 week ago