Object-Oriented Software Development Project: Loan Calculator

Verified

Added on  2025/04/29

|6
|327
|224
AI Summary
Desklib provides past papers and solved assignments for students. This project demonstrates object-oriented programming using a loan calculator.
Document Page
OBJECT-ORIENTED SOFTWARE
DEVELOPMENT
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Table of Contents
Analysis:......................................................................................................................................................3
Design:........................................................................................................................................................3
Coding:........................................................................................................................................................3
Output Screenshot:.....................................................................................................................................5
Testing:........................................................................................................................................................6
Document Page
Analysis:
This assignment is based on the implementation of the object oriented programming language.
There are a program given in this assignment which is based on the comparing loan in which
the user has to enter an amount and the total number of years and then the interest of the rate
will be display including monthly payment and total payment. The interest rate will be follow
the percentage of 5% to 8%.
Design:
Initialize the variables
Take input form the user by using scanning class
Apply while loop and implement the formula.
Coding:
/*
* To change this license header, choose License Headers in Project
Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package
mansingh.mits4002.activity.pkg7.object.oriented.software.development;
import java.util.*;
import java.text.DecimalFormat;
import java.lang.*;
/**
*
* @author TechnoFreak
*/
public class
MANSINGHMITS4002ACTIVITY7OBJECTORIENTEDSOFTWAREDEVELOPMENT {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
double amount, year;
double interest_rate = 5;
double monthly_payment, total_payment;
DecimalFormat decimal = new DecimalFormat(".###");
Scanner scan = new Scanner(System.in);
System.out.println("Loan Amount:");
amount = scan.nextDouble();
System.out.println("Number of Years:");
Document Page
year = scan.nextDouble();
System.out.println(String.format("%-18s %-18s %-18s",
"Interest Rate", "Monthly Payment", "Total Payment"));
System.out.println("--------------------------------------------------
----");
while (interest_rate <= 8) {
monthly_payment = (amount * 1.0 / 100 * interest_rate /
12)
/ (1 - (1 / (Math.pow((1 + 1.0 / 100 *
interest_rate / 12), (12 * year)))));
total_payment = monthly_payment * 12 * year;
System.out.println(String.format("%-18s %-18s %-18s",
interest_rate,
decimal.format(monthly_payment),
decimal.format(total_payment)));
System.out.println("");
interest_rate = interest_rate + 1.0 / 8;
}
}
}
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Output Screenshot:
Figure 1: Code 1
Document Page
Figure 2: Code 2
Testing:
This program is tested successfully. The program is successfully taking information from the
user and providing the output clearly. We have implemented decimal format to provide the
similar gap difference between the header of the program.
chevron_up_icon
1 out of 6
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]