Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 119

Java Programming

Android Application for Nova Pharmacy

Sostika Acharya 1/1/17 Bsc.IT | Third Semester


JAVA PROGRAMMING

Table of Contents
Scenario................................................................................................................................................ 10

Task 1 ................................................................................................................................................... 12

Discuss the principles, characteristics and features of programming in Java. [1.1, M1]................. 12

Introduction ...................................................................................................................................... 13

Who Created Java? ...................................................................................................................... 13

What is Java ................................................................................................................................. 13

Five Primary Goals in the Creation of the Java Language .......................................................... 14

Some of the Version of Java ........................................................................................................ 14

Features of Java............................................................................................................................ 14

Simple ...................................................................................................................................... 15

Dynamic Language .................................................................................................................. 15

Interpreted ................................................................................................................................ 15

Portable .................................................................................................................................... 15

Reliability................................................................................................................................. 16

Secure ....................................................................................................................................... 16

Platform Independent ............................................................................................................... 16

Object-Oriented........................................................................................................................ 16

Distributed................................................................................................................................ 17

Robust ...................................................................................................................................... 17

Architecture Neutral................................................................................................................. 17

High Performance .................................................................................................................... 18

Multithreaded ........................................................................................................................... 18

Where Do I Start Java .................................................................................................................. 18

Characteristics and Features of Java ............................................................................................ 18

Object ........................................................................................................................................... 19

Class ......................................................................................................................................... 19

SOSTIKA ACHARYA 1
JAVA PROGRAMMING

Data abstraction and encapsulation .......................................................................................... 19

Inheritance................................................................................................................................ 19

Single Inheritance ................................................................................................................ 20

Multiple Inheritance ............................................................................................................. 20

Hierarchical Inheritance ....................................................................................................... 21

Multilevel inheritance .......................................................................................................... 21

Polymorphism .......................................................................................................................... 22

Constructors ............................................................................................................................. 22

Default Constructor .............................................................................................................. 22

Parameterized Constructor ................................................................................................... 23

Copy Constructor ................................................................................................................. 23

Destructor ................................................................................................................................. 23

Static Members (Static variable and static method) ................................................................ 23

Java Environment......................................................................................................................... 23

Advantages of using an IDE: ....................................................................................................... 24

Disadvantages of using an IDE: ................................................................................................... 24

Conclusion ....................................................................................................................................... 24

Task 2 ................................................................................................................................................... 25

Critically evaluate the environmental flexibility of programming in Java. [1.2] ............................ 25

Introduction ...................................................................................................................................... 26

Memory Management .................................................................................................................. 26

Primitives vs. objects / auto-boxing ............................................................................................. 27

Non-virtual Methods .................................................................................................................... 29

Single Paradigm ........................................................................................................................... 29

Exception Handling ..................................................................................................................... 29

Advantages of Exception Handling ......................................................................................... 30

SOSTIKA ACHARYA 2
JAVA PROGRAMMING

Closure ......................................................................................................................................... 30

Floating Point Arithmetic ............................................................................................................ 30

Look and Feel .............................................................................................................................. 31

Performance ................................................................................................................................. 31

Platform Independence ................................................................................................................ 31

Java for Mobile Applications (Java ME) ..................................................................................... 32

Embedded Hardware Programming in Java ................................................................................ 32

Conclusion ....................................................................................................................................... 32

Task 3 ................................................................................................................................................... 33

Design a Java programming solution to the problem given in the scenario. [2.1, M2] ................... 33

Introduction ...................................................................................................................................... 34

Pseudo-code ................................................................................................................................. 34

Advantages of Pseudo-code ..................................................................................................... 34

Limitations of Pseudocode ....................................................................................................... 34

Pseudo code of Nova Pharmaceuticals .................................................................................... 35

Pseudo code for login........................................................................................................... 35

Pseudo Code for Product entry ............................................................................................ 35

Flowchart ..................................................................................................................................... 35

Flowchart Chart for Login of Nova Pharmaceuticals .............................................................. 36

Flow Chart of Whole System of Nova Pharmaceuticals ......................................................... 36

Context Diagram .......................................................................................................................... 37

0-Level DFD Diagram ................................................................................................................. 38

DFD Rules and Tips................................................................................................................. 38

Schema ......................................................................................................................................... 39

Conclusion ....................................................................................................................................... 40

Task 4 ................................................................................................................................................... 41

SOSTIKA ACHARYA 3
JAVA PROGRAMMING

Explain the components and data and file structures required to implement the given design. [2.2,
M3]................................................................................................................................................... 41

Introduction ...................................................................................................................................... 42

Overview of Nova pharmaceuticals ............................................................................................. 42

Conclusion ....................................................................................................................................... 48

Task 5: A .............................................................................................................................................. 49

Implement a Java programming solution based on a prepared design. [3.1] ................................... 49

Define relationships between objects to implement the design requirements. [3.2] ....................... 49

Introduction ...................................................................................................................................... 50

Login Page ................................................................................................................................... 50

Code for Login Page .................................................................................................................... 50

Navigation Menu ......................................................................................................................... 51

Code for Navigation Menu .......................................................................................................... 51

Product Entry Form...................................................................................................................... 52

Code for Product Entry Form ...................................................................................................... 52

Sales Form ................................................................................................................................... 53

Codes for Sales Form ................................................................................................................... 53

Sales Record Table ...................................................................................................................... 55

Code for Sales Record Table ....................................................................................................... 55

Search Fragment .......................................................................................................................... 56

Code for Search Fragment ........................................................................................................... 56

Stock Table .................................................................................................................................. 58

Code for Stock Table ................................................................................................................... 58

Conclusion ....................................................................................................................................... 60

Task 5 - B ............................................................................................................................................. 61

Implement object behaviors using control structures to meet the design algorithms. [3.3, M1] ..... 61

Identify and implement opportunities for error handling and reporting. [3.4] ................................ 61

SOSTIKA ACHARYA 4
JAVA PROGRAMMING

Make effective use of and Integrated Development Environment (IDE) including code and screen
templates. [3.5, M1] ......................................................................................................................... 61

Introduction ...................................................................................................................................... 62

Control Structure/ Conditionals ................................................................................................... 62

Loop ............................................................................................................................................. 66

Types of Loop .......................................................................................................................... 66

Event Handling ............................................................................................................................ 67

Components of Event Handling ............................................................................................... 67

Exception Handling ..................................................................................................................... 68

Advantages of Exception Handling ......................................................................................... 68

Why to handle exception? ........................................................................................................ 68

Effective use of IDE..................................................................................................................... 69

Conclusion ................................................................................................................................... 74

Task 6 ................................................................................................................................................... 75

Critically review and test the Java programming solution and analyze actual test results against
expected results to identify discrepancies. [4.1, 4.2] ....................................................................... 75

Introduction ...................................................................................................................................... 76

Unit Testing ................................................................................................................................. 76

Method Used for unit testing: .................................................................................................. 76

When Unit testing should be done? ......................................................................................... 76

By whom unit testing should be done? .................................................................................... 76

Integrated Testing ........................................................................................................................ 78

Compatibility Testing .................................................................................................................. 80

Stress Testing ............................................................................................................................... 81

Critical Review ............................................................................................................................ 82

Advantage of Programing Solution ......................................................................................... 83

Conclusion ....................................................................................................................................... 83

SOSTIKA ACHARYA 5
JAVA PROGRAMMING

Task 7 ................................................................................................................................................... 84

Evaluate independent feedback on a developed Java programming solution and make


recommendations for improvements. [4.3] ...................................................................................... 84

Introduction ...................................................................................................................................... 85

Conclusion ....................................................................................................................................... 87

Task 8 ................................................................................................................................................... 88

Create user documentation for the developed Java program solution. [4.4, M2] ............................ 88

Introduction ...................................................................................................................................... 89

Conclusion ....................................................................................................................................... 98

Task 9 ................................................................................................................................................... 99

Create technical documentation for the support and maintenance of a Java program solution [4.5,
M3]................................................................................................................................................... 99

Introduction .................................................................................................................................... 100

Purpose....................................................................................................................................... 100

Scope .......................................................................................................................................... 100

Document Organization ............................................................................................................. 100

Project Background ................................................................................................................ 101

Design the Layouts ................................................................................................................ 101

Tools Used ............................................................................................................................. 103

Data and Information Collection Process .................................................................................. 105

Interviews ............................................................................................................................... 105

Observations .......................................................................................................................... 105

Investigation of documents: ................................................................................................... 105

Focus groups: ......................................................................................................................... 105

Constraints ................................................................................................................................. 106

Cost ........................................................................................................................................ 106

Organizational Policies .......................................................................................................... 106

SOSTIKA ACHARYA 6
JAVA PROGRAMMING

Legacy System ....................................................................................................................... 106

Hardware Platforms ............................................................................................................... 106

Deployment Technique .............................................................................................................. 107

Regression Testing ................................................................................................................. 107

Application Rating ................................................................................................................. 107

Targeted Regions ................................................................................................................... 107

Application Size ..................................................................................................................... 107

SDK and Screen Compatibility.............................................................................................. 107

Application Pricing ................................................................................................................ 108

Promotional Content .............................................................................................................. 108

Build and Upload release-ready APK .................................................................................... 108

Finalize Application Detail .................................................................................................... 108

Gantt Chart ................................................................................................................................. 108

Conclusion ..................................................................................................................................... 109

Task 10/A ........................................................................................................................................... 111

For D1 ............................................................................................................................................ 111

Task 5 ......................................................................................................................................... 111

Task 10/B ........................................................................................................................................... 113

For D2 ............................................................................................................................................ 113

Task 10/C ............................................................................................. Error! Bookmark not defined.

For D3 .............................................................................................. Error! Bookmark not defined.

References .......................................................................................................................................... 115

Fig: Features of Java ............................................................................................................................ 14


Fig: Java is simple ................................................................................................................................ 15
Fig: Java is portable ............................................................................................................................. 15
Fig: Java is platform independent ........................................................................................................ 16

SOSTIKA ACHARYA 7
JAVA PROGRAMMING

Fig: Java is distributive ........................................................................................................................ 17


Fig: Java is architecture neutral ........................................................................................................... 17
Fig: Principles and Characteristics of Java .......................................................................................... 18
Fig: code for encapsulation .................................................................................................................. 19
Fig: Single Inheritance ......................................................................................................................... 20
Fig: code for single inheritance............................................................................................................ 20
Fig: Multiple Inheritance ..................................................................................................................... 20
Fig: Hierarchical Inheritance ............................................................................................................... 21
Fig: Multilevel Inheritance .................................................................................................................. 21
Fig: code for multilevel inheritance ..................................................................................................... 21
Fig: code for constructor ...................................................................................................................... 22
Fig: Parts of JVM Model ..................................................................................................................... 27
Fig: Flowchart for Login of Nova Pharmaceuticals ............................................................................ 36
Fig: Flow Chart of Whole System of Nova Pharmaceuticals .............................................................. 37
Fig: Context Diagram of Nova Pharmaceuticals ................................................................................. 38
Fig: 0-Level DFD for Nova Pharmaceuticals ...................................................................................... 39
Fig: Schema for Nova Pharmaceuticals ............................................................................................... 40
Fig: navigation menu ........................................................................................................................... 51
Fig: code for navigation menu ............................................................................................................. 51
Fig: product entry form ........................................................................................................................ 52
Fig: code for product entry form .......................................................................................................... 52
Fig: sales form...................................................................................................................................... 53
Fig: code for sales form ....................................................................................................................... 54
Fig: sales record table .......................................................................................................................... 55
Fig: code for sales record table ............................................................................................................ 55
Fig: search fragment ............................................................................................................................ 56
Fig: code for search fragment .............................................................................................................. 57
Fig: stock table ..................................................................................................................................... 58
Fig: code for stock table ....................................................................................................................... 58
Fig: code for database creation ............................................................................................................ 59
Fig: ER Diagram .................................................................................................................................. 60
Fig: screenshot of event handling ........................................................................................................ 67
Fig: screenshot of switch statement ..................................................................................................... 63

SOSTIKA ACHARYA 8
JAVA PROGRAMMING

Fig: screenshot of if statement ............................................................................................................. 64


Fig: screenshot of if-else statement...................................................................................................... 65
Fig: screenshot of do while statement .................................................................................................. 65
Fig: screenshot of for statement ........................................................................................................... 66
Fig: screenshot of try catch .................................................................................................................. 68
Fig: flow chart of nova pharmaceutical ............................................................................................. 102
Fig: 0-level DFD diagram of Nova Pharmaceuticals ......................................................................... 103
Fig: Gantt Chart for Planning, Managing and Organizing the Activities While Doing the Project of
Java Programming ............................................................................... Error! Bookmark not defined.

SOSTIKA ACHARYA 9
JAVA PROGRAMMING

Scenario
Nova Pharmaceuticals Pvt. Ltd. is one of the renowned manufacturers of a broad range of
prescription and non-prescription drugs in Nepal. Nova is mainly concerned with manufacturing of
non-sterile products which includes Solid, Semi-Solid, Liquid Orals and Solutions for external use.
Nova Pharmaceuticals incorporated latest technology in the industry to produce best quality products.
Coupled with years of experience and in-depth knowledge, Nova Pharmaceuticals customize the
formulation of their product to meet the diverse requirements and to qualify for WHO-GMP and ISO
certification. Nova Pharmaceuticals have an integrated production facility that ensures hygienic
condition for processing with minimum human interference. Their products guarantee total assurance
of food safety and comply with International standards of quality. Every single product is packed with
care to ensure leak free transit and is ready to use. Being a professional managed company, Nova
Pharmaceuticals assure customers of a prompt service and timely delivery of the products at their
desired destination. The management of the Nova Pharmaceuticals has appointed you as a system
developer and designer to increase facilities and conditions of the product sales, billing and stock
maintenance. The management team wants the system to operate even in no-lights condition. You are
required to present a suitable design and solution for secure, smooth, flawless and paperless operation
to cater the needs of sales person, stock manager using java. The pharmaceutical management system
has a single user:
 Sales Person / Administrator
The administrator of the system will be in charge of administering the database and the system.
The roles of administrator include:
 Enter Information of all the products manufactured in the database.

 Allow selling of products to different retailers in the market.

 Inform management about the wish list of medicines from the customers.

 View details of products, sales records.

 Allow stocks monitoring frequently.

 Inform users about the expiry dates of all medicines.


