Object-Oriented Software Development Project: Loan Calculator
VerifiedAdded 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.

OBJECT-ORIENTED SOFTWARE
DEVELOPMENT
DEVELOPMENT
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Table of Contents
Analysis:......................................................................................................................................................3
Design:........................................................................................................................................................3
Coding:........................................................................................................................................................3
Output Screenshot:.....................................................................................................................................5
Testing:........................................................................................................................................................6
Analysis:......................................................................................................................................................3
Design:........................................................................................................................................................3
Coding:........................................................................................................................................................3
Output Screenshot:.....................................................................................................................................5
Testing:........................................................................................................................................................6

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:");
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:");
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

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;
}
}
}
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;
}
}
}
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Output Screenshot:
Figure 1: Code 1
Figure 1: Code 1

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.
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.
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 6
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.