Object-Oriented Programming Loan Calculator: MITS4002 Activity 7

Verified

Added on  2025/04/29

|6
|363
|191
AI Summary
Desklib provides past papers and solved assignments for students. This solved assignment demonstrates a loan calculator program.
Document Page
MITS4002 ACTIVITY 7 – 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
MITS4002 ACTIVITY 7 – OBJECT-ORIENTED SOFTWARE DEVELOPMENT....................1
List of Figure...................................................................................................................................2
Analysis...........................................................................................................................................3
Design..............................................................................................................................................3
Coding..............................................................................................................................................3
Output screenshot............................................................................................................................5
Testing.............................................................................................................................................5
List of Figure
Figure 1: Output for Program..........................................................................................................5
Figure 2: Testing Sample.................................................................................................................6
Document Page
Analysis
This assignment problem is having the calculation for monthly payment & total complete
payment for the load. This load period is undergone with specific interest rate. The range for the
interest rate is varying from the 5 % to the 8 %, with an increment of 1 / 8 or 0.125. For the
completion of the assignment, you have to take the values from user in term of amount for loan
with the time period in the value of years.
Design
Here, below is the major steps for solving this problem in which I have undergone & these are as
follows:
First of all carefully read the problem and analyze them what are the input values as well as
formula or logic which is used.
After that, take the values from user by using the scanner class & its object or instance.
Now, generate your logic according to the need & requirement of the logic.
After that, perform the various input for proper verification & validation. Such that the quality is
measured & ensured by fulfilling the testing.
Coding
Here, below is the source code of problem statement which is mentioned and it is:
import java.util.*;
import java.lang.*;
public class Activity7{
public static void main(String []args)
{
double amount, year;
double i,finalamount,totalamount;
Document Page
Scanner s = new Scanner(System.in);
System.out.println("Enter Amount");
amount = s.nextDouble();
System.out.println("Enter Year");
year = s.nextDouble();
System.out.println("Interest Rate" + " "+"Monthly Payment" + "
" + "Total Payment");
while(i<=8)
{
finalamount = (amount*0.01*i)/(1-(1/(Math.pow((1+0.01*i),
(12*year)))));
totalamount = finalamount*12*year;
System.out.println( i + " "+ finalamount + " " +
totalamount);
i=i+0.125;
}
}
}
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: Output for Program
Testing
For the different testing aspect, I have undergone with process of taking all different various
inputs and verified that it is fulfilling all the requirement with the output. And, the formula which
is applied is generating proper output.
Document Page
Figure 2: Testing Sample
chevron_up_icon
1 out of 6
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]