Tax Calculator Java: HND Computing and Systems Development Report
VerifiedAdded on 2023/04/22
|21
|3435
|286
Report
AI Summary
This report details the development of a Java-based tax calculator as a project for an HND Computing and Systems Development course. The assignment covers various aspects of software development, including object-oriented programming (OOP) principles such as abstraction, encapsulation, inheritance, and polymorphism. The report includes UML diagrams to illustrate the system's structure and use cases, along with explanations of the GUI design and class structure. The implementation section describes the code, including exception handling techniques using try-catch blocks and error reporting. The project was developed using NetBeans IDE. Testing and analysis are also presented, along with user review and comprehensive documentation. The report demonstrates the application of Java to create a functional tax calculator, showcasing the student's understanding of programming concepts and software design.

Running head: TAX CALCULATOR JAVA
Tax Calculator Java
Name of the student:
Name of the University:
Author note:
Tax Calculator Java
Name of the student:
Name of the University:
Author note:
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

1
TAX CALCULATOR JAVA
Table of Contents
LO1............................................................................................................................................2
1.1 Features of Java................................................................................................................2
1.2 Java Virtual Machine.......................................................................................................6
LO2............................................................................................................................................7
2.1 UML and Use Case..........................................................................................................7
2.2 Components and File Structure........................................................................................8
LO3............................................................................................................................................8
3.1 Implementation................................................................................................................8
3.2 Design Explanations.......................................................................................................11
3.4 Exception Handling and Error Reporting......................................................................12
3.5 NetBeans IDE.................................................................................................................13
LO4..........................................................................................................................................15
4.1 & 4.2 Testing and Analysis............................................................................................15
4.3 User Review...................................................................................................................17
4.5 Documentation...............................................................................................................19
TAX CALCULATOR JAVA
Table of Contents
LO1............................................................................................................................................2
1.1 Features of Java................................................................................................................2
1.2 Java Virtual Machine.......................................................................................................6
LO2............................................................................................................................................7
2.1 UML and Use Case..........................................................................................................7
2.2 Components and File Structure........................................................................................8
LO3............................................................................................................................................8
3.1 Implementation................................................................................................................8
3.2 Design Explanations.......................................................................................................11
3.4 Exception Handling and Error Reporting......................................................................12
3.5 NetBeans IDE.................................................................................................................13
LO4..........................................................................................................................................15
4.1 & 4.2 Testing and Analysis............................................................................................15
4.3 User Review...................................................................................................................17
4.5 Documentation...............................................................................................................19