In order to convince the management that you can work independently, you need to demonstrate that
you understand the principles of programming in java, and are able to design, implement and test and

SOSTIKA ACHARYA 10
JAVA PROGRAMMING

document java solutions. In order to meet the all the criteria set above, you are asked to do the following
tasks.

SOSTIKA ACHARYA 11
JAVA PROGRAMMING

Task 1
Discuss the principles, characteristics and features of programming in Java. [1.1, M1]
In order to achieve M1, your writing shows that an effective approach to study and research has
been applied while discussing the principles, characteristics and features of programming in Java.

SOSTIKA ACHARYA 12
JAVA PROGRAMMING

Introduction
Java is a computer programming language. It enables programmers to write computer instructions
using English based commands, instead of having to write in numeric codes. It’s known as a “high-
level” language because it can be read and written easily by humans. Like English, Java has a set of
rules that determine how the instructions are written. These rules are known as its “syntax”. Once a
program has been written, the high-level instructions are translated into numeric codes that computers
can understand and execute. So, in this task, I am going to clearly explain about java programming
and the descriptions of the principles, characteristics and features of the java programming.

Who Created Java?


(Leahy, 2016)“In the early nineties, Java was created by a team led by James Gosling for Sun
Microsystems. It was originally designed for use on digital mobile devices, such as cell phones.” Java
is fast, secure, and reliable. From laptops to datacenters, game consoles to scientific supercomputers,
cell phones to the Internet, Java is everywhere. However, when Java 1.0 was released to the public in
1996, its main focus had shifted to use on the Internet. It provided more interactivity with users by
giving developers a way to produce animated webpages. Over the years, it has evolved as a successful
language for use both on and off the Internet. A decade later, it’s still an extremely popular language
with over 6.5million developers worldwide.

What is Java
Java is a computer programming language. It enables programmers to write computer instructions
using English based commands, instead of having to write in numeric codes. It’s known as a “high-
level” language because it can be read and written easily by humans. Like English, Java has a set of
rules that determine how the instructions are written. These rules are known as its “syntax”. Once a
program has been written, the high-level instructions are translated into numeric codes that computers
can understand and execute.

Like any programming language, the Java language has its own structure, syntax rules, and
programming paradigm. The Java language's programming paradigm is based on the concept of OOP,
which the language's features support.

The Java language is a C-language derivative, so its syntax rules look much like C's. For example,
code blocks are modularized into methods and delimited by braces ({and}), and variables are declared
before they are used.

SOSTIKA ACHARYA 13
JAVA PROGRAMMING

Five Primary Goals in the Creation of the Java Language


 It should be “simple, object-oriented and familiar”.
 It should be “robust and secure”.
 It should be “architecture-neutral and portable”.
 It should execute with “high performance”.
 It should be “interpreted, threaded, and dynamic”.

Some of the Version of Java

Table: Some of the Version of Java

Features of Java
Java was designed with few key features in mind:

Fig: Features of Java

SOSTIKA ACHARYA 14
JAVA PROGRAMMING

Simple
The fundamentals of Java came from a programming language called c++. Although c++ is a powerful
language, it was felt to be too complex in its syntax, and inadequate for all of Java's requirements. Java
built on, and improved the ideas of c++, to provide a programming language that was powerful and
simple to use.

Fig: Java is simple


Dynamic Language
Java supports dynamic loading of classes (a.k.a. “load on demand”), dynamic compilation, and
automatic memory management (garbage collection).

Interpreted
Java supports cross-platform code through the use of Java bytecode. Java is compiled to bytecodes,
which are interpreted by a Java run-time environment. Bytecode can be interpreted on any platform by
JVM.

Portable
Java programs can execute in any environment for which there is a Java run-time system (JVM). It can
be run on any platform (Linux, Window, Mac) and can be transferred over world wide web (e.g.
applets). We may carry the java bytecode to any platform.

According to SUN microsystem:

Fig: Java is portable

SOSTIKA ACHARYA 15
JAVA PROGRAMMING

Reliability
Java needed to reduce the likelihood of fatal errors from programmer mistakes. With this in mind,
object-oriented programming was introduced. Once data and its manipulation were packaged together
in one place, it increased Java’s robustness.

Secure
As Java was originally targeting mobile devices that would be exchanging data over networks, it was
built to include a high level of security. Java is probably the most secure programming language to
date.

Platform Independent
A platform is the hardware or software environment in which a program runs. There are two types of
platforms software-based and hardware-based. Java provides software-based platform. The Java
platform differs from most other platforms in the sense that it is a software-based platform that runs
on the top of other hardware-based platforms. It has two components:

 Runtime Environment
 API (Application Programming Interface)

Java code can be run on multiple platforms e.g. Windows, Linux, Sun Solaris, Mac/OS etc. Java code
is compiled by the compiler and converted into bytecode. This bytecode is a platform-independent
code because it can be run on multiple platforms i.e. Write Once and Run Anywhere(WORA).

Programs needed to work regardless of the machine they were being executed on. Java was written to
be a portable language that doesn't care about the operating system or the hardware of the computer.

Fig: Java is platform independent


Object-Oriented
“Java is an OOPL that supports the construction of programs that consist of collections of collaborating
objects. These objects have a unique identity, encapsulate attributes and operations, and are instances
of classes related by inheritance and polymorphism.”, (Borysowich, 2010).

SOSTIKA ACHARYA 16
JAVA PROGRAMMING

Distributed
Java is designed to support various levels of network connectivity. Java applications are network
aware: TCP/IP support is built into Java class libraries. They can open and access remote objects on
the Internet.

Fig: Java is distributive


Note: In this architecture, same application is distributed in multiple server system.

Robust
Java is designed to eliminate certain types of programming errors. Java is strongly typed, which allows
extensive compile-time error checking. It does not support memory pointers, which eliminates the
possibility of overwriting memory and corrupting data. In addition, its automatic memory management
(garbage collection) eliminates memory leaks and other problems associated with dynamic memory
allocation/de-allocation.

Architecture Neutral
Java applications that are compiled to bytecodes can be interpreted by any system that implements the
Java Virtual Machine. Since the Java Virtual Machine is supported across most operating systems, this
means that Java applications are able to run on most platforms.

Fig: Java is architecture neutral

SOSTIKA ACHARYA 17
JAVA PROGRAMMING

High Performance
Although Java is an interpreted language, it was designed to support “just-in-time” compilers, which
dynamically compile bytecodes to machine code. (Thakur, n.d), “Although in the early releases of
Java, the interpretation of by bytecode resulted in slow performance but the advance version of JVM
uses the adaptive and Just in time (JIT) compilation technique that improves performance by
converting Java bytecodes to native machine instructions on the fly.”

Multithreaded
Java supports multiple threads of execution (a.k.a., lightweight processes), including a set of
synchronization primitives. This makes programming with threads much easier.

The team at Sun Microsystems were successful in combining these key principles, and Java's
popularity can be traced to it being a robust, secure, easy to use, and portable, etc. language.

Where Do I Start Java


 To start programming in Java, all you need to do is download and install the Java development
Kit.
 Once you have the JDK installed on your computer, there's nothing to stop you writing your
first Java program.

Characteristics and Features of Java


Java is an object-oriented programming language. So, the key characteristics and features of java are
same as the object-oriented programming.

Fig: Principles and Characteristics of Java

SOSTIKA ACHARYA 18
JAVA PROGRAMMING

Object
An object is an entity present in a class that means it is any variables and related methods used in
Object Oriented Programming. It is also known as instance and the variables of an object is called
instance variable. For example, there may be many object related to a class ‘student’ such as: name,
age, weight, height, etc. each of these objects have their own instance variable.

Class
It is user defined data type used to declare objects. Once a class is defined we can create any number
of objects of its time. For example: managers, secretory, clerks, office boy, are object of a class
employee. Similarly, car, jeep, bus, truck, etc. are the objects of the class vehicle. It specifies what data
and function will be included in objects of that class.

Data abstraction and encapsulation


Abstraction means “The process of forming of general and relevant concept from more complex
scenarios”, (Singh, beginnersbook.com, 2014) . Joining information and capacities into a solitary unit
called class and the procedure is known as exemplification. Information epitome is essential
component of a class. Class contains both information and capacities. Information is not available from
the outside world and just those capacities which exhibit in the class can get to the information.

Fig: code for encapsulation


Inheritance
It allows the extension and reuse of existing code without having to repeat or rewrite the code. It
involves the creation of new class called derived class from existing class called based class. It is most
powerful features of OOP. When a class is derived through inheriting one or more base class, it is
supported by multiple inheritances. However, the java does not support multiple inheritances. There

SOSTIKA ACHARYA 19
JAVA PROGRAMMING

are four types of inheritance: single inheritance, multiple inheritance, multilevel inheritance and
hierarchical inheritance.

Single Inheritance
Where subclasses acquire the elements of one super class. A class gains the properties of another class.

Fig: Single Inheritance

Fig: code for single inheritance


Multiple Inheritance
Where one class can have more than one super class and inherit features from all parent class. But java
does not supports multiple inheritance.

Fig: Multiple Inheritance

SOSTIKA ACHARYA 20
JAVA PROGRAMMING

Hierarchical Inheritance
Where one class serves as a superclass (base class) for more than one sub class.

Fig: Hierarchical Inheritance


Multilevel inheritance
Where a subclass is inherited from another subclass. It is not uncommon that a class is derived from
another class as shown in the figure.

Fig: Multilevel Inheritance

Fig: code for multilevel inheritance

SOSTIKA ACHARYA 21
JAVA PROGRAMMING

Polymorphism
It consists two words- poly and morph where the term poly means many and the term morph means
form. The polymorphism concerns the possibility for a single property existing multiple states. It is
the capability of object belonging to the same class hierarchy to react differently to the same method
call. It is possible to implement different function key using a common name for a function. It provides
a way of generalizing algorithms.

Fig: code for polymorphism

Constructors
Tutorials Point (2014) states that, “Constructor is an uncommon part capacity of class which is
executed at whatever point in a class, an item is made.” A constructor and a class has precisely same
name which does not have any arrival sort all well as void as well.

Fig: code for constructor


There are manly three types of Constructor, which are as follows:

Default Constructor
“A default constructor is a constructor which can be called without no connections (either characterized
with an unfilled parameter list, or with default contentions accommodated each parameter). A sort with
an open default constructor is Default Constructible”, (Anon, cppreference.com, 2016).

SOSTIKA ACHARYA 22
JAVA PROGRAMMING

Parameterized Constructor
Parameterized constructor is those constructors which have parameter and passes the qualities as
contention to information individual from various items.

Copy Constructor
A copy constructor is a part capacity which introduces an article utilizing another object of the same
class. In the event that we don't characterize our own copy constructor, the java compiler makes a
default copy constructor for every class which does a part insightful copy between articles. “The
compiler made copy constructor works fine when all is said in done. We have to characterize our own
copy constructor just if an article has pointers or any run time portion of asset like document handle,
a system connection etc.”, (Anon, geeksquiz.com, n.d.)

Destructor
A destructor is an uncommon part capacity of a class which erases or destroys the object of a class
when expression is connected or called. A destructor has the very same name as that of Constructor
however has a prefix of tilde (~) in Constructor.

Static Members (Static variable and static method)


We have seen that a class contains two segments. One announces variables and other proclaims
methods. These variables and methods are called Instance variables and instance techniques (Alex,
2007). This is on account of each time class is instantiated, another duplicate of each of them is made.
They are gotten to by utilizing objects with dot operator.

Let us assume that we want to define a member that is common to all objects and accessed without
using a particular object. That is, the member belongs to the class as a whole rather than the objects
created from the class. Such members are defined and declared using keyword static as follow: static
int count; static int max (int x, int y);

 The members that are declared static are known as static members.
 This is also called as class variables and class methods.
 Static variables are used when we want to have a variable common to all instances of class.
 Static members can be called without using objects.
 It can be called by using class.

Java Environment
 Java includes many development tools, classes and methods

SOSTIKA ACHARYA 23
JAVA PROGRAMMING

o Development tools are part of java development Kit (JDK) and


o The classes and methods are part of Java Standard Library (JSL), also known as
Application Programming Interface (API).
 JDK constitute of tools like java compiler, java interpreter and many.
 API includes hundreds of classes and methods grouped into several packages according to their
functionality.

Advantages and Disadvantages of JDK system with an IDE like Netbeans:

Advantages of using an IDE:


 IDEs provide syntax highlighting to users.
 IDEs provide automatic indentation for code blocks.
 IDEs provide line numbers to its users.
 IDEs provide auto code completion.
 IDEs provide auto code generation for inherited members.
 IDEs provide code debugging functionality and making check points to find out errors.
 Some IDEs provide GUI builder to build application for rapid application development

Disadvantages of using an IDE:


 IDEs prevent novice programmers from basic knowledge of language.
 IDEs generate generalized code which is not optimized for all applications.
 IDEs show compatibility issues with projects of other IDEs.

Conclusion
In this task, I have discussed about the java, who invented and for what purpose it was developed.
Also, the key features, principles and characteristics of java has been described.

Java has significant advantages not only as a commercial language but also as a teaching language. It
allows students to learn object-oriented programming without exposing them to the complexity of
C++. “It provides the kind of rigorous compile-time error checking typically associated with Pascal. It
allows instructors to introduce students to GUI programming, networking, threads, and other important
concepts used in modern-day software.”, (Bowen, 1997).

SOSTIKA ACHARYA 24
JAVA PROGRAMMING

Task 2
Critically evaluate the environmental flexibility of programming in Java. [1.2]
Consider: Memory management, Primitives vs. objects / auto-boxing, Non-virtual methods, Single
paradigm, Exception handling, Closure, Floating point arithmetic, look and feel, Performance.

SOSTIKA ACHARYA 25
JAVA PROGRAMMING

Introduction
The design requirements of the Java programming language are driven by the nature of the computing
environments in which software must be deployed. The massive growth of the Internet and the World-
Wide Web leads us to a completely new way of looking at development and distribution of software.
To live in the world of electronic commerce and distribution, Java technology must enable the
development of secure, high performance, and highly robust applications on multiple platforms in
heterogeneous, distributed networks.

