MITS4002 Object-Oriented Software Development Activity 9
VerifiedAdded on  2025/09/04
|9
|383
|150
AI Summary
Desklib provides solved assignments and past papers for students.

MITS4002 OBJECT-ORIENTED
SOFTWARE DEVELOPMENT -
ACTIVITY 9
Student ID:
Student Name:
Total Points (20 pts):
SOFTWARE DEVELOPMENT -
ACTIVITY 9
Student ID:
Student Name:
Total Points (20 pts):
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Table of Contents
Design..............................................................................................................................................2
Code.................................................................................................................................................3
Output..............................................................................................................................................6
Self-Evaluation................................................................................................................................7
UI is correct or not?.....................................................................................................................7
Is the calculation correct?............................................................................................................7
The table is displayed correctly or not?.......................................................................................8
1
Design..............................................................................................................................................2
Code.................................................................................................................................................3
Output..............................................................................................................................................6
Self-Evaluation................................................................................................................................7
UI is correct or not?.....................................................................................................................7
Is the calculation correct?............................................................................................................7
The table is displayed correctly or not?.......................................................................................8
1

Design
The criteria of design was developed using the Balsamiq tool. Various elements in the Balsamiq
tool are used for creating the main interface of the Java GUI application. The design is listed
below.
Figure 1 Design
2
The criteria of design was developed using the Balsamiq tool. Various elements in the Balsamiq
tool are used for creating the main interface of the Java GUI application. The design is listed
below.
Figure 1 Design
2
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Code
/*Importing classes and functions from javafx library*/
import javafx.stage.Stage;import javafx.application.Application;
import javafx.scene.layout.HBox;import javafx.geometry.Pos;
import javafx.scene.layout.BorderPane;import javafx.scene.Scene;
import javafx.scene.control.TextField;import javafx.scene.control.Button;
import javafx.scene.control.TextArea;import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
/*End of import files*/
public class knowyourloan extends Application {
/*Decleration of instances*/
TextField loanof_user = new TextField();
TextArea obj_txt = new TextArea();
TextField loanperiod_ofuser = new TextField();
/*Function overriding in Java*/@Override
public void start(Stage showit) {
loanperiod_ofuser.setPrefColumnCount(3);
loanof_user.setPrefColumnCount(8);
obj_txt.setPrefColumnCount(41);
Button inst_but = new Button("Show Table");
HBox bx_obj = new HBox();
bx_obj.setAlignment(Pos.CENTER);
3
/*Importing classes and functions from javafx library*/
import javafx.stage.Stage;import javafx.application.Application;
import javafx.scene.layout.HBox;import javafx.geometry.Pos;
import javafx.scene.layout.BorderPane;import javafx.scene.Scene;
import javafx.scene.control.TextField;import javafx.scene.control.Button;
import javafx.scene.control.TextArea;import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
/*End of import files*/
public class knowyourloan extends Application {
/*Decleration of instances*/
TextField loanof_user = new TextField();
TextArea obj_txt = new TextArea();
TextField loanperiod_ofuser = new TextField();
/*Function overriding in Java*/@Override
public void start(Stage showit) {
loanperiod_ofuser.setPrefColumnCount(3);
loanof_user.setPrefColumnCount(8);
obj_txt.setPrefColumnCount(41);
Button inst_but = new Button("Show Table");
HBox bx_obj = new HBox();
bx_obj.setAlignment(Pos.CENTER);
3
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

bx_obj.setSpacing(10);
bx_obj.getChildren().addAll(new Label("Loan Amount"), loanof_user, new Label("Number
of Years"), loanperiod_ofuser, inst_but);
ScrollPane sc_inst;
sc_inst = new ScrollPane(obj_txt);
BorderPane borderobj = new BorderPane();
borderobj.setTop(bx_obj);
borderobj.setCenter(obj_txt);
inst_but.setOnAction(zx -> { showpanel(); });
Scene ceneobjt = new Scene(borderobj);
showit.setScene(ceneobjt);
showit.setTitle("KNOW YOUR LOAN");
showit.show();
}
/*Method for showing the panel and processing calculations*/
private void showpanel(){
String sampleobj="";
double monthlyrate_user,monthlypay_user;
/*Interface of the output*/
sampleobj+="Interest Rate\t\t\t\t\tMonthly Payment\t\t\t\t Total Payment \n";
/*for statement is used for calculations*/for (double
rate_bank=5.00;rate_bank<=8.00;rate_bank+=0.125){
monthlyrate_user=rate_bank/1200;
4
bx_obj.getChildren().addAll(new Label("Loan Amount"), loanof_user, new Label("Number
of Years"), loanperiod_ofuser, inst_but);
ScrollPane sc_inst;
sc_inst = new ScrollPane(obj_txt);
BorderPane borderobj = new BorderPane();
borderobj.setTop(bx_obj);
borderobj.setCenter(obj_txt);
inst_but.setOnAction(zx -> { showpanel(); });
Scene ceneobjt = new Scene(borderobj);
showit.setScene(ceneobjt);
showit.setTitle("KNOW YOUR LOAN");
showit.show();
}
/*Method for showing the panel and processing calculations*/
private void showpanel(){
String sampleobj="";
double monthlyrate_user,monthlypay_user;
/*Interface of the output*/
sampleobj+="Interest Rate\t\t\t\t\tMonthly Payment\t\t\t\t Total Payment \n";
/*for statement is used for calculations*/for (double
rate_bank=5.00;rate_bank<=8.00;rate_bank+=0.125){
monthlyrate_user=rate_bank/1200;
4

monthlypay_user=Double.parseDouble(loanof_user.getText())*monthlyrate_user/(1-1/
Math.pow(1+monthlyrate_user, Double.parseDouble(loanperiod_ofuser.getText())*12));
sampleobj+=String.format("%-58.3f%-58.2f%-7.2f\n",rate_bank, monthlypay_user,
(monthlypay_user*12)*Double.parseDouble(loanperiod_ofuser.getText()));
}
obj_txt.setText(sampleobj);
}
/*Main method*/public static void main(String[] args) {
launch(args);
}
}
5
Math.pow(1+monthlyrate_user, Double.parseDouble(loanperiod_ofuser.getText())*12));
sampleobj+=String.format("%-58.3f%-58.2f%-7.2f\n",rate_bank, monthlypay_user,
(monthlypay_user*12)*Double.parseDouble(loanperiod_ofuser.getText()));
}
obj_txt.setText(sampleobj);
}
/*Main method*/public static void main(String[] args) {
launch(args);
}
}
5
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Output
Figure 2 Output
6
Figure 2 Output
6
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Self-Evaluation
UI is correct or not?
The user interface is created using the design criteria made using the Balsamiq tool. The figure
below is the evidence.
Figure 3 Sample Output 1
Is the calculation correct?
Yes, it is correctly done. The per month payment and the closing payment calculated with the
interest rate. The application running properly which is seen below table:
Figure 4 Sample Output 2
7
UI is correct or not?
The user interface is created using the design criteria made using the Balsamiq tool. The figure
below is the evidence.
Figure 3 Sample Output 1
Is the calculation correct?
Yes, it is correctly done. The per month payment and the closing payment calculated with the
interest rate. The application running properly which is seen below table:
Figure 4 Sample Output 2
7

The table is displayed correctly or not?
The elements in the table is done accurately. The table is displayed accurately as seen in the
evidence below. The evidence of the correct displaying of the table is mentioned below.
Figure 5 Sample Output 3
Figure 6 Sample Output 4
8
The elements in the table is done accurately. The table is displayed accurately as seen in the
evidence below. The evidence of the correct displaying of the table is mentioned below.
Figure 5 Sample Output 3
Figure 6 Sample Output 4
8
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 9
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.