Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help writing a java program to: 1. To calculate monthly payment 2. To print out monthly payment and total interest payment for the

I need help writing a java program to: 1. To calculate monthly payment 2. To print out monthly payment and total interest payment for the duration of loan rounded to its nearest integer.

A person has taken a loan of $6000.00 for a fixed annual interest rate of 6% for 5 years with no down payment. The monthly payment has been fixed at $116.00 for entire term of the loan. Here is the formula to calculate monthly fixed payment:

P = (monthly rate * Loan amount) / (1 - (1+monthly interest rate)^-n) Here n is no of payment periods. 

If the input (of text file) is 6000~5~6~0 the output should give $116.00~$960. If the input is 5000~5~6~0 the output should give $96.66~$800

image text in transcribed

Since the input is from a text file, my proffessor said I should start with the following

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets;

public class Main { /** * Iterate through each line of input. */ public static void main(String[] args) throws IOException { InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8); BufferedReader in = new BufferedReader(reader); String line; while ((line = in.readLine()) != null) { System.out.println(line); } } }

r(PV) 1-(1r)- P = Payment PV = Present Value ate per period number of periods n

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_2

Step: 3

blur-text-image_3

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

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions

Question

What was your favorite subject in school?

Answered: 1 week ago

Question

Please try to give correct answer 1 0 3 . 6 . 5 1 3 0 0 1 9 . 5

Answered: 1 week ago