Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

My output display this: Mortgagecalculator@7ced01

The output should display Years: 30, Loan Amount $200000.00, Interest Rate: .0575, and Monthly Payment: Calculated by Math.POW. Then a list of loan balance and interest paid for each payment over the term of the loan should scroll off the screen, but need loops to display a partial list, hesitate and then display more of the list. Do not use a graphical user interface. Please insert comments in the program so I can understand the fixes.

The setter and getters must stay in MortgageCalculator.java and everything should output from main (Driver.java).

FILE: DRIVER.JAVA

import java.util.*;
/***Created on June 27, 2004, 5:07 PM
* Java Programming Project Workshop 3 -
* Problem statement - Create a driver for the Mortgage Calculator
* Scope - declare, initialize and set values and display mortgage calculator
* @author TERRY PARKER
*/
public class Driver {

/**
* @param args the command line arguments
*/
public static void main(String args[]){//The main part of Mortgage Calculator begins here
Mortgagecalculator mCalc;
mCalc = new Mortgagecalculator();
mCalc.setYears(30);
mCalc.setLoanAmount(200000.0);
mCalc.setInterestRate(.0575);
System.out.println(mCalc.toString());//Display the contents
}//end of group
}//closing bracket

FILE: MORTGAGE CALCULATOR.JAVA

/** mortgagecalculator.java
* Created on June 27, 2004, 5:07 PM
* Java Programming Project Workshop 2 -
* Problem statement - Create a Mortgage Calculator WITHOUT a graphical user interface
* Purpose - provide a user-friendly service to potential users for accurately planning mortgage and other types of loans
* Scope - The mortgage calculator must display the mortgage payment amount given the amount of the mortgage, the term of the mortgage, and the interest rate of the mortgage.
* This program must have hard code amount = 200,000, term= 30 years, and the interest rate = 5.75% in class driver.java
* Algorithm - standard loan calculation with fixed number of payments:
* Monthly Payment = Principal * (InterestRate / (1 - (InterestRate + 1) - 12 * Periods)
*
* Inputs:
* Principal = $200,000
* Interest Rate = 0.0575
* Periods = 360
*
* Output:
* Monthly Payment =
*
* @author TERRY PARKER
* NETBEANS IDE 3.6*/

public class Mortgagecalculator{

/** Creates a static mortgagecalculator */

public int years;//define variables
public double loanAmount;
public double interestRate;
public double monthlyPayment;

public void setYears(int inYears)//setter
{
years=inYears;
}//end set years

public int getYears()//getter
{
return years;
}//end get years

public void setLoanAmount(double inLoanAmount)//setter
{
loanAmount=inLoanAmount;
}//end set loanAmount

public double getLoanAmount()//getter
{
return loanAmount;
}//end get loanAmount

public void setInterestRate(double inInterestRate)//setter
{
interestRate=inInterestRate;
}//end set interestRate

public double getInterestRate()//getter
{
return interestRate;
}//end get interestrate

public void CalcMonthlyPayment()
{
monthlyPayment=loanAmount*Math.pow(1 + interestRate, years) * interestRate/(Math.pow(1 + interestRate, years) -1);
}

public String toString(double value){//strings are used to store text and variables
String retString = new String();
retString = "Values:";
retString = retString + " years=" + years;
retString = retString + " loanAmount=" + loanAmount;
retString = retString + " interestRate=" + interestRate;
retString = retString + " monthlyPayment=" + monthlyPayment;
return retString;
}//end group
}//closing bracket

Java, Programming

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

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Java

Can someone please help me with the following java

can someone please help me with the following java question The input is an N by N matrix of nonnegative integers. Each individual row is a decreasing sequence from left to right. Each individual column is a decreasing s ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

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?

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 ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

  • 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