Professional Documents
Culture Documents
Design:
Declare the variables to store users inputs. Prompt user for loan amount and
number of years. Display the interest rate from 5% to 8% in 1/8 increments and
convert the number of years into the number of months. This equation
Coding:
//////////////////////////////////////////////////////////////////////////////
/
// ALL STUDENTS COMPLETE THESE SECTIONS
// Title: Project 4
// Files: ComparingLoans.java
// Semester: Fall 2015
//
// Author: Stephanie Nguyen
// Email: sxn146130@utdallas.edu
// CS Login: sxn146130
// Lecturer's Name: Dr. Nassim Sohaee
// Course Section: 002
//
//////////////////// STUDENTS WHO GET HELP FROM OTHER THAN THEIR
PARTNER //////
// fully acknowledge and credit all sources of help,
// other than Instructors and TAs.
//
// Persons: NA
//
// Online sources: http://www.mathwarehouse.com/compound-interest/formulacalculate.php
// Web site used to find the compound interest formula, A = P(1+r/n)^nt
// http://www.bankrate.com/calculators/mortgages/loan-calculator.aspx
// Web site used for loan calculator to calculate monthly payment by entering
in the variables
//
// Dr. Sohaee, I used the formula and calculator from the above sources and
cannot seem to get the same monthly and total payment amount as the sample
provided.
//
//////////////////////////// 80 columns
wide //////////////////////////////////
import java.util.Scanner;
/**
* Reading two inputs from user to compute and display the monthly and total
payment according to each interest rate
*
* <p>Bugs: inputing a letter for a numerical value will result in the program
crashing
*
* @author Stephanie Nguyen
*/
public class ComparingLoans {
/**
* Entry point for Comparing Loans program
*
* @param args is not used
* @return no return value
*/
Testing:
I used the input values given in the sample for Loan Amount and Number of Years to
run the program to see if it displays the same Monthly and Total Payment as the
sample.