Loan Calculator Application Design and Implementation
VerifiedAdded on  2025/09/04
|11
|695
|269
AI Summary
Desklib provides solved assignments and past papers to help students succeed.

Table of Contents
Design........................................................................................................................................2
Coding........................................................................................................................................3
Output.........................................................................................................................................7
Self-Evaluation...........................................................................................................................7
Design........................................................................................................................................2
Coding........................................................................................................................................3
Output.........................................................................................................................................7
Self-Evaluation...........................................................................................................................7
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Design
The application is created to interact with the user. The user interface of this
application is created which allow the user to calculate the monthly and finally
amount for the amount entered in the text field. This interface include the text
field, text area, scroll and labels in the application.
The application is created to interact with the user. The user interface of this
application is created which allow the user to calculate the monthly and finally
amount for the amount entered in the text field. This interface include the text
field, text area, scroll and labels in the application.

Coding
// imported to create the button in the window application.
import javafx.scene.control.Button;
// imported to creatre the border pane in the appplication window.
import javafx.scene.layout.BorderPane;
//imported in order to intilaize the screen in the window application
import javafx.scene.Scene;
// imported to create the textarea componenet in the application window.
import javafx.scene.control.TextArea;
//interface of the program intalizer
import javafx.application.Application;
// imported to created the labels in the window application.
import javafx.scene.control.Label;
// imported in order to create the = stage in the application window.
import javafx.stage.Stage;
// imported to create the textfields in the application window.
import javafx.scene.control.TextField;
// imported to create the scroll component
import javafx.scene.control.ScrollPane;
// imported to create the horizontal box in the application wondow.
import javafx.scene.layout.HBox;
//imported to manage the position of the window application components.
import javafx.geometry.Pos;
// the loanscomparing class is created to create the application
public class loanscomparing extends Application {
// created and intialize the textfield for the value of loan application
TextField loan_value = new TextField();
// created and intialize the textfield for the value of years application
// imported to create the button in the window application.
import javafx.scene.control.Button;
// imported to creatre the border pane in the appplication window.
import javafx.scene.layout.BorderPane;
//imported in order to intilaize the screen in the window application
import javafx.scene.Scene;
// imported to create the textarea componenet in the application window.
import javafx.scene.control.TextArea;
//interface of the program intalizer
import javafx.application.Application;
// imported to created the labels in the window application.
import javafx.scene.control.Label;
// imported in order to create the = stage in the application window.
import javafx.stage.Stage;
// imported to create the textfields in the application window.
import javafx.scene.control.TextField;
// imported to create the scroll component
import javafx.scene.control.ScrollPane;
// imported to create the horizontal box in the application wondow.
import javafx.scene.layout.HBox;
//imported to manage the position of the window application components.
import javafx.geometry.Pos;
// the loanscomparing class is created to create the application
public class loanscomparing extends Application {
// created and intialize the textfield for the value of loan application
TextField loan_value = new TextField();
// created and intialize the textfield for the value of years application
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

TextField year_value = new TextField();
// created and intialize the textfield for the space of loan application
TextArea value_of_space = new TextArea();
@Override
// methods created for first stage intialization
public void start(Stage satgefirst) {
// define the value of the column count.
year_value.setPrefColumnCount(2);
// define the value of the column count for the loan_value.
loan_value.setPrefColumnCount(7);
// define the value of the column count for the space.
value_of_space.setPrefColumnCount(30);
// button is genearted by creating the object of the Button.
Button btn= new Button("Calculate");
// horizontal box is created by creating the object.
HBox ctrl = new HBox();
// set the alignmnet
ctrl.setAlignment(Pos.CENTER);
//set the space
ctrl.setSpacing(9);
// defining the labels for the application window.
// created and intialize the textfield for the space of loan application
TextArea value_of_space = new TextArea();
@Override
// methods created for first stage intialization
public void start(Stage satgefirst) {
// define the value of the column count.
year_value.setPrefColumnCount(2);
// define the value of the column count for the loan_value.
loan_value.setPrefColumnCount(7);
// define the value of the column count for the space.
value_of_space.setPrefColumnCount(30);
// button is genearted by creating the object of the Button.
Button btn= new Button("Calculate");
// horizontal box is created by creating the object.
HBox ctrl = new HBox();
// set the alignmnet
ctrl.setAlignment(Pos.CENTER);
//set the space
ctrl.setSpacing(9);
// defining the labels for the application window.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

ctrl.getChildren().addAll(new Label("Loan Amount"), loan_value, new Label("Number
of Years"),year_value, btn);
ScrollPane scrlpane;
// the scroll pane object is created.
scrlpane = new ScrollPane(value_of_space);
// the object is created for the Border pane.
BorderPane brdrpn= new BorderPane();
//set brdpn
brdrpn.setTop(ctrl);
// to set the values in the centre
brdrpn.setCenter(value_of_space);
// action of button defined
btn.setOnAction(b -> {
represent();
});
// object is created for the Scene.
Scene tn = new Scene(brdrpn);
// the scen is set
satgefirst.setScene(tn);
// title of the window application is set.
satgefirst.setTitle("Comparing Loans");
// print the stage initial
satgefirst.show();
}
// define the represent method.
private void represent(){
// local variable
of Years"),year_value, btn);
ScrollPane scrlpane;
// the scroll pane object is created.
scrlpane = new ScrollPane(value_of_space);
// the object is created for the Border pane.
BorderPane brdrpn= new BorderPane();
//set brdpn
brdrpn.setTop(ctrl);
// to set the values in the centre
brdrpn.setCenter(value_of_space);
// action of button defined
btn.setOnAction(b -> {
represent();
});
// object is created for the Scene.
Scene tn = new Scene(brdrpn);
// the scen is set
satgefirst.setScene(tn);
// title of the window application is set.
satgefirst.setTitle("Comparing Loans");
// print the stage initial
satgefirst.show();
}
// define the represent method.
private void represent(){
// local variable

String finrslt;
// Result intialized
finrslt = "";
// local variables are created for double data type.
double monthinterest;
double paymnth;
// print the columns name
finrslt+="Interest Rate Monthly Payment Total Payment \n";
// loop is created to calculate the interest.
for (double j = 5.0; j <= 8; j += 0.125){
// monthinterest calculation
monthinterest=j/1200;
// calculation of the payment.
paymnth=Double.parseDouble(loan_value.getText())*monthinterest/(1-1/
Math.pow(1+monthinterest, Double.parseDouble(year_value.getText())*12));
// final result calculated.
finrslt+=String.format("%-34.3f%-30.2f%-8.3f\n",j, paymnth,
(paymnth*12)*Double.parseDouble(year_value.getText()));
}
// represent the result
value_of_space.setText(finrslt);
}
public static void main(String[] args) {
launch(args);
}
}
// Result intialized
finrslt = "";
// local variables are created for double data type.
double monthinterest;
double paymnth;
// print the columns name
finrslt+="Interest Rate Monthly Payment Total Payment \n";
// loop is created to calculate the interest.
for (double j = 5.0; j <= 8; j += 0.125){
// monthinterest calculation
monthinterest=j/1200;
// calculation of the payment.
paymnth=Double.parseDouble(loan_value.getText())*monthinterest/(1-1/
Math.pow(1+monthinterest, Double.parseDouble(year_value.getText())*12));
// final result calculated.
finrslt+=String.format("%-34.3f%-30.2f%-8.3f\n",j, paymnth,
(paymnth*12)*Double.parseDouble(year_value.getText()));
}
// represent the result
value_of_space.setText(finrslt);
}
public static void main(String[] args) {
launch(args);
}
}
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Output
Figure 1 Output
Self-Evaluation
Is the UI created correctly?
The user interface successfully created to implement all the functionalities which are required
in this application. Any user can successfully interact with the user and calculate the monthly
and final amount based on the entered amount and year values.
Figure 2 self-evaluation 1
Figure 1 Output
Self-Evaluation
Is the UI created correctly?
The user interface successfully created to implement all the functionalities which are required
in this application. Any user can successfully interact with the user and calculate the monthly
and final amount based on the entered amount and year values.
Figure 2 self-evaluation 1
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Figure 3 self-evaluation 2
Are the values computed correctly?
The monthly and final payment is successfully calculated by the application based on the
entered amount and the number of years. The value is calculated by the interest rate defining
in the application.
Figure 4 self-evaluation 3
Are the values computed correctly?
The monthly and final payment is successfully calculated by the application based on the
entered amount and the number of years. The value is calculated by the interest rate defining
in the application.
Figure 4 self-evaluation 3

Figure 5 self-evaluation 4
Is the table displayed correctly?
The calculated values are properly aligned in the tables. The table contains three columns
interest rate, monthly payment, and the total payment. The values are mentioned in the tables
contain which are associated to each other.
Figure 6 self-evaluation 5
Is the table displayed correctly?
The calculated values are properly aligned in the tables. The table contains three columns
interest rate, monthly payment, and the total payment. The values are mentioned in the tables
contain which are associated to each other.
Figure 6 self-evaluation 5
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Figure 7 self-evaluation 6
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

1 out of 11

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.