So, in this task, I am going to critically evaluate the environmental flexibility of programming in Java.
Java is a very flexible programming language that is used in various companies and at work. Java is a
computer programming language. It enables programmers to write computer instructions using English
based commands, instead of having to write in numeric codes. It’s known as a “high-level” language
because it can be read and written easily by humans.

Memory Management
Memory management in java is responsibility of garbage collector. This is opposite to what has been
a practice before java, where programmer were responsible for allocating deallocating the memory in
programs. Formally speaking, garbage collector is responsible for

 allocating memory
 ensuring that any referenced objects remain in memory, and
 recovering memory used by objects that are no longer reachable from references in executing
code.

In Java, memory is allocated only to objects. There is no explicit allocation of memory, there is only
the creation of new objects. (Java even treats array types as objects.) Objects that are referenced are
said to be live. Objects that are no longer referenced are considered dead and are termed garbage. The
process of finding and freeing (also known as reclaiming) the space used by these objects is known as
garbage collection.

According to (PANKAJ, 2016), “Understanding JVM Memory Model, Java Memory Management are
very important if you want to understand the working of Java Garbage Collection.” JVM memory is
divided into separate parts. At broad level, JVM Heap memory is physically divided into two parts –
Young Generation and Old Generation. Parts of JVM memory is shown below:

SOSTIKA ACHARYA 26
JAVA PROGRAMMING

Fig: Parts of JVM Model


Garbage collection solves many, but not all, memory allocation problems. You could, for example,
create objects indefinitely and continue referencing them until there is no more memory available (Out
of memory error). Garbage collection is also a complex task taking time and resources of its own.
Space is commonly allocated from a large pool of memory referred to as the heap.

“The timing of garbage collection is up to the garbage collector. Typically, the entire heap or a sub-
part of it is collected either when it fills up or when it reaches a threshold percentage of occupancy.”,
(Gupta, 2012)

Primitives vs. objects / auto-boxing


Auto-boxing

Autoboxing are introduced in Java 1.5 to automatically convert the primitive type into boxed primitive
(Object or Wrapper class). autoboxing allows you to use primitive and object type interchangeably in
Java in many places like an assignment, method invocation etc. If you have been using Collections
like HashMap or ArrayList before Java 1.5 then you are familiar with the issues like you cannot directly
put primitives into Collections, instead, you first need to convert them into Object only then only you
can put them into Collections. Wrapper class like Integer, Double and Boolean helps for converting
primitive to Object but that clutter the code. With the introduction of autoboxing and unboxing in Java,
this primitive to object conversion happens automatically by Java compiler which makes the code
more readable.

Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and
their corresponding object wrapper classes. For example, converting an int to an Integer, a double to
a Double, and so on. If the conversion goes the other way, this is called unboxing.

Here is the simplest example of autoboxing:

Character ch = 'a';

SOSTIKA ACHARYA 27
JAVA PROGRAMMING

The rest of the examples in this section use generics. If you are not yet familiar with the syntax of
generics, see the Generics (Updated) lesson.

Consider the following code:

List<Integer> li = new ArrayList<>();


for (int i = 1; i < 50; i += 2)
li.add(i);

Although you add the int values as primitive types, rather than Integer objects, to li, the code compiles.
Because li is a list of Integer objects, not a list of int values, you may wonder why the Java compiler
does not issue a compile-time error. The compiler does not generate an error because it creates
an Integer object from i and adds the object to li. Thus, the compiler converts the previous code to the
following at runtime:

List<Integer> li = new ArrayList<>();


for (int i = 1; i < 50; i += 2)
li.add(Integer.valueOf(i));

Autoboxing and unboxing lets developers write cleaner code, making it easier to read. The following
table lists the primitive types and their corresponding wrapper classes, which are used by the Java
compiler for autoboxing and unboxing:

Primitive type Wrapper class

boolean Boolean

byte Byte

char Character

float Float

int Integer

long Long

short Short

double Double

SOSTIKA ACHARYA 28
JAVA PROGRAMMING

Non-virtual Methods
In C++, you can mark a method to be virtual", which tells the compiler that you will want to use the
most derived method in the object hierarchy. Virtual therefore means that if you have a class A with
method f() and a subclass B with the method f(), and you call the method f() on a handle of A pointing
to a B, then B's f() gets called. If you left out the "virtual" keyword, it would cause A's f() to get called,
i.e. it is bound at compile time, rather than runtime.

In Java, on the other hand, ALL methods are virtual, i.e. the most derived method is always called,
unless of course (read on). (Kabutz, 2001)

public class A {
public void m() {
System.out.println("Class A's method m() Called");
}
}

Single Paradigm
The object-oriented paradigm has gained great popularity in the recent decade. The primary and most
direct reason is undoubtedly the strong support of encapsulation and the logical grouping of program
aspects. These properties are very important when programs become larger and larger.

OOP is based on the sending of messages to objects. Objects respond to messages by performing
operations, generally called methods. Messages can have arguments. A society of objects, each with
their own local memory and own set of operations has a different feel than the monolithic processor
and single shared memory feel of non-object-oriented languages. Therefore, java is single paradigm
language because it only support oop paradigm.

Exception Handling
According to (Singh, Exception Handling, 2012), “An Exception can be anything which interrupts the
normal flow of the program. When an exception occurs program processing gets terminated and
doesn’t continue further. In such cases we get a system generated error message. The good thing about
exceptions is that they can be handled. We will cover the handling part later in this same tutorial.”

Exception can occur at runtime (known as runtime exceptions) as well as at compile-time (known
Compile-time exceptions). There can be several reasons for an exception. For example, following
situations can cause an exception – Opening a non-existing file, Network connection problem,

SOSTIKA ACHARYA 29
JAVA PROGRAMMING

Operands being manipulated are out of prescribed ranges, class file missing which was supposed to be
loaded and so on.

Advantages of Exception Handling


 Exception handling allows us to control the normal flow of the program by using exception
handling in program.
 It throws an exception whenever a calling method encounters an error providing that the calling
method takes care of that error.
 It also gives us the scope of organizing and differentiating between different error types using
a separate block of codes. This is done with the help of try-catch blocks.

Closure
A closure is the combination of a function and the lexical environment within which that function was
declared. It is a persistent scope which holds on to local variables even after the code execution has
moved out of that block. Languages which support closure (such as JavaScript, Swift and Ruby) will
allow you to keep a reference to a scope (including its parent scopes), even after the block in which
those variables were declared has finished executing, provided you keep a reference to that block or
function somewhere.

The scope object, and all its local variables, are tied to the function, and will persist as long as that
function persists.

This gives us function portability. We can expect any variables that were in scope when the function
was first defined to still be in scope when we later call the function, even if we call the function in a
completely different context.

Floating Point Arithmetic


According to (Wayne., 2014), “Java uses a subset of the IEEE 754 binary floating point standard to
represent floating point numbers and define the results of arithmetic operations. Virtually all modern
computers conform to this standard. A float is represented using 32 bits, and each possible combination
of bits represents one real number. This means that at most 232 possible real numbers can be exactly
represented, even though there are infinitely many real numbers (even between 0 and 1). The IEEE
standard uses an internal representation similar to scientific notation, but in binary instead of base 10.
This covers a range from ±1.40129846432481707e-45 to ±3.40282346638528860e+38. with 6 or 7
significant decimal digits, including plus infinity, minus infinity, and NaN (not a number). The number

SOSTIKA ACHARYA 30
JAVA PROGRAMMING

contains a sign bit s (interpreted as plus or minus), 8 bits for the exponent e, and 23 bits for the mantissa
M. The decimal number is represented according to the following formula.”

(-1)s × m × 2(e - 127)

For each floating-point number there is one representation that is said to be normalized. A floating-
point number is normalized if its mantissa is within the range defined by the following relation:

1/radix <= mantissa < 1 (Bill Venners, 1996)

Look and Feel


According to (Oracle, Look and Feel, 2015), “The architecture of Swing is designed so that you may
change the "look and feel" (L&F) of your application's GUI (see A Swing Architecture Overview).
"Look" refers to the appearance of GUI widgets (more formally, JComponents) and "feel" refers to the
way the widgets behave.” At the beginning, Java had its own, but of course most people want to have
their applications look like the others of their OS. You can change the L&F of your Java applications.

(JRL, 2010) states that, “"Look" refers to the appearance of GUI widgets (more formally,
JComponents) and "feel" refers to the way the widgets behave.” In the menu under "Look & Feel"
several options exist that allows you to choose between different Look and Feels included with the
default Java installation.

Performance
According to (Charbonneau, 2005), “Getting Java apps to run is one thing. But getting them to run fast
is another. Performance is a tricky beast in any object-oriented environment, but the complexity of the
JVM adds a whole new level of performance-tweaking trickiness -- and opportunity. This Refcard
covers JVM internals, class loading (updated to reflect the new Metaspace in Java 8), garbage
collection, troubleshooting, monitoring, concurrency, and more.”

Platform Independence
Java was designed to not only be cross-platform in source form like C, but also in compiled binary
form. Since this is frankly impossible across processor architectures Java is compiled to an
intermediate form called byte-code. A Java program never really executes natively on the host
machine. Rather a special native program called the Java interpreter reads the byte code and executes
the corresponding native machine instructions. Thus, to port Java programs to a new platform all that
is needed is to port the interpreter and some of the library routines. Even the compiler is written in
Java. The byte codes are precisely defined, and remain the same on all platforms. (Harold, 2007).

SOSTIKA ACHARYA 31
JAVA PROGRAMMING

Java for Mobile Applications (Java ME)


Java ME stands for Java Micro Edition. According to (Oracle, What is a Mobile Application?, n.d),
“Most mobile applications use the Java Micro Edition (Java ME) platform, which was developed for
small devices like mobile phones, but is now used on a wide variety of devices. Java ME uses scaled
down subsets of Java SE components, virtual machines and APIs. It also defines APIs that are
specifically targeted at consumer mobile and embedded devices.”

Embedded Hardware Programming in Java


Java programs currently execute on PCs or workstations, which of course have a hard disk. Thus, the
Java interpreter expects to be able to load any needed class libraries and code components from a disk.

In contrast, many embedded systems are housed within a highly-constrained box, and have to operate
in the harsh factory floor environment. Lack of space, power or cooling, or excessive vibration may
preclude a standard hard or floppy disk. As a result, we anticipate that embedded applications will be
structured as a small section of initialization code that starts the Java programs from a ROM disk. (A
ROM disk behaves like a hard disk, but uses read-only-memory as the medium.) Any needed
temporary data files will be stored in RAM disks.

Java applets may be called upon to give voice to sound files and sight to arbitrary still or moving
picture files. Thus, the Java runtime operating system must provide hardware support for a wide variety
of potential audio-visual operations. The Java applet environment places open-ended requirements on
its OS.

Embedded applications are generally not so freewheeling; by the time the application is ready for the
field, the OS requirements and hardware environment should be known. Thus, the OS needed for an
embedded Java applications can be tailored to that specific application, by including only what is
known to be needed. The saving in memory size and maintenance effort can be enormous.

Conclusion
Java offers the real possibility that most programs can be written in a type-safe language. However,
for Java to be broadly useful, it needs to have more expressive power than it does at present.

In this task, I have critically evaluated the environmental flexibility of programming in Java. This task
covers the details information about the environment flexibility of programming in java.

SOSTIKA ACHARYA 32
JAVA PROGRAMMING

Task 3
Design a Java programming solution to the problem given in the scenario. [2.1, M2]
In order to achieve M2 your writing needs to demonstrate that a range of methods and techniques
have been applied while designing the java programming solution. Consider: Pseudo-
code/algorithm/flowchart, Context diagram and 0-level DFD diagram.

SOSTIKA ACHARYA 33
JAVA PROGRAMMING

Introduction
In this task, I am going to design a java programming solution to the problem for Nova
Pharmaceuticals.
The diagrams I am going to use in this task are pseudocode, flowchart, context diagram and 0-level
DFD diagram. Activities in each diagram will be mention briefly. Most of these diagrams have several
steps/processes/objects.
We should consider these diagrams before designing a solution so that the solution is obtain accurate
to required one.

Pseudo-code
Pseudo code is a programming analysis tool that is used for planning logic. “Pseudo” means
imitation or false and “code” refers to the instructions. These pseudo-instructions are phrase written
in ordinary natural language (eg. English, French, German. etc.) and hence cannot understood by
the computer. Instead of using symbols to describe the logic steps of a program, as in flowcharting,
pseudocode uses structure that resembles computer instructions. When pseudocode is used for
program planning, a programmer can concentrate solely on developing the logic of the program
without worrying about syntax for writing the program because pseudocode does not have any
syntax rules for formulating instructions. Once the programmer is convinced that the program logic
is sound, he/ she can easily covert the pseudocode into a suitable programming language that can be
run on a computer. Because it emphasizes the design of the program, pseudocode is also called
Program Design Language (PDL).
Advantages of Pseudo-code
Pseudocode has three main advantages:
 Converting a pseudocode to a programming language is much easier than converting a
flowchart to a programming language.
 As compared to a flowchart, it is easier to modify the pseudocode of a program logic when
program modification is necessary.
 Writing of pseudocode involves much less time and effort than drawing an equivalent
flowchart. Pseudocode is easier to write than an actual programming language because it has
only few rules to follow, allowing the programmer to concentrate on the logic of the program
Limitations of Pseudocode
Pseudocode, however, suffers from following limitations:

SOSTIKA ACHARYA 34
JAVA PROGRAMMING

 In case of pseudocode, a graphic representation of a program logic is not available.


 There are no standard rules follow in using pseudocode. Different programmers use their
own style of writing pseudocode and hence communication problem occurs due to lack of
standardization.
 For a beginner, it is more difficult to follow the logic of or write pseudocode, as compared
to flowcharting.
Pseudo code of Nova Pharmaceuticals
Pseudo code for login
Step 1: Initialize text field for username and password
Step 2: Input value of username and password
Step 3: Fetch value of username and password from database
Step 4: Check the value of username and password of user input and value of database
Step 5: If username and password match LOGIN
Step 6: Else not login
Pseudo Code for Product entry
Step 1: Begin
Step 2: Initialize Product Entry Form
Step 3: Input Batch No., Product Name, assign Manufacture date and expiry date, Quantity, Rate of
particular product respectively.
Step 4:
If product should add then Click on ADD button for add button click event
Else click on UPDATE button for update button click event.
Step 5: Connect to the database
Step 6: Execute the insert query
Step 7: Display "data inserted successfully" message
Step 8: End
Flowchart
A flowchart is a pictorial representation of an algorithm. It is the layout, in a visual, two-dimensional
format, of the plan to be followed when the corresponding algorithm is converted into a program by
writing it in a programming language. It acts like a roadmap for a programmer and guides him/ her
on how to go from the starting point to the final point while converting the algorithm into a computer
program. According to (Rouse, techtarget.com, 2008), “A flowchart is a formalized graphic

