Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Your team has been hired as a Java programmer by Real Estates Solutions Inc. Your task is to write a Java applet for their web site that would enable customers to figure out their monthly mortgage payments.

The applet input will be the loan amount, annual percentage rate or APR, and the number of years to pay out the loan. The output will be: the monthly payment amount, the number of payments, the total paid including interest, and total interest paid.

The calculations were provided to you by a real estate agent:

p, loan amount or principal
n, number of payments = payments per year * number of years
i, interest per period = apr/payments per year = apr/12
r, monthly payment amount = principal * interest per period / (1-(1+(interest per period)/100)^(number of payments-1)^2)
Hint: In Java syntax the monthly payment calculation is:

r=((p*(i/100))/(1-(Math.pow((1+(i/100)),(n*(-1))))));
Details:

Please note that your program should accept three inputs:

The loan amount,
Annual percentage rate or APR, and
The number of years to pay out the loan
And calculate four outputs:

The monthly payment amount,
Number of payments,
The total paid including interest, and
Total interest paid

When coding your applet, remember the following:

Your applet needs to extend the Applet (or JApplet) class. Of course, you need to import the appropriate applet package(s).
Your applet needs to have declarations for the fields, labels, components, widgets, etc. that you use in the applet.
There are applet methods that are called automatically by browsers. Make sure you initialize (implement init()) your applet.
You need the code that does the calculation of the interest.
You need to handle the event of pressing the button.
Please create an HTML page that contains the applet tag. In addition to your mortgage calculator commented Java code, you need to provide the HTML page.

Here is an example given to me from a facilitator to create an applet:

--------------------------------------------------------------------------------

mport java.applet.*;
import java.awt.*;
/**
* The HelloWorld class implements an applet that
* simply displays "Hello World!".
*/
public class HelloWorld extends Applet {
public void paint(Graphics g){
// Display "Hello World!"
g.drawString("Hello world!", 50, 25);
}
}

--------------------------------------------------------------------------------

Then you would compile the class and create an HTML page called Hello.htm (ignore the periods, they're there to make the HTML code viewable):

--------------------------------------------------------------------------------

<.HTML>
<.HEAD>
<.TITLE>A Simple Program<./TITLE>
<./HEAD>
<.BODY>

Here is the output of my program:

<.APPLET CODE="HelloWorld.class" WIDTH=150 HEIGHT=25>
<./APPLET>
<./BODY>
<./HTML>

Java, Programming

  • Category:- Java
  • Reference No.:- M91612574
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Java

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Answer the following question whats the difference public

Answer the following Question : What's the difference public inheritance and private inheritance? What can derived classes inherit from base classes? What cannot be inherited from base classes?

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Object-oriented software development1 introduction 11

OBJECT-ORIENTED SOFTWARE DEVELOPMENT 1. Introduction 1.1 Assignment Requirement 1.2 Deliverables and Structure (what to submit) 1.3 Software Restrictions 1.4 How to score high... 1.5 Assumptions 2. System Requirements 2. ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As