2
TAX CALCULATOR JAVA
LO1
1.1 Features of Java
Java programming language has been developed by Sun Microsystem, initiated by
James Gosling in 1995 as a core component of Sun Microsystems, now owned by Oracle,
Java platform (Java 1.0 J2SE). There has been various updates in the Java. The latest release
of the Java Standard Edition is Java SE 9. Java has able to change the internet. An update in
Java has been applet that helped in connecting Java to the internet. An applet is a java
program that has been designed to transmit over the internet and execute a java compatible
web browser. Applet can be downloaded on the demand of user and used for displaying data
provided by the server. However, security and portability have been major issues in a
programming language. Therefore, java has been able to mitigate these issues by developing
byte code. A byte code is a highly optimized set of instruction that is executed by the Java
Runtime machine or Java Virtual Machine (JVM). JVM has been designed as an interpreter
for byte code. Following are the features of Java (Sebesta 2016):
Object Oriented Programming: Object oriented programming (OOP) has been the
core of the Java. OOP has been integral part if the Java. Therefore, the basic principles of the
OOP need to be understood before coding a Java program (Schmidt et al. 2013). The basic
features of the Object Oriented Programming have been mentioned below:
Robust: Robust refers strength of the object. Java is a robust program language as it
uses a strong memory management. There has been a lack of pointers that helps in avoiding
security problems. There has been an automatic garbage collection in Java that helps in
running on the Java Virtual Machine for getting rid of the objects and not being used by Java
application. There have been an exception handling and type checking mechanism in Java.
These [points have been helping in making Java a robust program.
TAX CALCULATOR JAVA
LO1
1.1 Features of Java
Java programming language has been developed by Sun Microsystem, initiated by
James Gosling in 1995 as a core component of Sun Microsystems, now owned by Oracle,
Java platform (Java 1.0 J2SE). There has been various updates in the Java. The latest release
of the Java Standard Edition is Java SE 9. Java has able to change the internet. An update in
Java has been applet that helped in connecting Java to the internet. An applet is a java
program that has been designed to transmit over the internet and execute a java compatible
web browser. Applet can be downloaded on the demand of user and used for displaying data
provided by the server. However, security and portability have been major issues in a
programming language. Therefore, java has been able to mitigate these issues by developing
byte code. A byte code is a highly optimized set of instruction that is executed by the Java
Runtime machine or Java Virtual Machine (JVM). JVM has been designed as an interpreter
for byte code. Following are the features of Java (Sebesta 2016):
Object Oriented Programming: Object oriented programming (OOP) has been the
core of the Java. OOP has been integral part if the Java. Therefore, the basic principles of the
OOP need to be understood before coding a Java program (Schmidt et al. 2013). The basic
features of the Object Oriented Programming have been mentioned below:
Robust: Robust refers strength of the object. Java is a robust program language as it
uses a strong memory management. There has been a lack of pointers that helps in avoiding
security problems. There has been an automatic garbage collection in Java that helps in
running on the Java Virtual Machine for getting rid of the objects and not being used by Java
application. There have been an exception handling and type checking mechanism in Java.
These [points have been helping in making Java a robust program.
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

3
TAX CALCULATOR JAVA
Platform Independent: Java is a platform independent program as it helps in executing
different languages including C, C++ and other languages that are compiled into platform
specific machines. A platform is a hardware or software environment on which a program
runs. Java helps in providing software-based platform. The platform of Java has been
different from other platforms as it runs on the top of other hardware based platforms. It
include two components inckudidng Runtime Environment and Application Programing
Interface (API). Java codes are compatible to run in various other platforms including
Windows, Linux, Sun Solaris and Mac/OS. Java code can be compiled by the compiler and
transformed into byte code (Morelli and Walde 2012). This byte code has been a platform
independent code as it can be complied over multiple platforms.
Multithreaded: A threaded is a separate program that execute concurrently. Java
programs deals with many tasks at a time by defining multiple threads (Kika and Greca
2013). The major benefit of multi-threading has been consumption of low memory and it
does not occupy memory for each and every thread. It shares a common memory space for
every thread. Threads have been important component for web applications and multimedia
(Czajkowski and Daynàs 2012).
Following are the principles of OOP:
Abstraction: Abstraction has been an essential element of object-oriented programing.
Abstraction can be used for minimizing complexity of any system. For example, people do
not think about the internal systems of a car. They only deals car as an object with its unique
behavior. They do not think about the way it operate including transmission and engine
operations. Similar to those, abstraction deals with the unique behavior of codes and
programs rather focusing on how it is working. Hierarchical abstractions of complex systems
are applied on computer programs. Data transferred from traditional process oriented
TAX CALCULATOR JAVA
Platform Independent: Java is a platform independent program as it helps in executing
different languages including C, C++ and other languages that are compiled into platform
specific machines. A platform is a hardware or software environment on which a program
runs. Java helps in providing software-based platform. The platform of Java has been
different from other platforms as it runs on the top of other hardware based platforms. It
include two components inckudidng Runtime Environment and Application Programing
Interface (API). Java codes are compatible to run in various other platforms including
Windows, Linux, Sun Solaris and Mac/OS. Java code can be compiled by the compiler and
transformed into byte code (Morelli and Walde 2012). This byte code has been a platform
independent code as it can be complied over multiple platforms.
Multithreaded: A threaded is a separate program that execute concurrently. Java
programs deals with many tasks at a time by defining multiple threads (Kika and Greca
2013). The major benefit of multi-threading has been consumption of low memory and it
does not occupy memory for each and every thread. It shares a common memory space for
every thread. Threads have been important component for web applications and multimedia
(Czajkowski and Daynàs 2012).
Following are the principles of OOP:
Abstraction: Abstraction has been an essential element of object-oriented programing.
Abstraction can be used for minimizing complexity of any system. For example, people do
not think about the internal systems of a car. They only deals car as an object with its unique
behavior. They do not think about the way it operate including transmission and engine
operations. Similar to those, abstraction deals with the unique behavior of codes and
programs rather focusing on how it is working. Hierarchical abstractions of complex systems
are applied on computer programs. Data transferred from traditional process oriented
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

4
TAX CALCULATOR JAVA
program can be modified into abstraction and objects. A series of process steps have been
collected for messages between these objects. These objects used to describes its own unique
behavior and functionalities. Object oriented concepts have been related to the human
behavior in the real world. Therefore, concept of abstraction has been related to the
behavioral aspects of human beings in the real world. Abstraction help in minimizing the
complexity of programs and systems from user point of view.
Encapsulation: It is the mechanism that helps in binding codes together and
manipulate data. Encapsulation acts as protective layer for codes and data for being used
arbitrarily accessed by other set of codes in the program. In Java, basis of encapsulation is the
class. Class is defined as behavior and structure that is shared with various objects. Each
variable in the program can be marked as public and private. The public interface of class
refers everything that an external user need to know about the program (Koscielny et al.
2014). The private methods and data can only be accessed by member of the class.
Therefore, codes that are outside of that class, cannot access a private method. This help in
ensuring security to the data and codes.
class Account {
private int account_number;
private int account_balance;
public void show Data() {
//code to show data
}
public void deposit(int a) {
if (a < 0) {
//show error
} else
account_balance = account_balance + a;
}
TAX CALCULATOR JAVA
program can be modified into abstraction and objects. A series of process steps have been
collected for messages between these objects. These objects used to describes its own unique
behavior and functionalities. Object oriented concepts have been related to the human
behavior in the real world. Therefore, concept of abstraction has been related to the
behavioral aspects of human beings in the real world. Abstraction help in minimizing the
complexity of programs and systems from user point of view.
Encapsulation: It is the mechanism that helps in binding codes together and
manipulate data. Encapsulation acts as protective layer for codes and data for being used
arbitrarily accessed by other set of codes in the program. In Java, basis of encapsulation is the
class. Class is defined as behavior and structure that is shared with various objects. Each
variable in the program can be marked as public and private. The public interface of class
refers everything that an external user need to know about the program (Koscielny et al.
2014). The private methods and data can only be accessed by member of the class.
Therefore, codes that are outside of that class, cannot access a private method. This help in
ensuring security to the data and codes.
class Account {
private int account_number;
private int account_balance;
public void show Data() {
//code to show data
}
public void deposit(int a) {
if (a < 0) {
//show error
} else
account_balance = account_balance + a;
}

5
TAX CALCULATOR JAVA
}
Inheritance: Inheritance is a process by which an object helps in acquiring properties
of another object. It has been one of the most important principles of the OOP. A hierarchical
order is followed in this principle. Inheritance interacts with encapsulation for providing
secured level of hierarchy in the program. Inheritance helps in minimizing the space
complexity of program and encourages reusability of codes. A platform is a hardware or
software environment on which a program runs. Java helps in providing software-based
platform. Java does not support multiple inheritance.
Polymorphism: Polymorphism refers to the mechanism of allowing one interface to
be used for a general class of actions. Polymorphism helps in designing a generic interface
for a group of related activities. Therefore, it reduces complexity of programs by allowing
same interface to be used by specify a general class of action.
class Shape{
void draw(){System.out.println("drawing...");}
}
class Rectangle extends Shape{
void draw(){System.out.println("drawing rectangle...");}
}
class Circle extends Shape{
void draw(){System.out.println("drawing circle...");}
}
class Triangle extends Shape{
void draw(){System.out.println("drawing triangle...");}
}
class TestPolymorphism2{
public static void main(String args[]){
Shape s;
s=new Rectangle();
TAX CALCULATOR JAVA
}
Inheritance: Inheritance is a process by which an object helps in acquiring properties
of another object. It has been one of the most important principles of the OOP. A hierarchical
order is followed in this principle. Inheritance interacts with encapsulation for providing
secured level of hierarchy in the program. Inheritance helps in minimizing the space
complexity of program and encourages reusability of codes. A platform is a hardware or
software environment on which a program runs. Java helps in providing software-based
platform. Java does not support multiple inheritance.
Polymorphism: Polymorphism refers to the mechanism of allowing one interface to
be used for a general class of actions. Polymorphism helps in designing a generic interface
for a group of related activities. Therefore, it reduces complexity of programs by allowing
same interface to be used by specify a general class of action.
class Shape{
void draw(){System.out.println("drawing...");}
}
class Rectangle extends Shape{
void draw(){System.out.println("drawing rectangle...");}
}
class Circle extends Shape{
void draw(){System.out.println("drawing circle...");}
}
class Triangle extends Shape{
void draw(){System.out.println("drawing triangle...");}
}
class TestPolymorphism2{
public static void main(String args[]){
Shape s;
s=new Rectangle();
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

6
TAX CALCULATOR JAVA
s.draw();
s=new Circle();
s.draw();
s=new Triangle();
s.draw();
}
}
1.2 Java Virtual Machine
Java programs can be executed in any platform and compiled in Java programming
source. IT helps in generating Byte code of the program. Byte code is a Java compiler that
helps in generating platform independency property. Therefore, this byte code can be run in
any platform. It is executed by a program, named as Java Virtual Machine that is the main
element of the Java Runtime Environment. The platform of Java has been different from
other platforms as it runs on the top of other hardware based platforms. The source file of the
Java program has an extension of .java and the byte code file has been generated by Java
compiler. There are multiple classes in the java program that needs to be compiled in the
JVM. Therefore, Java plays an important role in the Java.
TAX CALCULATOR JAVA
s.draw();
s=new Circle();
s.draw();
s=new Triangle();
s.draw();
}
}
1.2 Java Virtual Machine
Java programs can be executed in any platform and compiled in Java programming
source. IT helps in generating Byte code of the program. Byte code is a Java compiler that
helps in generating platform independency property. Therefore, this byte code can be run in
any platform. It is executed by a program, named as Java Virtual Machine that is the main
element of the Java Runtime Environment. The platform of Java has been different from
other platforms as it runs on the top of other hardware based platforms. The source file of the
Java program has an extension of .java and the byte code file has been generated by Java
compiler. There are multiple classes in the java program that needs to be compiled in the
JVM. Therefore, Java plays an important role in the Java.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

7
TAX CALCULATOR JAVA
LO2
2.1 UML and Use Case
Fig 1. Use Case Diagram
TAX CALCULATOR JAVA
LO2
2.1 UML and Use Case
Fig 1. Use Case Diagram

8
TAX CALCULATOR JAVA
Fig 2. UML Class Diagram
2.2 Components and File Structure
Java Project Name: Finance
Package Name: finance
Home Page Form: TaxCalculator.java; TaxCalculator.form
Tax Output Form: Display.java, Display.form
Compilation File Structure:
Finance => finance => src => TaxCalculator.java
The file mentioned above needs to be compiled and executed in order to run the
program successfully.
LO3
3.1 Implementation
Home Page form (TaxCalculator class)
TAX CALCULATOR JAVA
Fig 2. UML Class Diagram
2.2 Components and File Structure
Java Project Name: Finance
Package Name: finance
Home Page Form: TaxCalculator.java; TaxCalculator.form
Tax Output Form: Display.java, Display.form
Compilation File Structure:
Finance => finance => src => TaxCalculator.java
The file mentioned above needs to be compiled and executed in order to run the
program successfully.
LO3
3.1 Implementation
Home Page form (TaxCalculator class)
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

9
TAX CALCULATOR JAVA
Output page form (Display class)
Parent class (Product)
TAX CALCULATOR JAVA
Output page form (Display class)
Parent class (Product)
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

10
TAX CALCULATOR JAVA
Child Class 1 (Selling Product)
Child Class 2 (Sample Product)
TAX CALCULATOR JAVA
Child Class 1 (Selling Product)
Child Class 2 (Sample Product)

11
TAX CALCULATOR JAVA
3.2 Design Explanations
GUI Justifications
The classes that have been used in this project are meant to solely suffice to the needs
of the program. The GUI form classes have been specifically designed and developed for
inputs and output requirements of the program. The input form’s GUI or the graphical user
interface has been so designed to allow the users to enter all the necessary information that
will be required by the Tax Calculator to calculate the appropriate tax results for the
particular product entries.
The home page or the Tax Calculator form page is supposed to greet the users into the
program. This page provides a form with input areas for the type of product, the initial price
and the shipping cost of the concerned product. The type of the product can be selected by the
user using a Radio Button input. This takes the chances of erroneous product-type inputs by
the user, which could have otherwise been an integration problem for the system. The user is
presented with two clickable options, Selling Product and Sample Product, of which the user
can choose only one and the same will get saved for the particular entry.
The display page is the output form for the application. This form is used to represent
the bill page of the software where the tax results are calculated and displayed along with all
the other necessary details of the finance simulator. The display areas are so programmed, to
display the ‘£’ symbol to symbolize the currency being dealt with.
Choice of Classes
The Product class has been chosen as the parent class for the program. This class has
two other child classes and they exhibit the Inheritance feature of Java’s object oriented
programming. The Product class has all the data attributes and the necessary functions. These
data attributes and methods are common for all the child classes namely the Selling Product
TAX CALCULATOR JAVA
3.2 Design Explanations
GUI Justifications
The classes that have been used in this project are meant to solely suffice to the needs
of the program. The GUI form classes have been specifically designed and developed for
inputs and output requirements of the program. The input form’s GUI or the graphical user
interface has been so designed to allow the users to enter all the necessary information that
will be required by the Tax Calculator to calculate the appropriate tax results for the
particular product entries.
The home page or the Tax Calculator form page is supposed to greet the users into the
program. This page provides a form with input areas for the type of product, the initial price
and the shipping cost of the concerned product. The type of the product can be selected by the
user using a Radio Button input. This takes the chances of erroneous product-type inputs by
the user, which could have otherwise been an integration problem for the system. The user is
presented with two clickable options, Selling Product and Sample Product, of which the user
can choose only one and the same will get saved for the particular entry.
The display page is the output form for the application. This form is used to represent
the bill page of the software where the tax results are calculated and displayed along with all
the other necessary details of the finance simulator. The display areas are so programmed, to
display the ‘£’ symbol to symbolize the currency being dealt with.
Choice of Classes
The Product class has been chosen as the parent class for the program. This class has
two other child classes and they exhibit the Inheritance feature of Java’s object oriented
programming. The Product class has all the data attributes and the necessary functions. These
data attributes and methods are common for all the child classes namely the Selling Product
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

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