SOSTIKA ACHARYA 35
JAVA PROGRAMMING

representation of a logic sequence, work or manufacturing process, organization chart, or similar


formalized structure.”
A flowchart is often used by programmers as a program planning tool organizing a sequence of steps
necessary to solve a problem by a computer. It uses boxes of different shapes to denote different
types of instructions. The accrual instructions are written within these boxes using clear and concise
statements. These boxes are connected by solid lines having arrow marks to indicate the flow of
operation, that is, the exact sequence in which the instructions are to be executed. The process of
drawing a flowchart for an algorithm is often referred to as flowcharting.
Flowchart Chart for Login of Nova Pharmaceuticals

Start

Input username and password

Check all the


Yes
credentials No
matches
?

Print Login
Login
failed

Access to
perform
further task

END

Fig: Flowchart for Login of Nova Pharmaceuticals


Flow Chart of Whole System of Nova Pharmaceuticals

SOSTIKA ACHARYA 36
JAVA PROGRAMMING

Start

Input username and


Password

All
credentials No Exit or
Yes
match logout
Open Main ? Stop
Screen

Product Sales
Sales Stock Search
User choice Entry No record No No
? ? ?
? ?

Yes Yes Yes Yes Yes

Enter Product Keep Sales View record Check available Search all
in database billing of all sales products products

Fig: Flow Chart of Whole System of Nova Pharmaceuticals

Context Diagram
The Context Diagram shows the system under consideration as a single high-level process and then
shows the relationship that the system has with other external entities (systems, organizational
groups, external data stores, etc.).
A context diagram is a graphical visualization of the movement of data through an information
system. Context diagrams are one of the three essential components of the structured-systems
analysis and design method (SSADM) (Modern Analyst, n.d.). A context diagram is process centric
and depicts 4 main components.
 Processes (circle)
 External Entities (rectangle)
 Data Stores (two horizontal, parallel lines or sometimes and ellipse)
 Data Flows (curved or straight line with arrowhead indicating flow direction)
Each context diagram may show a number of processes with data flowing into and out of each
process. If there is a need to show more detail within a particular process, the process is decomposed
into a number of smaller processes in a lower level context diagram.

SOSTIKA ACHARYA 37
JAVA PROGRAMMING

Database

Product entry To store information

Keeping records
Sales Nova
Pharmaceuticals

Sales Records
Validating user Authentication

Stock

Fig: Context Diagram of Nova Pharmaceuticals


0-Level DFD Diagram
DFD Level 0 is also called a Context Diagram. It’s a basic overview of the whole system or process
being analyzed or modeled. It’s designed to be an at-a-glance view, showing the system as a single
high-level process, with its relationship to external entities. It should be easily understood by a wide
audience, including stakeholders, business analysts, data analysts and developers. (LucidChart, n.d)
DFD Rules and Tips
 Each process should have at least one input and an output.
 Each data store should have at least one data flow in and one data flow out.
 Data stored in a system must go through a process.
 All processes in a DFD go to another process or a data store.
 Data stored in a system must go through a process.

SOSTIKA ACHARYA 38
JAVA PROGRAMMING

Sales Record Stock Search

Store Data
Database
Nova
Product entry
Retrieve Data Pharmaceuticals

Access Data and Manage system


Sales

Keep record in database

Login
User/Administrator

Fig: 0-Level DFD for Nova Pharmaceuticals


Schema
The first things we do to set up a database is to define its structure (schema definition). This is done
by identifying the characteristics of each field in it. A good way to begin defining the schema of a
database is to list down on paper all the fields that are to be included in the database, and then to
determine the name, type, and size of each field. This information is the captured into the system
using a tool called schema builder. The schema builder enables a user to define a database schema
interactively by programming the user to enter the field name, field type, field size, and so on for
each field.
Invalid source specified. states that “The term "schema" can refer to a visual representation of a
database, a set of rules that govern a database, or to the entire set of objects belonging to a particular
user.” These formulas are communicated in a data definition language, for example, SQL. As a
component of a data dictionary, a database diagram demonstrates how the substances that make up
the database identify with each other, including tables, views, stored procedures, and more.
According to Invalid source specified., “While defining the schema of a database, it is important
to consider possible future needs and the needs of all types of users of the database.” That is, all
possible fields that may be needed should be included in the database structure while defining it.
Although it is possible to modify the database structure at any time, making such modifications is a
time-consuming process. Hence, it is always better to design a database carefully in the first instance
and minimize the need to modify the database structure.

SOSTIKA ACHARYA 39
JAVA PROGRAMMING

Ordinarily, a database planner makes a database schema to help developers whose software will
communicate with the database. The way toward making a database pattern is called data modeling.

Fig: Schema for Nova Pharmaceuticals

Conclusion
In this task, I have used appropriate systems analysis tools and techniques to design a java
programming solution for Nova Pharmacy. The diagrams I have used in this task are pseudocode,
flowchart, context diagram and 0-level DFD diagram. Activities in each diagram have been mentioned
briefly.
Each of these diagrams focuses on critical aspect of the system modeling by Nova Pharmacy. It means
that the person reading the model is also focusing on one critical aspect. So, the Pharmacy should make
sure that they are drawing the diagram that is focused on that critical aspect. That is, Data Flow
Diagram focuses the reader’s attention on the functions in the system. Entity-Relationship focuses on
the data relationships.

SOSTIKA ACHARYA 40
JAVA PROGRAMMING

Task 4
Explain the components and data and file structures required to implement the given design.
[2.2, M3]
Consider: Identify all the classes with their respective objects, files/tables used, list of variables,
methods and properties of every class. Note: refer task 3 when explaining the components and data
file structures required to implement the given design.

In order to achieve M3, your work need to show that a range of methods have been used and
technical language has been accurately used when explaining the components data and file
structures.

SOSTIKA ACHARYA 41
JAVA PROGRAMMING

Introduction
In this task, I am going to explain the components and data file structures required to implement the
design of Nova Pharmaceuticals. Now, I will make a table of numbers that has two columns and an
indeterminate number of rows for implemented solution of data and file structure of Nova
Pharmaceuticals alongside class names and their articles, tables utilized as a part of database, rundown
of variable utilized as a part of a solution method and properties of each class.

Overview of Nova pharmaceuticals


Nova Pharmaceuticals Pvt. Ltd. is one of the renowned manufacturers of a broad range of
prescription and nonprescription drugs in Nepal. Nova is mainly concerned with manufacturing of
non-sterile products which includes Solid, Semi-Solid, Liquid Orals and Solutions for external use.
Nova Pharmaceuticals incorporated latest technology in the industry to produce best quality products.
Coupled with years of experience and in-depth knowledge, Nova Pharmaceuticals customize the
formulation of their product to meet the diverse requirements and to qualify for WHO-GMP and ISO
certification.

The planning process for a new or revised pharmaceutical supply system should include a
pharmaceutical management information system (PMIS). The PMIS is an organized system for
collecting, processing, reporting and using information for decision making. Design of Nova
Pharmaceuticals is based on the differing information needs of users at each level of the system and
should build on existing forms, reports and procedures as much as possible.

Here is a table of numbers that has two columns and an indeterminate number of rows for implemented
solution of data and file structure of Nova Pharmaceuticals alongside class names and their articles,
tables utilized as a part of database, rundown of variable utilized as a part of a solution method and
properties of each class.

Table Identification of objects and data and file structures based on given scenario
Application name Nova Pharmaceutical
Programing language Java
Delivery environment Android mobile
Development environment Android Studio
Class name Login
Product
Sales

SOSTIKA ACHARYA 42
JAVA PROGRAMMING

Sales Record
Stock
Search
Db_connection
Fragments FragmentMainActivity
FragmentProductEntry
FragmentSales
FragmentsSalesRecord
FragmentSearch
FragmentStock
FragmentLogout
In above table, we recognize the application name for the arrangement as Nova Pharmaceutical. And
its conveyance condition is in Android and it was created in android studio, Java programing language
is utilized as programing language for improvement of a solution, it additionally have diverse class
while actualizing. By and large, it has 6 class for product entry, sales, sales record, search, stock and
login. What's more, there is one class for database association as db_connection.

Here the list of class along with their objects and used reasons.

S.N Class Name Object of class Remarks


1. LoginActivity For login and checking
username and password
from database
2. Db_connection databaseconnection database is able to
provide information
describing its tables, its
supported SQL grammar,
its stored procedures, the
capabilities of this
connection
3. Edittext Etusername, etpassword, Text field for Nova
etbatch, etproductname, pharmaceutical
etproductquantity,

SOSTIKA ACHARYA 43
JAVA PROGRAMMING

etproductrate, etsearch,
etsalesbatch, etbill,
etsalesquantity,
etsalesprice, etsalestotal,
etamountpaid, etreturn
4. DatePicker Mfddate, expdate, Date field of application
salesdate
5. Button Btnlogin, btncancel, Buttons used in
btnadd, btnupdate, programming solution
btnsearch, btnnext,
btnclear, btnsave, btntotal
6. SQLiteDatabase database Has method to create,
delete, execute SQL
command.
7. FragmentProductentry fpe
8. FragmentSales fsales
9. FragmentSalesRecord fsalesrecord
10. FragmentStock fstock
11. FragmentSearch fsearch
This is the list of various class used in Nova pharmaceuticals android application. The various class
have its own objects and own purpose.

Along with class in android there is xml files too. Here are the list of xml files present in android
application.

S.N XML files Remarks


1. Activity_admin_panal Design of Admin panel
2. Activity_login Design of Login Page
3. Fragment_product_entry Design for product entry
4. Fragment_sales Design for sales
5. Fragmenta_sales_record Design for sales record
6. Fragment_search Design for search page
7. Fragment_stock Design for stock

SOSTIKA ACHARYA 44
JAVA PROGRAMMING

Methods used in Nova Pharmaceuticals programing solution

The used methods in the developed system is listed here along with the reason to use them.

Methods Reason for the use


Open It is used for opening database connection.
onClick It is used for handling button click.
onCreate This method is used for linking java class with UI
and running statement that should run when that
class is called.
onContextItemSelected It is used for handling context menu item selection

onCreateContextMenu It is used for handling context menu creation

Table used while developing the application

1. Login

Data Store Description

Class name: Loginactivity

Description: Contains the username and password


Table name:- tbl_user
Element Name Description Type Remark

Id Holds the unique Integer Auto increased by 1.


number.

Username Username of user Varchar (50)

Password Unique option for Varchar(50)

security of the user login

2. Product Entry

Data Method and variable description

SOSTIKA ACHARYA 45
JAVA PROGRAMMING

Class name: ProductEntry

Description: contains the manufactured product details

Table name:- tbl_products


Element Name Description Type Remark

Batch_no Batch number of Varchar (50) Primary key

product(unique)
Product_name The Name of the product going Varchar (50)
to be added.

Manufacture_date Products‟s manufacture date Date

Expirydate Product‟s expiry date Date

Quantity Quantity of the product Integer

Rate Rate of the product Integer

3. Sells

Data method and variable description

Class name: sales

Description: contains the product sales details records

Table name :- tbl_sales


Element Name Description Type Remark

billno Bill number of the Integer Primary key


sales (unique)

ProductName Name of the product Varchar (50)

Solddate Sold date of the Date


product

SOSTIKA ACHARYA 46
JAVA PROGRAMMING

Quantity Quantity of the Integer

product sold out


Price Price of the product. Integer

Variables used in our application:


S. No Variables Data Type Purpose

1. Id Integer To store user‟s id.

2. username Varchar (50) To store name of the user.

3. Password Varchar (50) To store password of the user.

4. Batch_no Varchar (50) To store batch number of the product.


5. ProductName Varchar (50) To store product name.

6. Manufacture_Date Date To store manufacture date of the product.

7. expirydate Date To store expire date of the product.

8. Quantity Integer To store quantity of the product.

9. Rate Integer To store rate of the product.

10. Solddate Date To store sold date of the product.

11. Billno Integer To store bill number as well the information


of that bill.
12. Price Double To store price of the product
13. totalamount Double To store the total amount of the products he
sold.
14. changedamount Double To store the amount changed by the seller.

15. amountpaid Double To store the amount paid by the customer.

SOSTIKA ACHARYA 47
JAVA PROGRAMMING

Conclusion
In this task, I have explained the components and data file structures required to implement the design
of Nova Pharmaceuticals. Also, I have made a table of numbers that has two columns and an
indeterminate number of rows for implemented solution of data and file structure of Nova
Pharmaceuticals alongside class names and their articles, tables utilized as a part of database, rundown
of variable utilized as a part of a solution method and properties of each class.

SOSTIKA ACHARYA 48
JAVA PROGRAMMING

Task 5: A
Implement a Java programming solution based on a prepared design. [3.1]
Define relationships between objects to implement the design requirements. [3.2]
Consider: Event handling, control structures, conditionals, loops, exception handling and error
reporting mechanisms, effective use of IDE using code and screen templates.

SOSTIKA ACHARYA 49
JAVA PROGRAMMING

Introduction
In this task, I am going to implement a java programming solution based on a prepared design of Nova
Pharmaceuticals. The design for Nova Pharmaceuticals is GUI based along with their xml codes.

After listing file types and designing programing solution, we are going to implement it with java
programing languages. Here is the implementation of java programing solution.

Here is the UI design of java programing solution along with their xml codes.

Login Page

Fig: Login Page


Code for Login Page

SOSTIKA ACHARYA 50
JAVA PROGRAMMING

Relationship between object and implemented designed of Login Activity


Control Setting of some required Properties of the used controls
Name ID Text Object used in implemented designed
Fragments LoginActivity R.layout.activity_login
TextView1 Txtusername Username
TextView2 Txtpassword Password
EditText1 Etusername etusername
EditText2 Etpassword etpassword
Button1 Btnlogin Login btnlog
Button2 Btncancel Cancel Btncan

