Java Application: Designing a Wood Flooring Cost Calculator

Verified

Added on  2024/05/29

|51
|4824
|187
Report
AI Summary
This report details the development of a Java program designed to calculate wood flooring costs, utilizing Object-Oriented Programming (OOP) principles such as inheritance, polymorphism, and encapsulation. The project implements a carpeting calculator with functionalities based on UML diagrams, including use case and class diagrams. It identifies the components and file structures incorporated in the Java project, defines the relationships between classes, UI, and class libraries, and elaborates on object behaviors using structures. The report also demonstrates effective exception handling and error reporting, showcases the use of Netbeans IDE for development, and includes comprehensive testing with test cases to validate functional and non-functional requirements. Furthermore, it analyzes actual results against expected results, incorporates user feedback for improvements, and provides both user and technical documentation for the solution, along with steps for deployment and maintenance. The goal is to create a robust and user-friendly application for estimating wood flooring costs.
Document Page
UNIT 41 PROGRAMMING IN JAVA
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
Contents
List of figures.........................................................................................................................................2
Introduction...........................................................................................................................................4
LO1........................................................................................................................................................5
P 1.1...................................................................................................................................................5
1.1 Java has many features including Object Oriented, Platform Independent, Robust, Interpreted,
and Multi-threaded. Discuss the principles, characteristics, and features of programming in Java? 5
1.2 P 1.2, M1......................................................................................................................................6
M1:....................................................................................................................................................7
LO2........................................................................................................................................................8
2.1 P 2.1, D1.......................................................................................................................................8
Design a Java programming solution for the given problem scenario using UML diagrams. Your
model should include use case diagrams, class diagrams with attributes and operations of each
class and the relationship, including inheritance if any between classes. Define clearly each class,
main methods, and properties..........................................................................................................8
2.2 Identify the components and file structures incorporated in the Java project file required to
implement the application..............................................................................................................10
D1:...................................................................................................................................................11
LO3 Be able to implement Java solutions............................................................................................12
3.1 Using OOP principles (Abstraction, Inheritance, polymorphism, classes, attributes, methods,
objects etc), implement the Carpeting calculator with all the functionalities listed in the
requirements based on your design in task 2..................................................................................12
3.2 Define how the components (the classes you define, the UI and the class libraries) are related
to implementing the design requirements......................................................................................12
3.3 Elaborate by example the implementation of object behaviors using structures to meet the
design algorithms as implemented in 3. 1 above............................................................................19
3.4 Demonstrate with evidence how you implemented effective exception handling and error
reporting in the application (M2)....................................................................................................24
M2: Exceptional handling................................................................................................................30
3.5 Netbeans is a rich IDE, demonstrate your effective command in the usage of the IDE to
develop your solution......................................................................................................................31
D2:...................................................................................................................................................31
LO4 Be able to test and document Java solutions...............................................................................32
1
Document Page
4.1 Critically review and test the overall performance of your system. You have to create the
appropriate test cases to test the functional and non-functional requirements of the application
produced[D3]..................................................................................................................................32
4.2 Analyse the actual results (form 4.1 above) against expected results and identify any
discrepancies and explain with evidence how would you resolve these.[M3]................................37
4.3 Distribute your application among actual users for evaluation. To this end, you have to
prepare a feedback form for the users to record their experience/feedback in the use of your
application. Collate their feedback, critically evaluate and analyze their feedback and based on
their feedback make recommendations for further improvements................................................41
4.4 Create clear user documentation for the solution. Where necessary, include relevant
screenshots and instructions. This can be a help file integrated with the application which can be
accessed via a menu system (e.g. Under Help menu item).............................................................42
4.5 Create technical documentation for the solution. You are also required to document all the
technical steps used to develop and deploy your solution. This will be used for the support and
maintenance of your system...........................................................................................................43
Conclusion...........................................................................................................................................49
References...........................................................................................................................................50
List of figures
Figure 1 JVM description.......................................................................................................................7
Figure 2 use case...................................................................................................................................9
Figure 3 case file..................................................................................................................................10
Figure 4 Example.................................................................................................................................12
Figure 5 values insert in the specified fields........................................................................................13
Figure 6 calculate time and cost..........................................................................................................14
Figure 7 enter values for another room..............................................................................................15
Figure 8 calculation of another room..................................................................................................16
Figure 9 calculates a total estimation..................................................................................................17
Figure 10 example of total estimation.................................................................................................18
Figure 11 payment mode.....................................................................................................................18
Figure 12 another payment mode.......................................................................................................19
Figure 13 code 1..................................................................................................................................20
Figure 14 code 2..................................................................................................................................21
Figure 15 code 3..................................................................................................................................22
Figure 16 code 4..................................................................................................................................22
Figure 17 code 5..................................................................................................................................23
Figure 18 code 6..................................................................................................................................24
Figure 19 testing 1...............................................................................................................................25
Figure 20 testing 2...............................................................................................................................26
2
Document Page
Figure 21 testing 3...............................................................................................................................27
Figure 22 testing 4...............................................................................................................................28
Figure 23 testing 5...............................................................................................................................29
Figure 24 testing 6...............................................................................................................................30
Figure 25 test case 1............................................................................................................................32
Figure 26 test case 2............................................................................................................................33
Figure 27 test case 3............................................................................................................................34
Figure 28 test case 4............................................................................................................................35
Figure 29 test case 5............................................................................................................................36
Figure 30 test case 6............................................................................................................................37
Figure 31 enter values.........................................................................................................................38
Figure 32 correct values and give results.............................................................................................39
Figure 33 incorrect values and apply handling....................................................................................40
Figure 34 produces expected output...................................................................................................41
Figure 35 open project file...................................................................................................................42
Figure 36 expand to open the code file...............................................................................................42
Figure 37 executing code file...............................................................................................................43
Figure 38 step 1...................................................................................................................................44
Figure 39 step 2...................................................................................................................................44
Figure 40 step 3...................................................................................................................................45
Figure 41 step 4...................................................................................................................................46
Figure 42 step 5...................................................................................................................................47
3
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
Introduction
This report is developed and designed for calculating wood flooring cost by implementing area for
estimating cost and time using java programming. In this document, testing will be performed to
validate the data and match with the actual result. Java program used all the OOPs concepts and
utilize their features in programming for implement this problem of Wood Flooring Cost Estimation.
This report determines all the required test cases and validation of entered data with example which
is provided as screenshots. The whole file will be prepared on the basis of this problem project and
examine all the requirements in proper manner.
4
Document Page
LO1
P 1.1
1.1 Java has many features including Object Oriented, Platform
Independent, Robust, Interpreted, and Multi-threaded. Discuss the
principles, characteristics, and features of programming in Java?
Introduction
Java programming is a simple language and utilize OOPs concept features in programming
as developing classes and importing methods and it is similar to C++ object oriented
concepts. Java language is characterized by a determination and comprises a developing
paradigm, interpreter, library files and a runtime environment such as Java virtual machine
(JVM). This JVM runtime enables software engineers to compose source code in a different
language than the java which still keeps running on the JVM. The Java stage is generally
connected with the JVM and libraries of java file (Shaykhian & G.A., 2007).
Principles
The java has 3 most used principles are an inheritance, polymorphism, and encapsulation and
it follows OOPs programming concepts which have classes and objects methodology. An
object is main element which consist of attributes and methods. The class is part of program ,
outline based on which objects are developed (Malabarba, Pandey, R., Gragg, Barr, E, J, 2000).
Inheritance:
This principle is used for parent and child properties or attributes inheriting. Basically child or
derived class can inherit the properties of the base class.
Polymorphism:
'Poly' implies numerous and 'transform' implies forms. This implies that it has articulations that have
numerous structures or similar proclamations can have diverse implications in various settings.
Encapsulation:
It means that binding of attributes and its properties is called data encapsulation.
Features
Java has a special addition for reusability of Code.
Accentuation on information as opposed to the method.
Information is covered up and can't be used by outer functions.
Objects can work with each other through functions or methods
New data information and methods can be effortlessly included.
5
Document Page
Java has many more features to use in programmings such as robustness, more secure of
data, multithreading, applets implementation for web framework or more.
Characteristics
Java has many characteristics similar to features in a different manner as follows:
Distributed:
Java was composed of the conveyed condition.
Java can be transmitted, run over the web.
Interpreted:
Java supports cross-stage code using Java byte code.
JVM can change Bytecode in any phase.
Object-oriented:
Object-oriented programming concepts are used in Java dialect.
Similar to C++, java gives the greater part of the OOP highlights.
Java is unadulterated Object oriented language and C++ is not fully based on OOP.
1.2 P 1.2, M1
1.2 Critically evaluate the environmental flexibility of programming in Java and thus in this context
explain the role of Java Virtual Machine (JVM).
Platform Independence
Java dialect is organize free. As an issue of first significance, its source code gets collected into a class
record which is generally called Byte Code. Byte code contains machine headings for the working
system. This made byte code is same for all phases of OS like Windows, Linux, Mac et cetera. Byte
code is evaluated and deciphered by Java Virtual Machine (JVM). JVM is organize subordinate yet it
is open for all stages. In this way byte code headings and JVM together influences Java to organize
self-ruling.
Embedded Hardware Programming
Java gives an extension of Micro Edition API which is sensible for embedded applications and known
as Java ME Embedded. It engages human to become significantly secure, strong, versatile and
pragmatic applications for embedded contraptions like flight control structures and machines
identified with cash exchange and that's only the tip of the ice berg.
Mobile Applications
Java Mobile Environment stays for Java Micro Edition. It enables us to make applications for
contraptions like set-top boxes, PDAs et cetera. Java ME is especially expected for battery worked
devices with some memory and dealing with speed.
6
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
M1:
Role of JVM
JVM remains for java virtual machine which is dynamic or virtual figuring machine is the usage of
java virtual machine specification. It deciphers the interpreted java programmed code as the
bytecode and aides in execution of program relying on the particular stage. Java is platform
independent language i.e. it can keep running on any stage without reworking the code. This
component is supported by JVM. Fundamentally JVM is set of PC programs and data structures that
run arranged bytecode on any machine such as Java language which is once it is compiled can run
anywhere. JVM is virtual, on the grounds that nature in which it runs bytecode is to such an extent
that it stays isolated from the OS and can be expelled or introduced without influencing it. JVM
changes over the bytecode into the machine or a platform based code and after that run it.
Figure 1 JVM description
7
Document Page
LO2
2.1 P 2.1, D1
Design a Java programming solution for the given problem scenario using
UML diagrams. Your model should include use case diagrams, class
diagrams with attributes and operations of each class and the relationship,
including inheritance if any between classes. Define clearly each class, main
methods, and properties.
Various types of system applications are based on Java and its overall standard is for the
advancement of recreations, portable and game applications and so on. It empowers developers to
create, actualize, execute and utilize its service applications. The most ideal approach to take in this
is to performing and working out. Here we have the open door for performing java programming by
executing this task. This activity provided skills and enhances programming concepts particularly in
Java. The situation of the undertaking is clarified by utilizing UML graphs.
UML remains for Unified Modelling Language and these days it is utilized for outlining and
understanding details of a product. Any product can be explained by utilizing these charts. With
these graphs, a product turns out to be more understandable. UML is called broadly useful
demonstrating part of the language. These are utilized as a part of the substitution of flowcharts and
it gives more institutionalized plan perspective of the product.
On the basis of this, there’s a list of UML figures as:
1. The Activity Figure
2. The communication Figure
3. The Interaction Overview Figure
4. The Use Case Figure
5. The Sequence Figure
6. The Timing Figure
7. The State Machine Figure
In this report, we’re going to determine few diagrams which represent this task problem. The high-
level requirements can be described by use case diagrams which consist entities and its attributes
along with their actors whom they represent and many relationships are formed using these.
8
Document Page
Figure 2 use case
The above diagram represents use case diagram which consists of attributes for calculating wood
floor by using attributes values.
9
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
Figure 3 case file
The above diagram represents class diagram consists of three classes named as wood flooring,
listeners, and the last one is room details. The main class is wood flooring which uses the attributes
of two other classes and they are joined to each other using relations. The three classes have their
method and attributes in itself.
2.2 Identify the components and file structures incorporated in the Java
project file required to implement the application.
In programming with java language, the main part is java document or report. In java report, it
consists of some imported packages and various Classes which are used in programming.
In every record, the most effective class may be declared as public i.e., which is used mostly. A public
class may be used by any other bundle or class. The filename needs to be same because calling of
the public access method may be required in same source file along with the extension.Java
(Marchesseault, B.T & International Business Machines Corp, 2002).
1. "public class XYZ": It means that the general public is an get entry to modifier or access
modifier for any defined class. The access modifiers may be private, protected and public.
The keyword class is used to claim the declared class program observed by name of the
class.
10
Document Page
2. Comments: The single line comments defined through two ahead slashes. These are usually
one line or single line comments. The block comments defined with backslash an asterisk
followed by comment and then ends with an asterisk followed by a backslash.
3. "public static void main(String[] args)": It is called as a major function whose argument is in
array form. The public is an access modifier which is used in class to define its method open
to all and the keyword static is a reserved keyword which suggests that this function is a
static type characteristic, that can’t be changed. The void is a key-word display that the
characteristic will return nothing.
4. "System.Out.Println("Hello")": This statement is the part of java class or conio library which
is used to print anything. The println is the name of the method used for print or return with
line change implies to “ln” and "Hello" is the string name given to the println method.
Here are some main features of java which are required to enforce the implementation of source
code in that way as:
a. Classes and interfaces: The main letter of the class name is composed as capital.
b. Methods: The primary letter is composed in lowercase configuration.
For instance: putValue().
c. Variables: The names should be short and significant in which method layout is used.
d. Constants: Constants are formed by making variables static or final.
If programs are declared in java language then they need to be the declared first in the source code.
A java record can include many instructions however it can only incorporate one public class whose
calling method is similar to the name of the report.
D1:
I have designed the use case diagrams, UML diagrams and also used the relevant theories in the
design process. I have used the draw.io to draw the diagrams. So I have achieved D1.
11
chevron_up_icon
1 out of 51
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]