Navigation Menu

Fig: navigation menu


Code for Navigation Menu

Fig: code for navigation menu

SOSTIKA ACHARYA 51
JAVA PROGRAMMING

Relationship between object and implemented designed of Main Activity


Control Setting of some required Properties of the used controls
Name ID Text Object used in implemented designed
Fragments MainActivity R.layout.activity_admin_panel
Item1 Nav_product Product Entry FragmentProductEntry
Item2 Nav_search Search Product FragmentSearch
Item3 Nav_sales Sales Product FragmentSales
Item4 Nav_salesrecord Sales Record FragmentSalesRecord
Item5 Nav_stock Stock FragmentStock

Product Entry Form

Fig: product entry form


Code for Product Entry Form

Fig: code for product entry form

Relationship between object and implemented designed of Product entry

SOSTIKA ACHARYA 52
JAVA PROGRAMMING

Control Setting of some required Properties of the used controls


Name ID Text Object used in implemented designed
Fragments FragmentProductEntry R.layout.fragment_product_entry
TextView1 Txtbatchno Batch Number
EditText1 Etbatch etproductbactch
TextView2 Txtproductname Product Name
EditText2 Etproductname etproductname
TextView3 Txtmfd Manufacture Date
Datepicker1 Dpmfd Mfd
TextView4 Txtexpd Expiry Date
Datepicker2 Dpexpd Expd
TextView5 Txtquantity Quantity
EditText3 Etquantity Etproductquantity
TextView6 Txtrate Rate
EditText4 Etrate Etpoductrate
Button1 Btnadd Add Medicine Btnaddmedicine
Button2 Btnupdate Update Medicine Btnupdatemedicine

Sales Form

Fig: sales form

Codes for Sales Form

SOSTIKA ACHARYA 53
JAVA PROGRAMMING

Fig: code for sales form

Relationship between object and implemented designed of Sales


Control Setting of some required Properties of the used controls
Name ID Text Object used in implemented designed
Fragments FragmentSales R.layout.fragment_sales
TextView1 Txtbatchno Batch Number
EditText1 Etsalesbatch etsalesbactch
TextView2 Txtbill Bill Number
EditText2 Etbill etsalesbill
TextView3 Txtmfd Product Name
Spinner Spproductname spproductname
TextView4 Txtexpd Date
Datepicker1 Dpsalesdate Date
TextView5 Txtquantity Quantity
EditText3 Etsalesquantity etsalesquantity
TextView6 Txtrate Rate
EditText4 Etsalesrate etsalesrate
TextView7 Txtprice Price
EditText5 Etsalesprice etsalesprice
TextView8 Txttotal
EditText6 Etsalestotal Ettotal
TextView9 Txtamount

SOSTIKA ACHARYA 54
JAVA PROGRAMMING

EditText7 Etsalesamount etamount


TextView10 Txtreturn
EditText8 Etsalesreturn etreturn
Button1 Btnnext Next btnnext
Button2 Btnclear Clear btnclear
Button2 Btnsave Save btnsave
Button3 Btntotal Total btntotal

Sales Record Table

Fig: sales record table


Code for Sales Record Table

Fig: code for sales record table

Relationship between object and implemented designed of Sales Record


Setting of some required Properties of the used controls

SOSTIKA ACHARYA 55
JAVA PROGRAMMING

Control ID Text Object used in implemented designed


Name
Fragments FragmentSalesRecord R.layout.fragment_sales_record
TextView1 Sales Record
TextView2 Product Name
TextView3 Sold Date
TextView4 Bill
TextView5 Quantity
TextView6 Price
TableLayout1 Tblsales

Search Fragment

Fig: search fragment


Code for Search Fragment

SOSTIKA ACHARYA 56
JAVA PROGRAMMING

Fig: code for search fragment

Relationship between object and implemented designed of Search


Control Setting of some required Properties of the used controls
Name ID Text Object used in implemented designed
Fragments FragmentSearch R.layout.fragment_search
TextView1 Txtbatch Batch Number
EditText1 Etsearchbatch Etsearch
Button Btnsearch Search btnsearch
ListView Lvsearch lvlist

SOSTIKA ACHARYA 57
JAVA PROGRAMMING

Stock Table

Fig: stock table


Code for Stock Table

Fig: code for stock table

Relationship between object and implemented designed of Stock


Control Setting of some required Properties of the used controls
Name ID Text Object used in implemented designed
Fragments FragmentStock R.layout.fragment_stock
TextView1 Stocks
TextView2 Product Name
TextView3 Quantity
TextView4 Batch Number
TableLayout1 Tblstock
These are the fragment for different section of a java programming solution of a Nova Pharmaceuticals
Pvt. Ltd. After designing fragments database table was created. For database table creation we used
db_connection class.

SOSTIKA ACHARYA 58
JAVA PROGRAMMING

Here is coding of database creation

Fig: code for database creation


At first user is created, then that user perform activity in an application. Here are the table used in
database and their entity

Fig: User Table

Fig: Product Table

Fig: sales table

After creating tables in database, we identified the relationship between tables. Here is the
representation in ER diagram

SOSTIKA ACHARYA 59
JAVA PROGRAMMING

Fig: ER Diagram

Conclusion
In this task, I have implemented a java programming solution based on a prepared design of Nova
Pharmaceuticals. The design for Nova Pharmaceuticals is GUI based along with their xml codes.

After listing file types and designing programing solution, I have implemented it with java programing
languages.

SOSTIKA ACHARYA 60
JAVA PROGRAMMING

Task 5 - B
Implement object behaviors using control structures to meet the design algorithms. [3.3, M1]
Identify and implement opportunities for error handling and reporting. [3.4]
Make effective use of and Integrated Development Environment (IDE) including code and screen
templates. [3.5, M1]
Consider: Event handling, control structures, conditionals, loops, exception handling and error
reporting mechanisms, effective use of IDE using code and screen templates.

In order to achieve M1, your writing shows that an effective judgement has been made while
implementing and different object behaviors in Java.

SOSTIKA ACHARYA 61
JAVA PROGRAMMING

Introduction
In this task, I am going to discuss about the even handling in java which are used to trigger customized
actions based on specific events and conditions. Also, control structures, conditionals, loops, exception
handling and error reporting mechanisms, effective use of IDE using code and screen templates will
be discussed in this task.

Control Structure/ Conditionals


According to (jojo, 2012), “Control structures form the basic entities of a “structured programming
language. We all know languages like C/C++ or Java are all structured programming languages.
Control structures are used to alter the flow of execution of the program.” A control structure is a
primary concept in most high-level programming languages. In its simplest sense, it is a block of code.
More specifically, control structures are blocks of code that dictate the flow of control. In other words,
a control structure is a container for a series of function calls, instructions and statements.

So, to implement a particular control structure in a programming language, we need to learn how to
use the relevant control statements in that particular language.

 Selection structures are implemented using If, If Else and Switch statements.
 Looping structures are implemented using While, Do While and For statements.

The control statements are:

 Switch
 If
 If else
 Do-while loop
 For

 Switch case

Execution of switch statement begins by evaluating the expression inside the switch keyword brackets.
The expression should be an integer (1, 2, 100, 57 etc) or a character constant like ‘a’, ‘b’ etc. This
expression’s value is then matched with each case values. There can be any number of case values
inside a switch statements block. If first case value is not matched with the expression value, program

SOSTIKA ACHARYA 62
JAVA PROGRAMMING

control moves to next case value and so on. When a case value matches with expression value, the
statements that belong to a particular case value are executed.

Syntax for Switch Case

switch(expression)

case value 1;

statement 1;

statement 2;

break;

case value2:

statement 1;

statement 2;

break;

default:.

statement 1;

statement 2;

break;

Fig: screenshot of switch statement

SOSTIKA ACHARYA 63
JAVA PROGRAMMING

 If statement

The expression given inside the brackets after if is evaluated first. If the expression is true, then
statements inside the curly braces that follow if(expression) will be executed. If the expression is false,
the statements inside curly braces will not be executed and program control goes directly to statements
after curly braces.

Syntax for If statement

if (expression) // This expression is evaluated. If expression is TRUE statements inside the


braces will be executed

statement 1;

statement 2;

statement 1;// Program control is transfered directly to this line, if the expression is FALSE

statement 2;

Fig: screenshot of if statement


 If Else statement

Syntax for If-else statement

If (condition 1){

action 1;

else if(condition 2){

SOSTIKA ACHARYA 64
JAVA PROGRAMMING

action 2;

Fig: screenshot of if-else statement


 Do While loop

Unlike while, do while is an exit controlled loop. Here the set of statements inside braces are executed
first. The condition inside while is checked only after finishing the first time execution of statements
inside braces. If the condition is TRUE, then statements are executed again. This process continues as
long as condition is TRUE. Program control exits the loop once the condition turns FALSE.

Syntax of do-while loop:


do{
action statements;
}
while(condition){
action statements;
.
.
}

Fig: screenshot of do while statement

SOSTIKA ACHARYA 65
JAVA PROGRAMMING

 For loop

The for statement is an entry controlled loop. The difference between while and for is in the number
of repetitions. The for loop is used when an action is to be executed for a predefined number of times.
The while loop is used when the number of repetitions is not predefined.

Syntax of for loop:

For (initialization statements; condition; increment/decrement statements){


action statements;
.
.
}

Fig: screenshot of for statement


Loop
(Bolton2, 2016) states that, “Loops are among the most basic and powerful of programming concepts.
A loop in a computer program is an instruction that repeats until a specified condition is reached. In a
loop structure, the loop asks a question. If the answer requires an action, it is executed. The same
question is asked again and again until no further action is required. Each time the question is asked is
called an iteration.”

A computer programmer who needs to use the same lines of code many times in a program can use a
loop to save time.

Types of Loop
 A for loop is a loop that runs for a preset number of times.
 A while loop is a loop that is repeated as long as an expression is true. An expression is a
statement that has a value.
 A do while loop or repeat until loop repeats until an expression becomes false.

SOSTIKA ACHARYA 66
JAVA PROGRAMMING

 An infinite or endless loop is a loop that repeats indefinitely because it has no terminating
condition, the exit condition is never met or the loop is instructed to start over from the
beginning. Although it is possible for a programmer to intentionally use an infinite loop, they
are often mistakes made by new programmers.
 A nested loop appears inside any other for, while or do while loop.

A goto statement can create a loop by jumping backward to a label, although this is generally
discouraged as a bad programming practice. For some complex code, it allows a jump to a common
exit point that simplifies the code.

Event Handling
Changing the state of an object is known as an event. For example, click on button, dragging mouse
etc. I have designed for the Nova Pharmacy. The java.awt. event package provides many event classes
and Listener interfaces for event handling. A source creates an Event and send it to at least one audience
members enrolled with the source. When even is go received by the users, they processed the even and
after that arrival. Event are bolstered by various Java packages, as java.util, java.awt and
java.awt.event.

Components of Event Handling


Event handling has three main components,

 Events: An event is a change of state of an object.


 Events Source: Event source is an object that generates an event.
 Listeners: A listener is an object that listens to the event. A listener gets notified when an event
occurs.

Fig: screenshot of event handling

SOSTIKA ACHARYA 67
JAVA PROGRAMMING

Exception Handling / Error Handling and Reporting


According to (Singh, Exception Handling, 2012), “An Exception can be anything which interrupts the
normal flow of the program. When an exception occurs program, processing gets terminated and
doesn’t continue further. In such cases we get a system generated error message. The good thing about
exceptions is that they can be handled.”

Exception can occur at runtime (known as runtime exceptions) as well as at compile-time (known
Compile-time exceptions). There can be several reasons for an exception. For example, following
situations can cause an exception – Opening a non-existing file, Network connection problem,
Operands being manipulated are out of prescribed ranges, class file missing which was supposed to be
loaded and so on.

Advantages of Exception Handling


 Exception handling allows us to control the normal flow of the program by using exception
handling in program.
 It throws an exception whenever a calling method encounters an error providing that the calling
method takes care of that error.
 It also gives us the scope of organizing and differentiating between different error types using
a separate block of codes. This is done with the help of try-catch blocks.

Why to handle exception?


If an exception is raised, which has not been handled by programmer then program execution can get
terminated and system prints a non-user-friendly error message.

This is how we handle exception in our coding.

Fig: screenshot of try catch

SOSTIKA ACHARYA 68
JAVA PROGRAMMING

Effective use of IDE


“An integrated development environment (IDE) is a software suite that consolidates the basic tools
developers need to write and test software. Typically, an IDE contains a code editor, a compiler or
interpreter and a debugger that the developer accesses through a single graphical user interface (GUI).
An IDE may be a standalone application, or it may be included as part of one or more existing and
compatible applications.”, (Rouse, Effective use of IDE, 2016).

Even a simple search for IDEs will turn up quite a few choices. IDEs are available from Open Source
communities, vendors, and software companies. They range from free to pricing dependent upon the
number of licenses required. There isn't a standard for IDEs and each has its own capabilities, along
with strengths and weaknesses. According to (Christiano, 2015), “Generally, an IDE provides an easy-
to-use interface, automates development steps, and allows developers to run and debug programs all
from one screen. It can also provide the link from a development operating system to an application
target platform, like a desktop environment, smartphone or microprocessor.”

SOSTIKA ACHARYA 69
JAVA PROGRAMMING

By the help of android studio we have created our programing solution. Here is the programing solution
along with code behind it.

Login Page

Code for Login Page

SOSTIKA ACHARYA 70
JAVA PROGRAMMING

Navigation Menu

Code for Navigation Menu

Product Entry Form

SOSTIKA ACHARYA 71
JAVA PROGRAMMING

Code for Product Entry Form

Sales Form

Codes for Sales Form

SOSTIKA ACHARYA 72
JAVA PROGRAMMING

Sales Record Form

Codes for Sales Record Form

Search Fragment

SOSTIKA ACHARYA 73
JAVA PROGRAMMING

Codes for Search Fragment

Stock Table

Codes for Stock Table

Conclusion
In this task, I have discussed about the even handling in java which are used to trigger customized
actions based on specific events and conditions. Also, control structures, conditionals, loops, exception
handling and error reporting mechanisms, effective use of IDE using code and screen templates were
discussed.

SOSTIKA ACHARYA 74
JAVA PROGRAMMING

Task 6
Critically review and test the Java programming solution and analyze actual test results against
expected results to identify discrepancies. [4.1, 4.2]
Consider: Unit Testing, Integrated Testing, Compatibility Testing, Stress Testing, Maintain the test log
that maintains the following information: What was tested, test carried, expected output, obtained output?

SOSTIKA ACHARYA 75
JAVA PROGRAMMING

Introduction
According to (Zafar, 2012), “Software testing is the process of evaluation of any system or item to
detect differences between given input and expected output.” While making android application there
might be some bugs and errors. Some of those bugs and errors are unimportant, but some of them are
expensive or dangerous. So, we need to check everything and anything we produce because things can
always go wrong. Therefore, in this task I am going to test the android application of Nova Pharmacy
to know/ identify the errors made my me while making the android app for Nova Pharmacy.

There are different types of testing by which errors can be identified. And they are:

 Unit Testing
 Integrated Testing
 Compatibility Testing
 Stress Testing

Unit Testing
(Exam, 2016) states that, “A unit test is the smallest testable part of an application like functions,
classes, procedures, interfaces. Unit testing is a method by which individual units of source code are
tested to determine if they are fit for use.”

Unit tests are essentially composed and executed by programming engineers to ensure that code meets
its outline and necessities and carries on of course. The objective of unit testing is to isolate each piece
of the program and test that the individual parts are working effectively.

Method Used for unit testing:


White Box Testing method is used for executing the unit test.
When Unit testing should be done?
Unit testing should be done before Integration testing.
By whom unit testing should be done?
Unit testing should be done by the developers.

Unit Testing
Test Date Component to Expected Results Actual Results Remarks
be tested

SOSTIKA ACHARYA 76
JAVA PROGRAMMING

25th May Login After correct After login main Test was
2017 authentication username and admin panel was successful
password login page displayed
should provide
access to main
admin panel

Test Date Component to Expected Results Actual Results Remarks


be tested

25th May Navigation When clicked on Product entry form Test was
2017 menus navigation menus was opened when successful
respective page product tab clicked
should open respectively sales,
sales record, search
and stock page opened

SOSTIKA ACHARYA 77
JAVA PROGRAMMING

Integrated Testing
“Integration testing is a software testing methodology used to test individual software components or
units of code to verify interaction between various software components and detect interface defects.”,
(Techopedia, n.d). Components are tested as a single group or organized in an iterative manner. After
the integration testing has been performed on the components, they are readily available for system
testing.

Integration is a key software development life cycle (SDLC) strategy. Generally, small software
systems are integrated and tested in a single phase, whereas larger systems involve several integration
phases to build a complete system, such as integrating modules into low-level subsystems for
integration with larger subsystems. Integration testing encompasses all aspects of a software system's
performance, functionality and reliability.

Integration Testing
Test Component to be Expected Results Actual Results Remarks
Date tested

25th Search product by Product should be Batch number B01 was Test was
May its batch number displayed after searched and its successful
2017 entering its corresponding product
corresponding batch dcold was displayed
number

SOSTIKA ACHARYA 78
JAVA PROGRAMMING

Test Component to be Expected Results Actual Results Remarks


Date tested

25th Medicine add Medicine should be Medicine added to Test was


May conformation added to database database was confirmed successful
2017 after pressing add via conformation
medicine button message

SOSTIKA ACHARYA 79
JAVA PROGRAMMING

Compatibility Testing
“Compatibility Testing is a type of Software testing to check whether your software is capable of
running on different hardware, operating systems, applications, network environments or Mobile
devices.”, (Guru99, 2017).

It can be of two types - forward compatibility testing and backward compatibility testing.

Compatibility Testing
Test Date Component to be Expected Results Actual Results Remarks
tested

25th May Compatibility of Application should Application Test was successful


2017 application in the run smoothly performed very
Android version smoothly
5.0.1

Test Date Component to be Expected Results Actual Results Remarks


tested

25th May Compatibility of Application should This version of Test was successful
2017 application in the have no problem to android
Android version run in this version supported
4.2.2 application very
well

SOSTIKA ACHARYA 80
JAVA PROGRAMMING

Stress Testing
(TutorialsPoint, n.d) states that, “Stress testing a Non-Functional testing technique that is performed
as part of performance testing. During stress testing, the system is monitored after subjecting the
system to overload to ensure that the system can sustain the stress.”

The recovery of the system from such phase (after stress) is very critical as it is highly likely to happen
in production environment.

Stress Testing
Test Component to Expected Results Actual Results Remarks
Date be tested

25th Validation of user Wrong authentication Error message was Test was successful
May should not allow to displayed while
2017 login trying to login

SOSTIKA ACHARYA 81
JAVA PROGRAMMING

Test Component to Expected Results Actual Results Remarks


Date be tested

25th Addition of two Medicine should not Error occurred while Test was successful
May different be added to database adding medicine
2017 medicine with
same batch
number

Critical Review
Now, I am going to do critical analysis of the programming solution which I have designed Nova
Pharmacy. Critical analysis of the programming solution will help to identify/ know the advantages
and weaknesses of the android application of Nova Pharmacy. Critical analysis is necessary for the
programming solution because it helps to know the advantages and weaknesses of the android
application. By knowing the weaknesses of our application, we can convert it into the advantage and
can make it strength point of the programming solution of Nova Pharmacy.

SOSTIKA ACHARYA 82
JAVA PROGRAMMING

As a system developer and designer, I have designed an android solution for Nova Pharmacy which
includes all the requirements of Nova Pharmacy. The administrator of the system will be in charge of
administering the database and the system.
Advantage of Programing Solution
 Proper management of product
 Product entry have amount and quantity to register
 Easy to search medicine is available or not
 From stock, can check the available quantity of product
 Proper billing system
 Sold items quantity and amount can easily tracked
Conclusion
As, I have been appointed to the Nova Pharmacy for as a system developer and designer, my work is
to increase facilities and conditions of the product sales, billing and stock maintenance. Therefore, I
have designed an android application for Nova Pharmacy. After completing the android app for the
pharmacy, testing the application was done using different testing methods to identify the error of the
programming solution. Therefore, in this task, I have tested the android application of Nova Pharmacy
using the different testing methods like unit testing, integrated testing, compatibility testing and stress
testing. The programming solution of Nova Pharmacy includes all the requirements like product entry,
search product, stock, etc. which fulfill the client’s requirements. Also, critical analysis has been done
which helps to identify the strengths and weakness of the application. Though there is weakness
besides advantages, we can convert those weakness into the strength point of the Nova Pharmacy.

SOSTIKA ACHARYA 83
JAVA PROGRAMMING

Task 7
Evaluate independent feedback on a developed Java programming solution and make
recommendations for improvements. [4.3]

SOSTIKA ACHARYA 84
JAVA PROGRAMMING

Introduction
Nova Pharmaceuticals Pvt. Ltd. is one of the renowned manufacturers of a broad range of prescription
and nonprescription drugs in Nepal. Nova is mainly concerned with manufacturing of nonsterile
products which includes Solid, Semi-Solid, Liquid Orals and Solutions for external use. Nova
Pharmaceuticals incorporated latest technology in the industry to produce best quality products.
Coupled with years of experience and in-depth knowledge, Nova Pharmaceuticals customize the
formulation of their product to meet the diverse requiremsents and to qualify for WHO-GMP and ISO
certification.

As, I am appointed as a system developer and designer for programming solution of Nova Pharmacy,
my work is to increase facilities and conditions of the product sales, billing and stock maintenance.
The management team wants the system to operate even in no-lights condition. Therefore, I have to
present a suitable design and solution for secure, smooth, flawless and paperless operation to cater the
needs of sales person, stock manager using java.

So, I have designed an android application for Nova Pharmacy in order to meet the requirement of our
scenario. After completing the programming solution of the Nova Pharmacy, now in this task I am
going to take feedback related to the situation of the android application and will evaluate it
independently.

Independent Feedback
Name of the Application: Nova Pharmaceuticals

Feedback Given by: K r i t i k a Signature:


Timcina
Project Description (in brief): Nova Pharmaceuticals Pvt. Ltd. is one of the renowned
manufacturers of a broad range of prescription and non prescription drugs in Nepal. Nova is
mainly concerned with manufacturing of nonsterile products which includes Solid, Semi-Solid,
Date: 26th march, 2016
Liquid Orals and Solutions for external use. Nova Pharmaceuticals incorporated latest technology
in the industry to produce best quality products. Coupled with years of experience and in-depth
knowledge, Nova Pharmaceuticals customize the formulation of their product to meet the diverse
requirements and to qualify for WHO-GMP and ISO certification.
It want to increase facilities and conditions of product sales, billing and stock maintenance. It
has a single user and sales person is administrator who have following roles
 Enter Information of all the products manufactured in the database.

SOSTIKA ACHARYA 85
JAVA PROGRAMMING

 Allow selling of products to different retailers in the market.


 Inform management about the wish list of medicines from the customers.
 View details of products, sales records.
 Allow stocks monitoring frequently.
 Inform users about the expiry dates of all medicines

Important  Proper management of product


Features of the  Product entry have amount and quantity to register
Application  Easy to search medicine is available or not
 From stock, can check the available quantity of product
 Proper billing system
 Soled item quantity and amount can easily tracked
Checklists YES NO Comment
Have identified objects and data and file structures √ Objects and data types was
required to design the system? identified
Have system requirements been defined and are they √ Requirement has defined
clear?
Have Front End and Back End of the system has √ Android studio and SQlite
been designed? server used
Does the system has been implemented in align with? √ System is implemented in
the proper design? android phone
Have been critically tested and reviewed the system √ Different testing approach
or not? was used
Does the system solve the problem of the client? √ Client requirement is
fulfilled and solved it
Does the system fulfill the requirements of the clients? √

Significance of the  Proper Data Maintenance


Application  Proper Sorting of Data
 Easy Data storing and retrieving mechanism
 Faster Data Searching
 Reduction of paper work

SOSTIKA ACHARYA 86
JAVA PROGRAMMING

Limitation  The application is single user application


 Should manually enter the product to entry it
 In search only product name is shown
 In stock only quantity is visible not expiry date of product
 Billing can’t print
 No password change option
Feedback Evaluation
Feedback Evaluated by: Sostika Acharya Signature:
Date:14/06/2017

Evaluation of the System:


I have considered feed back given by my friend and looking in various criteria I have evaluate
and improved my employee information system.

Recommendations for future consideration:

 User will able to change their own password


 There will be option to print bill
 Stock will check available quantity
 Search option will be more modified

Conclusion
In this task, I have evaluated the independent feedback on a developed Java programming solution
from which the comparison with the other pharmacy lead to a better understanding. The
recommendations which I have made are the conclusions of the analysis of the independent feedback.
The suggested recommendation can improve the quality of the programming solution of Nova
Pharmacy if applied.

SOSTIKA ACHARYA 87
JAVA PROGRAMMING

Task 8
Create user documentation for the developed Java program solution. [4.4, M2]
In order to achieve 4.4, you need to create a user manual guide.

Consider: Steps that are required to complete each operation, screen shots of individual steps to help
the end user.

In order to achieve M2 your writing needs to demonstrate that a range of methods and techniques
have been applied while creating the java programming solution

SOSTIKA ACHARYA 88
JAVA PROGRAMMING

Introduction
In this task, I am going to make the documentation of my project of designing an android application
for Nova Pharmacy. As, I am appointed as “System Developer and Designer” in Nova Pharmacy, I
should be able to document it well. I have to increase facilities and conditions of the product sales,
billing and stock maintenance. The effective documentation for support and maintenance of
programming solution of Nova Pharmacy is shown below:

Here is the user manual for using the application


At first, we have to go through our smartphone and have to search the application named as “Nova
Pharmacy”.
After finding the app named as “Nova Pharmacy”, we have to click on that application in order to
use that app.

After opening the app of Nova Pharmacy, login page will open where we have to provide our
username and password. If the username and password is correct, then login will be successful and
the main activity will open.

SOSTIKA ACHARYA 89
JAVA PROGRAMMING

If we provide incorrect username or password, then login will be fail. And the message showing
login failed will be shown.

After providing username and password in the login page, main admin panel will appear to go to the
navigation menu.

SOSTIKA ACHARYA 90
JAVA PROGRAMMING

In navigation menu, there are list of menus from where required section can be selected and for
adding product in an application select product entry menu.

Now, a navigation menu is open where we can see various tab. Likewise we, can go through the
product tab in order to add a new product. After clicking on the product tab, a form will open where
we can add a new product by providing its batch number, product name, its manufacture date and
expiry date along with quantity and its rate.

SOSTIKA ACHARYA 91
JAVA PROGRAMMING

After providing all the required information in the form of product, it will add medicine or also can
update it. For adding the medicine to the database, we have to click on the add button.

Here, in the above screenshot, you can see the message providing “medicine added”.

Likewise adding medicine, you can also update it. For updating medicine, you have to fulfill all the
required data and have to click on update button.

SOSTIKA ACHARYA 92
JAVA PROGRAMMING

Similarly, feature for searching medicine is also available in the app. For searching the medicine,
we have to go to the searching tab, and have to click on that search product tab.

After clicking on the search product tab, a page for searching medicine will open. We have to
provide batch number in order to search any required medicine.

SOSTIKA ACHARYA 93
JAVA PROGRAMMING

In order to search the medicine “dcold”, I have provided its batch number and clicked on the search
tab. And in above screenshot, you can see the message “search complete” for searching the medicine
“dcold”.
In order to sale the product, we have to go to the sales tab in the navigation menu.

After, clicking on the sales tab form navigation menu, sales form will open where we can sale our
product. In order to sale the product we have to fulfill the form like, date, quantity to sale and its
rate along with total payable amount and amount paid by the customers and the amount to return to
them.

SOSTIKA ACHARYA 94
JAVA PROGRAMMING

After providing all the required data in the sales form, press next for performing other sales.

After performing sales of all medicine press save to save it in database

SOSTIKA ACHARYA 95
JAVA PROGRAMMING

To view the list of sales item, go to sales record tab in navigation menu

After going to the sales record tab, a page showing the record of the product sold will be shown.

SOSTIKA ACHARYA 96
JAVA PROGRAMMING

In order to know the number of available product, we have to go to stock tab and click on that tab.

After selecting stock tab, a list will appear with available product along with its batch number and
available quantity

SOSTIKA ACHARYA 97
JAVA PROGRAMMING

Finally, now we can exit form the app of Nova Pharmacy by selecting logout tab from navigation
menu to exit the application.

Conclusion
Thus, in this task, I have done all the documentation which are required for the android application of
Nova Pharmacy. I have mentioned all the features available in the application of Nova Pharmacy which
was utilized while making the programming solution. In this task, documentation for the support and
upkeep of the application has been made utilizing a scope of strategies and specialized dialects.

SOSTIKA ACHARYA 98
JAVA PROGRAMMING

Task 9
Create technical documentation for the support and maintenance of a Java program solution
[4.5, M3]
Consider: Designing the layout, your choice of tools, task breakdown approach, data and information
collection mechanism, product deployment and maintenance technique for the project.

In order to achieve M3, your work need to show that a range of methods have been used and
technical language has been accurately used when creating documentation for the support and
maintenance of the Java program solution and also you need to submit the slides and presentation
observation report.

SOSTIKA ACHARYA 99
JAVA PROGRAMMING

Introduction
Nova Pharmaceuticals Pvt. Ltd. is one of the renowned manufacturers of a broad range of prescription
and non-prescription drugs in Nepal. Nova is mainly concerned with manufacturing of nonsterile
products which includes Solid, Semi-Solid, Liquid Orals and Solutions for external use.

The aim of the Nova Pharmacy is to make an android app for their company which is secure, smooth,
flawless and paperless operation to cater the needs of sales person, stock manager using java. Their
management team wants the system to operate even in no-lights condition. The company has appointed
me as a system developer and designer to increase facilities and conditions of the product sales, billing
and stock maintenance. So, as a system developer and designer, I have designed an android application
for Nova Pharmacy in order to fulfill their requirements. Therefore, in this task, I am going to create a
technical documentation for the support and maintenance of an android application for Nova
Pharmacy.

According to (Rhyous, 2011), “Technical documentation is critical to the success of any software.
However, most creators of software struggle to provide adequate documentation for their product. Rare
is the software that is praised for its documentation. When documentation is praised, it is often only
praised for having some documentation, which is more than most, but in reality documentation is
usually still inadequate.”

Purpose
The purpose of this document is to outline the technical design of the programming solution of Nova
pharmacy and provide an overview for the android application implementation.

Its main purpose is to:

 To increase facilities and conditions of the product sales, billing and stock maintenance.
 To operate even in no-lights condition
 To present a suitable design and solution for secure, smooth, flawless and paperless operation
to cater the needs of sales person, stock manager using java.

Scope
The programming solution of Nova Pharmacy outlined in this document builds upon the scope defined
in the requirements phase.

Document Organization
The document is organized into the following sections:

SOSTIKA ACHARYA 100


JAVA PROGRAMMING

Project Background
Nova Pharmaceuticals Pvt. Ltd. is one of the renowned manufacturers of a broad range of prescription
and non prescription drugs in Nepal. Nova is mainly concerned with manufacturing of nonsterile
products which includes Solid, Semi-Solid, Liquid Orals and Solutions for external use. Nova
Pharmaceuticals incorporated latest technology in the industry to produce best quality products.
Coupled with years of experience and in-depth knowledge, Nova Pharmaceuticals customize the
formulation of their product to meet the diverse requirements and to qualify for WHO-GMP and ISO
certification.

As, their aim is to make an android app for their company which is secure, smooth, flawless and
paperless operation to cater the needs of sales person, stock manager using java. Their management
team wants the system to operate even in no-lights condition. The company has appointed me as a
system developer and designer to increase facilities and conditions of the product sales, billing and
stock maintenance. So, as a system developer and designer, I have designed an android application for
Nova Pharmacy in order to fulfill their requirements.

Application name Nova Pharmaceutical


Programing language Java
Delivery environment Android mobile
Development environment Android Studio

Design the Layouts


(McWade, 2016) states that, “Layout is master plan or blue print of any system so for completing any
project first the layout is important.” Different layouts were used while designing the programming
solution of Nova Pharmacy. Here is logical layout that is pseudo-code for Nova Pharmaceuticals.

Login

Step 1: Start.
Step 2: Check Username and Password, which is stored in database.
Step 3: If both Username and Password match Display "login Successful" ``message and Open admin
panel.
Step 4: Else Display "login Unsuccessful" message and redirect to same page.
Step 5: End.

SOSTIKA ACHARYA 101


JAVA PROGRAMMING

Product Entry

Step 1: Begin
Step 2: Initialize Product Entry Form
Step 3: Input Batch No., Product Name, assign Manufacture date and expiry date, Quantity, Rate of
particular product respectively.
Step 4:
If product should add then Click on ADD button for add button click event
Else click on UPDATE button for update button click event.
Step 5: Connect to the database
Step 6: Execute the insert query
Step 7: Display "data inserted successfully" message
Step 8: End
Flow Chart

Flow chart of whole system of Nova Pharmaceuticals

Start

Input username and


Password

All
credentials No Exit or
Yes
match logout
Open Main ? Stop
Screen

Product Sales
Sales Stock Search
User choice Entry No record No No
? ? ?
? ?

Yes Yes Yes Yes Yes

Enter Product Keep Sales View record Check available Search all
in database billing of all sales products products

Fig: flow chart of nova pharmaceutical


Flow chart explain the working flow of nova pharmaceutical. This shows when the application is start
it ask for username and password. After entering username and password it will check it with database
if all credential is match, main screen will display if not then it will ask again for correct username and

SOSTIKA ACHARYA 102


JAVA PROGRAMMING

password. After login user can choice for product entry then product entry form will appear and there
product can be added to database. If user choice is sales then sales billing page will appear from where
bills can be stored in database of sold product. If user want to view sales record, stock or search product
they can choose sales record, stock or search tab respectively.

Dataflow Diagram

Sales Record Stock Search

Shows data to user


from database

Store Data
Database
Nova
Product entry
Retrieve Data Pharmaceuticals
Access Data and Manage system

Sales

Keep record in database


Login

User/Administrator

Fig: 0-level DFD diagram of Nova Pharmaceuticals


0-level DFD diagram shows the actual flow of a data in a Nova Pharmaceuticals. When user or
administrator logged in system will provide access to them after that they can add product and bill of
sales item to system, system will store that data to database and will retrieve that data for search, sales
record and stock.

Tools Used
Android Studio is used while designing an android solution for Nova Pharmacy. According to
(Nilanchala, 2013), “Android Studio is an IDE based on IntelliJ IDEA used for android application
development.” This tool has more options for Android Development, making the process faster and
more productive. A “live layout” was shown that renders your app as you’re editing in real-time.

SOSTIKA ACHARYA 103


JAVA PROGRAMMING

Prior to Android Studio, developers were relying only on the open source eclipse as IDE with ADT
plugin for android development. Due to this android was always falling back compared Apples xCode
IDE for iOS based development. After android studio release Google can equally bet with iOS platform
in terms of development assets.

Android studio is based on IntelliJ IDEA, which does all the functionality that Eclipse with ADT plug-
in do, with lot more additional features. The initial version of android studio offersGradle-based build
support.

 Android-specific refactoring and quick fixes


 Lint tools to catch performance, usability, version compatibility and other problems
 ProGuard and app-signing capabilities
 Template-based wizards to create common Android designs and components.
 A rich layout editor: it allows you to drag-and-drop UI components, preview layouts on
multiple screen configurations. Preview appears instantly as you change in the layout editor.
You can choose a language, and can see the preview of layout with that locale.
 Rich Color Preview editor: While adding colors as a resource, and we can see the color preview
at the left hand side of the editor.
 Deep Code Analysis: If you point to a line and it gives detailed explanation about an exception
based on the annotation added. And you can also know which constants are allowed for which

SOSTIKA ACHARYA 104


JAVA PROGRAMMING

API. It also has the powerful code completion. You can also inspect code in whole project,
InteliJ lists all Lint errors during code inspection.

Data and Information Collection Process


According to (Ludy Mae Nalzaro, 2012), “Data collection is the process by which the researcher
collects the information needed to answer the research problem.” It is used to identify the detail
information about the system and the new system they want. The detail information about the android
application of the Nova Pharmacy to develop a programming solution has been collected using
different data collection methods like interviews, observations, investigation of documents, focus
groups, etc.

Interviews
Different types of questions have been asked to the different stakeholders of the Nova Pharmacy
individually to explore the views, experiences, beliefs and motivation of the Pharmacy. This interview
method will help the Pharmacy to explore the thinking, assumptions, emotions, attitudes, perceptions
which may be influencing observed behavior of those involved in some way in the change in learning
and teaching (L&T) being evaluated. An interview schedule will help Nova Pharmacy to manage their
time during data collection, factoring in time allowance for transcription and analysis.

Observations
The working process of the Nova Pharmacy is observed by going to the Pharmacy. This method is
helping Nova Pharmacy by providing information needed to frame the evaluation and make sense of
data collected using other methods. Observations can provide good insights into how the different
participants are behaving and interacting.
Investigation of documents:
Different documents of the Pharmacy such as product sales, billing and stock maintenance of the Nova
Pharmacy was investigated.
Focus groups:
A focus group is a group discussion on a particular topic organized for research purposes. This
discussion is guided, monitored and recorded by a researcher. It uses group dynamics to generate
qualitative data. Focus groups are used for generating information on collective views, and the
meanings that lie behind those views. They are also useful in generating a rich understanding of
participants' experiences and belief. This method is helping Nova Pharmacy to clarify, extend, qualify
or challenge data collected through other methods.

SOSTIKA ACHARYA 105


JAVA PROGRAMMING

Constraints
It is assumed that making a change to one constraint will affect one or both of the others. For example,
increasing the scope of the project is likely to require more time and money. The limitation that we
must consider while making the android application for the Nova Pharmacy are as per the following:

Cost
The cost is a constraint on the grounds that a particular sum has been set and the framework can't go
over the financial plan. Not all companies have millions of pounds to buy all the best equipment, so
when it comes to IT support will have to find the tools, software, and hardware as cheap as they can,
but also that allows them to do the job effectively and efficiently. This of course will mean that it may
take more time to do certain job because they don't have all the tools, or it may mean that they cannot
do the job altogether of they don't have the correct software etc.

Organizational Policies
The organizational policies are a constraint because it disables the user to use the system in their own
way as the organizational policies may restrict them. Nova Pharmacy has its own organizational policy
as every other organization have. Application should be design in such a way that it should not violate
any policy or rules of the Pharmacy. If the system made violates the organizational policy, Nova
Pharmacy may not accept it in their organization.

Legacy System
(Suzanne Franco, 2015), “Legacy transformation eases constraints when it comes to organizations
embracing new technology such as on-demand computing, cloud computing and mobile computing.”
Nova Pharmacy might be using the legacy system and they may not want to change it in the new
system. Therefore, the application designer has to use the legacy system as a constraint in the new one
as legacy system may create the problem due to its compatibility and security issue.

Hardware Platforms
The hardware system is a constraint because the system will work smoothly, if the hardware supports
it. (Fonseca, 2016) states that, “A computer is actually a huge electronic circuit, with many
components, so each component has their constraints with regard to temperature, operating voltage,
and others.” If the hardware crashes, the system will fail as well. Nova Pharmacy may not want to
change the hardware system of their Pharmacy as it will increase their cost but the hardware used may
bring compatibility issue in the new system. Likewise, the smooth work of the system depends upon

SOSTIKA ACHARYA 106


JAVA PROGRAMMING

the hardware used to support them. So, the designer should also duly consider the hardware platform
used in the system.

Deployment Technique
“Software deployment is the process of getting your program ready for market. A newly created
program may work fine on your computer, but that doesn’t mean it is really ready for others to use.
There are many extra programs features you probably hadn’t needed for yourself, but ought to provide
if the program will be used by others.”, (Godtland, 2011).

Here are few steps for deployment of an android application of Nova Pharmacy.

Regression Testing
Before publishing the application of Nova Pharmacy, We need to make sure that its meeting the basic
quality expectations for all Android apps, on all of the devices that you are targeting. So, we have to
perform all the required testing on different devices including phone and tablets.

Application Rating
When we will publish my application at Google Play, We will have to specify a content rating for our
app, which informs Google Play users of its maturity level. Currently available ratings are (a) Everyone
(b) Low maturity (c) Medium maturity (d) High maturity.

Targeted Regions
Google Play lets us control what countries and territories where our application will be sold.
Accordingly, we must take care of setting up time zone, localization or any other specific requirement
as per the targeted region.

Application Size
Currently, the maximum size for an APK published on Google Play is 50 MB. If our app “Nova
Pharmacy” exceeds that size, or if we want to offer a secondary download, we can use APK Expansion
Files, which Google Play will host for free on its server infrastructure and automatically handle the
download to devices.

SDK and Screen Compatibility


It is important to make sure that our app is designed to run properly on the Android platform versions
and device screen sizes that you want to target.

SOSTIKA ACHARYA 107


JAVA PROGRAMMING

Application Pricing
Deciding whether our app will be free or paid is important because, on Google Play, free app's must
remain free. If we want to sell our application then we will have to specify its price in different
currencies.

Promotional Content
It is a good marketing practice to supply a variety of high-quality graphic assets to showcase your app
or brand. After we publish, these appear on our product details page, in store listings and search results,
and elsewhere.

Build and Upload release-ready APK


The release-ready APK is what we will upload to the Developer Console and distribute to users. We
can check complete detail on how to create a release-ready version of your app: Preparing for Release.

Finalize Application Detail


Google Play gives us a variety of ways to promote our app and engage with users on our product details
page, from colourful graphics, screen shots, and videos to localized descriptions, release details, and
links to our other apps. So, we can decorate our application page and provide as much as clear crisp
detail we can provide.

Gantt Chart
A Gantt chart, commonly used in project management, is one of the most popular and useful ways of
showing activities (tasks or events) displayed against time. On the left of the chart is a list of the
activities and along the top is a suitable time scale. Each activity is represented by a bar; the position
and length of the bar reflects the start date, duration and end date of the activity.

This allows you to see at a glance:

 What the various activities are


 When each activity begins and ends
 How long each activity is scheduled to last
 Where activities overlap with other activities, and by how much
 The start and end date of the whole project

To summarize, a Gantt chart shows you what has to be done (the activities) and when (the schedule).

SOSTIKA ACHARYA 108


JAVA PROGRAMMING

Now, I am going to design gantt chart to show work breakdown of our project which shows the start
and end date of the whole project, various activities of my project, when each activity begins and ends,
how long each activity is scheduled to last, where activities overlap with other activities and by how
much. The gantt chart to show work breakdown of our project is depicted below:

Gant Chart to Show Work Breakdown of Our Project

Fig: Gant Chart to Show Work Breakdown of Our Project of Java Programming

For any project to impliment successfully methodology plays vital roles and for our softwar designing
project we also follows methodology. First week I have planned the system we gather different
information required to impliment our project then designing step take place according to design we
start to write a code. After susccessful coding and designing we test our application using different
testing methods. After all set we deploye our app in play store. Finally we create documentaion for
future support and maintance of a application.

Once Gantt Chart is completed, it can be used to determine the time period taken by us to complete
our project for designing our application. This simple chart provides all the information required for
project planning and scheduling which help everyone to stay on track and informed from the start to
finish.

Conclusion
The aim of the Nova Pharmacy is to make an android app for their company which is secure, smooth,
flawless and paperless operation to cater the needs of sales person, stock manager using java. Their
management team wants the system to operate even in no-lights condition. The company has appointed

SOSTIKA ACHARYA 109


JAVA PROGRAMMING

me as a system developer and designer to increase facilities and conditions of the product sales, billing
and stock maintenance. So, as a system developer and designer, I have designed an android application
for Nova Pharmacy in order to fulfill their requirements. Therefore, in this task, I have created a
technical documentation for the support and maintenance of an android application for Nova
Pharmacy.

SOSTIKA ACHARYA 110


JAVA PROGRAMMING

Task 10/A
In order to achieve D1, you need to write a few paragraphs that the given evaluate, and draw and
justify conclusions of the arguments or ideas presented in task 5..

For D1
Task 5
As I have been appointed as a system and developer and designer in the Nova Pharmacy, I have
to make an android application for Nova Pharmacy which includes all the information’s related
to the Pharmacy of Nova which will increase facilities and conditions of the product sales, billing
and stock maintenance. The application contains different information in different tabs. The
Navigation menu of the application is its front door. It is the important page that attract the user
towards their app which will provide brief information of their Pharmacy.

In the task 5, I have performed my task in two parts: part A and part B. in part A, I have implemented
a java programming solution based on a prepared design of Nova Pharmaceuticals. The design for
Nova Pharmaceuticals is GUI based along with their xml codes. After listing file types and designing
programing solution, I have implemented it with java programing languages.

After listing file types and designing programing solution, I have implemented it with java programing
languages. Also, the implementation of java programing solution along with their xml codes was
shown in the task 5.

Similarly, in part B, I have discussed about the even handling in java which are used to trigger
customized actions based on specific events and conditions. Also, control structures, conditionals,
loops, exception handling and error reporting mechanisms, effective use of IDE using code and screen
templates were discussed.

Control structure is also discussed in this task 5. Java includes a rich set of statements that are used to
control the flow of execution in our code. Types of control statement were implemented wjile doing
the task like: if-else statement, switch case, for loop, etc. These statements fall into three categories:

Selection statements (if and switch) is used to select a statement or statement block to be executed.
These statements are used to select from among multiple paths of execution. The if statement is
typically used to execute statements if a specific condition evaluates as true. The if statement is

SOSTIKA ACHARYA 111


JAVA PROGRAMMING

optionally coupled with the else statement in order to force a selection from one of two possible
execution paths. Although the switch statement can be used to select from one or two possible
execution paths, it’s most often used when there are more than two possible execution branches.

Iteration statements (for, foreach, while, and do) is used to build loops in this task. Each of these loops
has different characteristics that make it more or less useful in specific situations. The for loop is most
useful when statements must be executed a specific number of times; the foreach loop is used to iterate
over each item in a collection. The while loop executes statements for as long as a controlling
expression evaluates as true; the do loop is similar to the while loop but guarantees that the controlled
statements execute at least once.

Error handling mechanisms have become one of the most important language features introduced in
java. Exceptions provide enhanced capabilities to control error processing by separating error handling
from the rest of the code. This enables us to develop robust and fully encapsulated software
components. Java exceptions, however, leave a programmer with a number of challenges: no compile-
time checking, memory management, throwing exceptions in constructors.

Like event handling, control structures, conditionals, loops, exception handling and error reporting
mechanisms effective use of IDE using code and screen templates were discussed.

SOSTIKA ACHARYA 112


JAVA PROGRAMMING

Task 10/B
In order to achieve D2, you will provide evidence that you have taken responsibility for
planning, managing and organizing activities while doing all tasks and project. The evidence will
show how you have planned, organized and managed the activities.
For D2

harmaceuticals incorporated latest technology in the industry to produce best quality products. Coupled
with years of experience and in-depth knowledge, Nova Pharmaceuticals customize the formulation
of their product to meet the diverse requirements and to qualify for WHO-GMP and ISO certification.

As, I am appointed as a system developer and designer for programming solution of Nova Pharmacy,
my work is to increase facilities and conditions of the product sales, billing and stock maintenance.
The management team wants the system to operate even in no-lights condition. Therefore, I have to
present a suitable design and solution for secure, smooth, flawless and paperless operation to cater the
needs of sales person, stock manager using java.

So, I have designed an android application for Nova Pharmacy in order to meet the requirement of our
scenario. After completing the programming solution of the Nova Pharmacy, I have taken a feedback
related to the situation of the android application in task 7 and evaluated it independently and make
recommendation for improvements.

Evaluations often make recommendations about how a program can be improved, how the risk of
program failure can be reduced or whether a program should continue. However, not all evaluations
include recommendations. It is important to clarify whether recommendations are expected when
developing the evaluation brief, terms of reference or scope of work.

If recommendations are developed on the basis of the evaluation findings, processes which involve
stakeholders in developing and/or reviewing them will contribute to the use of the evaluation findings.
The individual or group who has control of the evaluation – a manager or evaluation steering
committee – should be consulted when developing recommendations as their support will probably be
very important in order to ensure that the evaluation findings are disseminated and used.

In task 7, I have evaluated the independent feedback on a developed Java programming solution from
which the comparison with the other pharmacy lead to a better understanding. The recommendations
which I have made are the conclusions of the analysis of the independent feedback. The suggested
recommendation can improve the quality of the programming solution of Nova Pharmacy if applied.

SOSTIKA ACHARYA 113


JAVA PROGRAMMING

So, in this task I have taken a valuable time of Miss. Kritika for feedback. She also provides me her
priceless feedback in both positive and negative. Her positive feedback helps me to know the strength
of my project in better way. And her negative feedback was vital as it allows me to know the lacking
factor of my programming solution. It indicates limitation of android application which ultimately
leads to future improvement. Not only that, she also provides me recommendation of my solution
which I implement for Nova Pharmaceutical for future updates and better version of it. As I am
appointed as a system developer and designer to increase facilities and conditions of the product sales,
billing and stock maintenance of Nova pharmaceuticals. It’s my responsibility to fulfill their
requirement on android application. Before, delivering them the project independent feedback from
Miss. Kritika helps me to overcome the lacking and weakness of project.

After her feedback, I console with Nova Pharmaceutical. That I have better option and improved ideas.
They were happy to hear their requirement was only to search product, but I implement such a way
that while searching they can find if the product is available or not. Also, according to their
requirement, they only need to add product we add update option too. They want to monitor expiry
date in stock but we add available number of product.

In this way, her feedback was responded. If Nova Pharmaceuticals required any future update her
feedback will be vital as it provide great idea.

SOSTIKA ACHARYA 114


JAVA PROGRAMMING

References
Alex. (2007, September 18). learncapp.com. Retrieved 2016, from www.learncpp.com:
http://www.learncpp.com/cpp-tutorial/812-static-member-functions/

Anon. (2016, March 7). cppreference.com. Retrieved 2016, from en.cppreference.com:


http://en.cppreference.com/w/cpp/language/default_constructor

Anon. (n.d.). geeksquiz.com. Retrieved 2016, from geeksquiz.com: http://geeksquiz.com/copy-


constructor-in-cpp/

Bill Venners, J. (1996, October 1). Floating Point Arithmetic. Retrieved from javaworld.com:
http://www.javaworld.com/article/2077257/learn-java/floating-point-arithmetic.html

Bolton2, D. (2016, November 15). Loop. Retrieved from thoughtco.com:


https://www.thoughtco.com/definition-of-loop-958105

Borysowich, C. (2010, September 22). Object Oriented. Retrieved from toolbox:


http://it.toolbox.com/blogs/enterprise-solutions/key-features-of-the-java-language-41397

Bowen, B. D. (1997, January 1). Educators embrace Java. Retrieved from javaworld:
http://www.javaworld.com/article/2076867/educators-embrace-java.html

Charbonneau, P. -H. (2005). Java Performance Optimization. DZone.

Christiano, M. (2015, August 3). Effective use of IDE. Retrieved from allaboutcircuits.com:
https://www.allaboutcircuits.com/technical-articles/what-are-integrated-development-
environments/

Exam, I. (2016). what is unit testing. Retrieved from istqbexamcertification:


http://istqbexamcertification.com/what-is-unit-testing/

Fonseca, D. N. (2016, April 12). What are hardware constraints? Retrieved from quora:
https://www.quora.com/What-are-hardware-constraints

Godtland, A. (2011, March 6). Software Deployment. Retrieved from godtlandsoftware.com:


http://www.godtlandsoftware.com/word-press/2011/03/26/what-is-software-deployment/

SOSTIKA ACHARYA 115


JAVA PROGRAMMING

Gupta, L. (2012, November 11). Memory Management. Retrieved from howtodoinjava.com:


http://howtodoinjava.com/core-java/garbage-collection/revisiting-memory-management-and-
garbage-collection-mechanisms-in-java/

Guru99. (2017, March 4). compatibility testing]]. Retrieved from guru99:


http://www.guru99.com/compatibility-testing.html

Harold, E. R. (2007, January 28). Java is Platform Independent. Retrieved from cafeaulait:
http://www.cafeaulait.org/course/week1/18.html

jojo. (2012, September 20). Control Structure. Retrieved from circuitstoday.com:


http://www.circuitstoday.com/control-structures-in-c-and-cpp

JRL. (2010, April 10). Look and Feel. Retrieved from stackoverflow.com:
https://stackoverflow.com/questions/2612888/what-does-look-and-feel-java-swing-mean

Kabutz, D. H. (2001, May 31). Non-Virtual Methods. Retrieved from javaspecialists.com:


http://www.javaspecialists.eu/archive/Issue021.html

Leahy, P. (2016, July 25). Java Programming Language. Retrieved from thoughtco:
https://www.thoughtco.com/what-is-java-2034117

LucidChart. (n.d). 0-Level DFD Diagram. Retrieved from lucidchart:


https://www.lucidchart.com/pages/data-flow-diagram

Ludy Mae Nalzaro, B. (2012, June 9). Data Collection Process. Retrieved from slideshare:
https://www.slideshare.net/ludymae/chapter-9methods-of-data-collection

McWade, J. (2016, October 21). What is Layout? Retrieved from lynda.com:


https://www.lynda.com/Page-Layout-tutorials/What-layout/442849/549938-4.html

Modern Analyst. (n.d.). modernanalyst.com. Retrieved from www.modernanalyst.com:


http://www.modernanalyst.com/Careers/InterviewQuestions/tabid/128/ID/1433/What-is-a-
Context-Diagram-and-what-are-the-benefits-of-creating-one.aspx

Nilanchala. (2013, May 9). Android Studio. Retrieved from stacktips.com:


http://stacktips.com/tutorials/android/android-studio-features

Oracle. (2015). Look and Feel. Retrieved from oracle.com:


https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html

SOSTIKA ACHARYA 116


JAVA PROGRAMMING

Oracle. (n.d). What is a Mobile Application? Retrieved from netbeans:


https://netbeans.org/kb/trails/mobility.html

PANKAJ. (2016, June 11). Memory Management. Retrieved from journaldev.com:


http://www.journaldev.com/2856/java-jvm-memory-model-memory-management-in-java

Rhyous. (2011, July 21). What id Technical Documentation? Retrieved from rhyous.com:
https://www.rhyous.com/2011/07/21/the-different-types-of-technical-documentation-for-
software-and-why-each-is-important/

Rouse, M. (2008, August). techtarget.com. Retrieved 2016, from whatis.techtarget.com:


http://whatis.techtarget.com/definition/flowchart

Rouse, M. (2016, June 3). Effective use of IDE. Retrieved from techtarget.com:
http://searchsoftwarequality.techtarget.com/definition/integrated-development-environment

Singh, C. (2012). Exception Handling. Retrieved from beginnersbook.com:


http://beginnersbook.com/2013/04/java-exception-handling/

Singh, C. (2014, August 01). beginnersbook.com. Retrieved 2016, from beginnersbook.com:


http://beginnersbook.com/2013/04/oops-concepts/

Suzanne Franco. (2015, July 30). Legacy System Constraints. Retrieved from itweb:
http://www.itweb.co.za/index.php?option=com_content&view=article&id=145084

Techopedia. (n.d). integrated circuit. Retrieved from techopedia:


https://www.techopedia.com/definition/7751/integration-testing

Thakur, D. (n.d). Features of java. Retrieved from ecomputernotes:


http://ecomputernotes.com/java/what-is-java-evolution/explain-features-of-java

TutorialPoint. (2014, September 9). Analysis Tools. Retrieved from tutorialspoint:


https://www.tutorialspoint.com/software_engineering/software_engineering_quick_guide.ht
m

TutorialsPoint. (n.d). Stress Testing. Retrieved from tutorialspoint:


https://www.tutorialspoint.com/software_testing_dictionary/stress_testing.htm

Wayne., R. S. (2014, April 22). Floating Pont Arithmetic. Retrieved from .cs.princeton.edu:
http://introcs.cs.princeton.edu/java/91float/

SOSTIKA ACHARYA 117


JAVA PROGRAMMING

Zafar, R. (2012, March 20). Software Testing. Retrieved from codeproject:


https://www.codeproject.com/Tips/351122/What-is-software-testing-What-are-the-different-
ty

SOSTIKA ACHARYA 118

You might also like