IT-IPT01-Integrative-Programming-and-Technologies - Module
IT-IPT01-Integrative-Programming-and-Technologies - Module
TABLE OF CONTENTS
Foreword 3
References 126
2
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
FOREWORD
The Authors
Rachel T. Alegado
Leonylyn P. Bensi
Michael E. Bensi
Marcelino C. Collado, Jr.
Dr. Arnold P. Dela Cruz
Allen Paul Esteban
Marvin DG. Garcia
Cris Norman P. Olipas
Christian Peña
3
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
LESSON 1
JAVA FUNDAMENTALS
LET’S START! LEARNING OBJECTIVES
What is a Program?
Programs are instructions or step-by-step procedures that programmers write using a
programming language to command the computer about a series of activities that must be done.
Programs are essential set of instructions allowing computers to become useful in performing its
intended functions. When computers are not operated and instructed by set of program
instructions, such technology is just a mere machine.
Programming Languages
Programming languages are written in different forms, in different formats, and in different
syntax. Programming languages vary depending on how it was developed to make a computer
run a set of instructions. They are classified into machine language, assembly language, and high-
level language.
a. Machine languages are primitive commands assembled where binary codes are
essential components in writing the program in order for the computer to understand
it. Programs written in machine language are complex to modify, thus programmers
without extensive exposure and training in the language might find machine
languages difficult to recognize, identify, and understand.
4
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
c. High-level languages are programming languages that are close to the English
language. This means that programs written using high-level languages uses “English-
like” words to represent executable commands converted into binary codes which the
computer can understand through a compiler. High-level programming languages are
simple, straightforward, and uncomplicated to write. Today, many high-level
programming languages are available to provide programmers with a wide variety of
options to choose from to efficiently and effective write powerful, sophisticated and
relevant programs.
For example, you might want to write an instruction in high-level language that tells a
program to compute the Area of a Circle with a Radius of 3.
Area = 3 * 3 * 3.1415;
ACTIVITY
1. Look for five definitions of a “Program” on the internet. Based on the five definitions that
you will find, come-up with your own definition of what a program is based on your
understanding. Include the sources of your definitions using the APA referencing format.
2. Search the internet and fill-up the matrix/table below.
2. FORTRAN
3. BASIC
5
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
4. Pascal
5. Ada
6. C
7. Visual Basic
8. Delphi
9. C++
10. Java
6
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Why Java?
Today, many applications and programs are written in Java. It is a popular programming
language used to write different kinds of applications. As a result, the demand for Java developers
continue to increase in today’s digital era. Since Java becomes a universal if not, common
programming language, it is straightforward, uncomplicated to understand, and analyze, allowing
more and more opportunities come to in for those who engage and devote time and effort in
learning the language. Java enables user to build up and install applications on the internet for
computer servers, desktop computers, and smart phones. The advent of internet-of-things allows
more and more Java applications to be developed and utilized.
Characteristics of Java
1. Java is Simple
One of the characteristics of Java is Simplicity. It is partially based on the C++
programming language but more simplified and improved. One of the wrong notions about
Java is that it is the same with C++ but by understanding the language, one would identify
that Java has more functionality and fewer negative aspects. Since Java is a high-level
programming language, unlike machine and assembly language, Java allows programmers
to write and execute programs in a simpler and easier way.
7
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
2. Java is Object-oriented
Programming languages can be procedural, object-oriented, or event-driven
language. The programming language is an object-oriented employing the concepts of
encapsulation, inheritance, and polymorphism to achieve the purpose of a flexible, clear,
modularize, and reusable programs. One of the common problems and challenges in
software application development relates on how to reuse code, thus Java provides an
easier means to achieve it by being an object-oriented driven language.
3. Java is distributed
Java programming language can be used to write programs to be deployed and
utilized using a network. This language conforms to the requirements needed for distributed
computing where a number of computers are connected and working together via a
network. Since Java was designed to comply with the requirements needed for distributed
computing, being capable to be distributed is one of the considered characteristics of the
language.
4. Java is Interpreted
When writing a Java program, an interpreter is essential to compile a source code. A
Java interpreter is a vital element of JVM. When programs are compiled in the JVM, a code
is produced called byte code. These byte codes are machine-independent and can only run
on machines that have JVM installed in it.
5. Java is Robust
Robustness is one of the characteristics of Java. Robustness refers to the capacity
of the language to withstand difficult conditions. This means that through its compilers,
Java has the ability to easily detect problems and errors that could possibly show up before
and during the execution time. The runtime exception handling feature of the langue is one
of the evident features of the language that deals with robustness.
6. Java is Secure
The Java programming language provides and implements security measures and
ways to protect the system against harm caused by stray programs. This means that the
programs can utilize the available security features of the language to ensure it is free from
harmful programs which might affect the over-all performance of the program.
7. Java is Portable
The ability of the Java program to be executed in different platforms provided there
is an installed JVM makes it architecture neutral. By being architecture neutral, Java
programs become portable. Portability is the characteristic that pertains to the capability of
a program to be run in any platform, and in any device.
8
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
8. Java’s Performance
Since Java is secured, portable, robust, and easy to use, the quality of the output
produced using the programming language is better, thus the performance is greatly
affected.
9. Java is Multithreaded
Multithreading in Java is not specific to the Operating System (OS) unlike other
programming languages that depend on the type of OS to enable multithreading. Since
multithreading is integrated in Java, calling procedures and implementing them is easier
and more accessible.
9
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Figure 1-1. Representations on how to create, compile, and run a Java program
a. Comments
Comments are use in a Java program to indicate programmer-defined instructions
and remarks. These are useful to allow other programmers reading the program to fully
understand how a specific block of code works. Comments follows two slashes ( // ) in a
line or enclosed between /* and */ to indicate multiple line of comments
b. Reserved Words
In writing Java programs, programmers must be mindful of the fact that the language
has reserved words or keywords. These keywords contain built-in specific functions and
capabilities in which programmers must not incorporate when not necessary. Oftentimes,
for beginners, keywords are usually added in a program without knowing how it is use;
10
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
thus, it is important for new java programmer to be familiar with all the Java reserved
keywords and their specific functions.
c. Modifiers
Modifiers in java are certain keywords that specify the property of the data, the
methods, the classes, and how they can be used in the java program. Examples of
modifiers include public and static.
d. Statements
To execute sequence of action/s, a statement is important. The statement
System.out.println (“Welcome to Java!”) is used to display the greetings “Welcome to
Java!”. When writing a java program, you need to remember that statements must end with
a semicolon.
e. Blocks
Curly braces { } are used to form a block in order to group line of code in a program.
Example:
f. Classes
One of the essential Java constructs is the class. In order to successfully run a Java
program, you must be able to properly understand the use of classes and how to write and
use them properly. When you write a program, you can opt to write one or more classes.
g. Method
A method is a collection of different statements or lines that specifically invoke to
perform a series of operations in order to be able to display a message or an output on the
console. Methods are typically used to invoke statements with string arguments. For
example, System.out.println (“Welcome to Java”) has arguments “Welcome to Java!”.
11
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Documentation
In every computer program, it is essential to write a well-written documentation. This
documentation contains all the relevant information about the program, including the purpose, who
wrote it, when was it written, and how to use it. Also, documentation may contain a brief or
detailed explanation of the specific sections of the program code which might help a programmer
understand the program months or years later when it requires modification. A program without a
well-written documentation may result in difficulties and challenges in the future when the time
comes that some modification is needed on it.
ACTIVITY
1. Write a java program to solve the machine problem.
Machine Problem
You are an owner of a meat shop selling beef, pork, and chicken. Each type of meat
has a corresponding price per kilo and percentage value discount. Write a program that
would ask the user for the
1. Price per kilo of Beef;
2. Percentage value for Beef
3. Price per kilo of Pork
4. Percentage value for Pork
5. Price per kilo of Chicken
6. Percentage value for Chicken
The program must be able to calculate and produce the result for each kilo of
meat against their corresponding percentage value as shown in the sample output:
Sample Output:
Beef: 250
Percentage value: 10
Pork: 220
Percentage value: 15
Chicken: 140
Percentage value: 5
12
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
2. Based on your java program answering the machine problem for question 1, take a screen
shot of the source code and categorize which part adheres/complies to the basic anatomy of a
java program. Note: You can put an arrow to easily label the following:
a. Comments
b. Reserved Words
c. Modifiers
d. Statements
e. Blocks
f. Classes
g. Method
h. The main Method
Pseudocode
A pseudocode which literally means a false code, is a text that closely similar to the syntax
of a programming language. However, a pseudocode will not compile because it does not conform
to a well-defined programming syntax. However, if you are planning to write a program, it will be
beneficial for you to start writing a pseudocode to understand the entirety of the program without
writing the actual syntax. Also, by writing pseudocode, you can easily construct the necessary
algorithm needed to successfully write the program.
Example:
Start
Declare A, B, and C as integers
Get the value of A
Get the value of B
Let C = A + B
Print A, B, and C
Stop
If you are planning to write your program in Java, you might decide to write the pseudocode
in a more Java-like type
Example:
class AddNumbers
main method
integers a, b, c
read a
read b
c=a+b
print c
13
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
end main
end class
The form of pseudocode you use depends on your personal preference or the guidelines of
a particular group you work on.
Flowcharts
Aside from writing pseudocode, developing a flowchart is an effective way to plan a
program. Flowchart is a pictorial means to describe the basic structure of a program. Each symbol
in a flowchart represents a specific purpose in the program. It is advisable that after writing your
pseudocode, constructing the flowchart based on the pseudocode would help in visualizing how
the actual program would work.
Example:
Start
Preparatio
n
Input
Processin
g
Outpu
t
Stop
Figure 1-2. Sample Flowchart
QUIZ IS IT!
Instruction: Choose and identify the best answer from the choices given below.
1. Which among the following is NOT an element of a Java program?
a. Literals c. Reserved Words
b. Comments d. Blocks
2. This/These java element/s is/are used to provide programmer-defined instructions and
remarks and is/are useful for other programmers so that the program can be easily
understood.
14
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
a. Blocks c. Comments
b. Modifiers d. Method
3. Programs can be classified into procedural, ________________, and event-driven.
a. Object-Orienting c. Oriented-Object
b. Object-Oriented d. Object Type
4. Which among the following are used in creating blocks in java?
a. [ ] c. / /
b. { } d. ( )
5. Which part of the java program is invoked first when the program executes?
a. Private Method c. Public Method
b. Main Method d. Import Java
6. Which among the following is NOT a characteristic of Java?
a. Java is Difficult c. Java is Simple
b. Java is Robust d. Java is Distributed
7. Which among the following is NOT a high-level programming language?
a. Foxtrot c. C++
b. Java d. Fortran
8. Programs are set of instructions. Programs are not essential to a computer to run.
a. Both Statement is True
b. Both Statement is False
c. First Statement is True, Second Statement is False
d. First Statement is False, Second Statement is True
9. In the choices below, which is not a symbol in a flowchart?
a. Square c. Parallelogram
b. Diamond d. Heart
10. Pseudocode means ____________?
a. False Hope c. False Code
b. True Hope d. True Code
Short Essay
1. Draw an insight on the use of flowchart when writing a program. Explain its perceived
importance to when writing your Java program.
15
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
LESSON 2
DATA IN JAVA PROGRAM
LET’S START! LEARNING OBJECTIVES
Literals
A literal is a number, single character, or string (a list of several characters) that is coded
directly into a program.
Example: In a Java Program, a numeric literal may appear as 7 or 3.1415, and character
literals are written in single quotes, such as ‘a’ or ‘$’. String literals are any character or string of
characters in between the double quotation mark like “Hello World”
There will be no problem in assigning an integer literal into a variable as long as the size of
the literal does not exceed to the capacity of the variable type hence it will show an error during
program compilation.
Example: An error will be show in the statement byte = 1000 because the value 1000 is too
large for a byte type.
A literal could be a number, text, or other value that directly appears in the program.
Example: 48, 10000 and 3.5 are literal values in the following statements:
int i = 48;
long x = 10000;
double d = 3.5;
Variables
A variable is a specific location or address in computer memory where they program can
store data. The contents of a variable can change during program execution, hence the term
variable. When you create or declare a variable in a program, you assign the memory address a
name and specify the type of data the variable can hold. Two general data types in Java are
numeric (for numbers) and string (for text).
16
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Example:
int x; // x is declared as integer
double radius; // radius is declared as double
char a; // a is declared as a character
Identifiers
In Java, an identifier can be a name given to variables, classes, methods that consist
mostly of letters, numbers, dollar signs ($) and underscores (_).
The correct way of naming an identifier is by starting it with either a letter (a-z), a dollar sign
(4), or a underscore (_) It is invalid, however, to use the following as the start of an identifier:
a. A digit.
b. A reserved word.
c. Values of true, false, or null.
An identifier can be of any length
Data Types
Type Size
Boolean 1 bit
Char 16 bits or 2 bytes
Byte 8 bits or 1 byte
Short 16 bits or 2 bytes
Int 32 bits or 4 bytes
Long 64 bits or 8 bytes
Float 32 bits or 4 bytes
Double 64 bits or 8 bytes
Assigning Statements
Literals can be assigned as value of a variable. A variable can also be assigned to another
variable. In Java, equal sign ( = ) is the assignment operator, a statement of action, not an
algebraic statement of equality.
Example:
x = 1; // Assign 1 to the variable x;
radius = 1.0; // Assign 1.0 to radius;
a = ‘A’ ; // Assign ‘A’ to the variable a;
Type Casting
Sometimes, you have a variable of one data type but you need to explicitly convert it to a
different data type. To do this, Java requires a process called explicit type casting, which means
casting or assigning a data type to a value.
17
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Example:
double aDouble = 7.9;
int anInteger;
anInteger = (int) aDouble; //returns 7
If you do not use type cast operator, int, Java will produce a “possible loss of precision”
error because you are trying to store more precise data type as a less precise data type. The
operator (int) tells Java to truncate (cut off the decimal part of) the value in aDouble, assigning the
result integer 7 to anInteger.
Named Constant
Named constant is a type of an identifier whose value is permanent. To create a named
constant in Java, use constants “final” and “static final”. The final constant is for single instance
while the static final is for all class instance.
Example:
final double TAX_RATE = .10;
final double PI_VAL = 3.14159;
final int SIZE_VAL = 3;
Java convention program for coding named constant is to use uppercase characters to
underscore for separating individual words. This convention helps programmers remember which
variables in a program are constants.
Arithmetic Operators
Arithmetic Operators in Java such as +, -, or / perform mathematical operation on one or
two operands (numeric values). An operator that acts on a single operand, as in the case of -5 is
called unary operator. The two unary operators in Java are plus (+) and minus (-), which simply
assign a positive and negative sign (implying directions) to a number. An operator that acts on two
operands such as with 1 + 2 is called a binary operator. The binary operators in Java are +, -, *, /
and %.
Arithmetic Expressions
Arithmetic Expressions is a group of numeric literals (such as 7 or 2.75) and/or numeric
variables (such as totalCost or temperature) combined with arithmetic operators and possible,
parenthesis.
If all operands in an expression are integers, the expression is called integral expressions
and produces an integer result.
18
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
If all the operands are floating-points, the expression is called floating-point expression and
produces a floating-point result.
If an expression contains both integers and floating-points, it is called a mixed-expression
(such as 5 + 2.5) and will result in a floating-point. In mixed expression, Java performs what is
called implicit type casting - automatically converting the result of the expression to the most
precise data type.
Unary Negation
The unary negation operator or minus ( - ) transforms the literal or variable that follows to
its opposite sign, reversing the direction of the number
Example: oppositeValue = -value;
If the variable value holds the number 3, then the oppositeValue is assigned -3. If value
holds the number -7, then opposieValue is assigned 7.
Modulus Operator
The modulus operator (% ) also called the remainder operator, only applies to integers. It
returns the remainder in a division operation.
Example:
int numberOfCupCakes = 31, numberOfStudents = 10, cupcakesPerStudent;
cupcakesPerStudent = numberOfCupCakes / numberOfStudents; //returns 3
int cupcakesLeftOver = numberOfCupCakes % numberOfStudents; //returns 1
Operator Precedence
The precedence that Java gives arithmetic operators is the same that you would apply
when evaluating algebraic expressions. Unary plus (+) and minus (-) have the highest
19
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
precedence, then the *, / and percent sign (%) are the next lower point, and followed by the + and
– binary operators.
Conversion Rules
Java uses the following conversion rules in performing binary operation between two
operands:
a. If the type of one operand is double, the other will be changed into double type.
b. Then, if the type of one operand is float, the other operand will be converted into float.
c. Then, if the one of one operand is long, the other operand will be converted into long.
d. Then, both of the operands will be converted into an int type.
Character Escaping
To escape characters in Java, use a special symbol called backslash (\). Backslash
together with the character that needs to be “escaped” is referred to as control sequence.
Examples are \t for tab, \n for linefeed, \\ for backslash, \’ for single quote and \” double quote.
20
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
String Concatenation
Concatenation is used to “connect” strings using “+” operator
Example:
String message = “Welcome” + “to” + “Java”; //three strings are put together
String s = “Fundamental” + 1; //s becomes Fundamental1
String s1 = “Vitamin” + ‘B’; //s1 becomes VitaminB
Programming Errors
1. Syntax Errors – An error detected by the compiler usually wrong use of syntax.
2. Runtime Errors – A type of error that causes the program to abort.
3. Logic Errors – produces different result from an intended output.
Debugging
LABORATORY EXERCISE
1. Plan the Java Program by illustrating its flowchart. Write the Java Program based on the
flowchart that will solve the problem below.
Weight Problem
Introduction:
One of the many activities of the World Health Organization is to report on the “healthiness” of the
world. This is done by conducting random sampling of the population and categorizing the people
21
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
according to their Body Mass Index (BMI). A person’s BMI is obtained using the height in meters
and weight in kilograms using the formula
weight
BM I
height 2
This is then categorized according to the following table:
BMI Category
below 16.5 Severely Underweight
16.5 to below 18.5 Underweight
18.5 to below 25 Normal
25 to below 30 Overweight
30 to below 35 Obese Class I
35 to below 40 Obese Class II
40 and above Obese Class III
Of course, this is by no means a perfect measure since this does not take into consideration other
factors like body type and race.
Problem:
Write a program that will determine an individual’s “healthiness” category.
Input:
Input shall be sets of data containing the height in meters and weight in kilograms.
Program shall terminate when a height of 0 is received.
Output:
For each input set, the program shall output the computed BMI and it’s corresponding category.
Input Validation:
No input validation is necessary.
Sample Run:
1.67 90
BMI = 32.27 (obese class I)
1.67 80
BMI = 28.69 (overweight)
2.0 80
BMI = 20.00 (normal)
1.5 40
BMI = 17.78 (underweight)
1.7 40
BMI = 13.84 (severely underweight)
22
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
1.5 90
BMI = 40.00 (obese class III)
1.6 90
BMI = 35.16 (obese class II)
0
2. Please take note of the following terminology and identify it based in the written Java
program (Screen shot the source code and put an arrow the terminology is located).
a. Literals
b. variables,
c. identifiers,
d. data types,
e. assignment operator,
f. type casting, and
g. constants
h. arithmetic operators
i. arithmetic expressions
j. String and its properties and features
23
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
LESSON 3
FILE INPUT AND OUTPUT
LET’S START! LEARNING OBJECTIVES
In Java, we can read file data, and write data in files as well. The java.io package holds
almost every class that need to do input and output (l/O) in Java. All of these streams represent
source for input and a destination for output. The java.io stream package supports a lot of data
like primitives, localized characters, object, etc.
Stream
Java l/O stream is the flow of data from which you can either read, or write to. It is used to
perform read and write file operations. In such tasks Java uses streams. Java l/O stream is also
called FiIe HandIing, or I/O File. It can be found in java.io package.
24
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Byte Streams
The Output Stream is an abstract class, and a superclass for all the byte output streams.
Used to write data from bytes to different output devices.
25
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Example. FileCopy.Java
Next step, compiIe and execute the above example “FileCopy.Java”, resulting in the
construction of output.txt fiIe with the similar content as the one we have in input.txt. So let us put
the code above into the “FileCopy.java” file and do the following:
$javac FiIeCopy.java
$java FiIeCopy
Character Streams
26
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
• Reader is an abstract cIass, and a super cIass for all input streams of character.
FiIeReader and FiIeWriter are the most usually used classes. Because FiIeReader uses
FilelnputStream internally, and FiIeWriter uses FiIeOutputStream, the key difference here is that
FiIeReader reads two (2) bytes and FiIeWriter writes two (2) bytes at a time.
The above example can be written in two classes, which allows to copy a file input file into
a file output.
27
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Example. FileCopy.java
The next step, “FileCopy.java” program will be compiled and executed, which will result in
making “output.txt” file with the similar information/data as we have in “input.txt”. So let us put the
following code into FiIeCopy.java" file and do the following:
$javac FiIeCopy.java
$java FiIeCopy
Standard Streams
The idea of standard I/O streams is a C library model that has been integrates into the
environment of Java. There are three (3) standard streams namely STDOUT, STDIN, and
STDERR tools. All of these are managed by the java.lang.System class.
28
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
The Standard Input (for STDIN). It can be represented by System.in that used for program
input, normally reads input entered by the user.
The Standard Output (for STDOUT). It is the PrintStream class that used for program output,
typically output/displays information to the user.
The Standard Error (for STDERR). It is a PrintStream just like System.out that used to
output/display error messages to the user.
A simple program follows that creates lnputStreamReader to read the regular input stream before
the user types a "q":
Example. ConsoleRead.java
The above program “ConsoleRead.java” file, compile and execute it as displayed in the
program. The program keeps reading and displaying the equal character until you press the letter
'q' :
$javac ConsoIeRead.java
$java ConsoIeRead
Input characters 'q' – to quit
1
1
q
q
29
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
QUIZ IS IT!
30
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
LESSON 4
READING AND WRITING FILES
LET’S START! LEARNING OBJECTIVES
ACTIVITY
As per discussed earlier about Input and Output Stream, complete the corresponding
hierarchy of classes. You may research the internet to find the different classes for Input and
Output Streams.
1.
2. 7.
InputStream
FileInputStream
8.
3.
Object
4.
5. 9.
OutputStream FileOutputStream
6.
10.
31
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
FileInputStream
This type of stream is meant to read contents of a file in a stream of bytes. To create an
instance of an FileInputStream, there are many possible constructors that can be. One way is by
having a String as parameter. This String contains the path where the file is located. The below
code is an example:
Another way is to take a File object as parameter. The File object should point to the file
to read. An example code is:
Reading data from a stream is possible using some of the following methods:
FileOutputStream
Creating and writing data into a file is possible in Java using FileOutputStream. Possible
constructors associated with FileOutputStream that can be used is, one, take a String containing
the path of a file to write to. The following code is an example:
Another is by taking a Java File object that points to a file. The following code is an
example:
32
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
protected void finalize(). This will ensure that connection is closed with no
reference is active within the stream.
void write(int x). A specified byte will be written into the stream.
void write(byte[] x). A length of byte (x) will be written in a mentioned byte array.
Example. fileStreamTest.java
Code example of using InputStream and OutputStream:
33
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
File Class
In Java, a representation of the files and the directory pathnames is called a File Class.
Some uses of this class is for file and directory formation, file search, deletion of file, and so on.
Below is a list of constructors in creating a File Object.
File(File parent, String child). From the specified parent abstract pathname and
child string, a new instance will be created.
File(String pathname). From the conversion of string (pathname) into an abstract
pathname, a new instance of a file will be created.
File(String parent, String child). From the pathname string of both parent and
child, a new instance will be created.
File(URI uri). A new instance of a file from conversion of URI to abstract pathname.
FileReader Class
FileReader is used to print character streams. There are several constructors in this class
to create the required objects. The following list are constructors provided by the class
FileReader:
FileReader(File file). From the given File, this will create a new FileReader.
FileReader(FileDescriptor fd). From the given FileDescriptor, this constructor will
create a new FileReader.
FileReader(String fileName). From the given name of the File, this constructor will
create a new FileReader.
The following are FileReader object methods that can be utilized to manipulate files:
public int read(). Will return an int (represent the read character) from reading
single character.
public int read(char [] c, int offset, int len). Will return the number of character
based on the read character array.
34
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Example. FileRead.java
FileWriter Class
35
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Inherited from OutputStreamWriter, this class is used for writing character streams. List of
constructors are as follows:
FileWriter(File file). From the given File object, this will create a FileWriter object.
FileWriter(File file, boolean append). From the given File object and boolean
value (to append or not), this will create a FileWriter object.
FileWriter(FileDescriptor fd). From the given file descriptor, this will create a
FileWriter object.
FileWriter(String fileName). From the given file name, this constructor will create a
FileWriter object.
FileWriter(String fileName, boolean append). From the given file name and
Boolean value (to append or not), this will create a FileWriter object.
36
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Example. FileRead.java
37
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Creating Directories
The following are useful methods to create a directory:
The mkdir( ) will create a directory provided by a path. Please note that directory can be
created only if the parent directory is present.
The mkdirs() will create a directory including the parent directory if it does not exists.
Example. CreateDir.java
Note – On UNIX and Windows, Java automatically handles path separators based on
conventions. If using a forward slash symbol (/) on a Java version on Windows, it will be
corrected by the route.
Listing Directories
From File object, the list() method will list down all directories and files that are present in a
directory, the following is an example:
38
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Example. ReadDir.java
The above code will result in in the following based on the available files in the directory
/tmp:
39
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
LESSON 5
GRAPHICAL USER INTERFACE IN JAVA: ABSTRACT WINDOW
TOOLKIT
LET’S START! LEARNING OBJECTIVES
INTRODUCTION TO AWT
Developed by Sun Microsystems for its Java Foundation Classes (JFC); Abstract Window
Toolkit (AWT) is a Java class toolkit that helps programmers build GUI components and graphics.
It was developed to include a collection of standard tools for the design of cross-platform
GUIs. One of AWT's essential features is that it is platform dependent. A significant downside to
this approach; when applied on different platforms due to platform dependence, it will look
completely different on an individual platform, which hampers the application's functionality and
aesthetics. AWT includes 12 packages with 370 classes; the packages widely used are java.awt
and java.awt.event.
40
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
1. Component: Components are simple GUI entities; examples are TextArea, Label, and
Checkbox.
2. Container: Containers are used to keep components in a particular layout and hold sub-
containers; examples are Frame and Panel.
41
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
The above figure shows three containers; a single frame and a couple of panels. In an AWT
program, Frame is considered as a top-level container. A title bar, an optional menu bar, and a
content display area can be found within a Frame. A Panel is an area that is used for grouping
related GUI components in a layout. The figure shows five components: a Label, a TextField, and
three buttons.
This example consists of a standard java.awt. Frame with four components: an "Enter an
Integer" label, a TextField to accept user input, another "The Accumulated Sum is" label, and
another TextField that is not editable to display the sum. The components re in a FlowLayout.
42
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
43
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
44
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
AWT EVENT-HANDLING
Java uses an event-handling programming paradigm called "Event-Driven," like other visual
programming languages. In an event-driven program, an event triggers a response from a specific
user input, which then executes a piece of event handling code.
Figure 5-4. Sequence of Steps for Source, Events, and Listener Objects
45
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
1. FlowLayout,
2. GridLayout,
3. BorderLayout,
4. GridBagLayout,
5. BoxLayout,
6. CardLayout, and others.
FlowLayout
Considered as the default layout of the panel; the FlowLayout positions its components in a
line. The following are fields of the FlowLayout class:
1. FlowLayout()
2. FlowLayout(int align)
3. FlowLayout(int align, int hgap, int ygap)
4. f.setLayout(new FlowLayout(FlowLayout.RIGHT))
46
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
GridLayout
The GridLayout presents the components in a grid-like rectangular form. Each rectangle
displays one component. The following are GridLayout constructors:
1.GridLayout()
2.GridLayout(int rows, int columns)
3.JGridLayout(int rows, int columns, int hgap, int vgap)
BorderLayout
The BorderLayout is the considered default layout for the frame and organizes its
components in a specific area. Each area may contain only one component. Each of the regions
has different constants:
BorderLayout constructors:
1. BorderLayout()
2. JborderLayout(int hgap, int vgap)
47
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Box Layout
The BoxLayout is used for the vertical or horizontal arrangement of the components. The
following are constants for using the BoxLayout:
BoxLayout Fields:
BoxLayout Constructors:
48
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Card Layout
The CardLayout class can only access one component at a time as it views each
component as a card.
CardLayout constructors:
1. CardLayout()
2. CardLayout(int hgap, int vgap)
49
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
QUIZ IS IT!
Instruction: Select the best answer from the choices given below.
1. GUI stands for ____________________________
a) Graphic User Interface
b) Graphical User Interaction
c) Graphical User Interfacing
d) Graphical User Interface
2. GUI does not allow users to interact and manipulate the screen, rather, GUI is used to
develop the database
a) First statement is true, second statement is false
b) First statement is false, second statement is true
c) Both statements are true
d) Both statements are false
50
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
11. What component can the user use for keeping other components as a container?
a) Tupperware
b) Choice
c) JPanel
d) None of the Above
13. What method determines how the components are organized in a container?
a) setLayout ( )
b) setVisible ( )
c) setLayoutManager ( )
d) None of the Above
14. What container is often used for dividing an interface into different layout managers?
a) JWindow
b) Container
c) JPanel
d) None of the Above
51
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
16. Where does the BorderLayout class derive its name from?
a) The components border
b) The way components are organized at a container 's borders
c) The borders of Java Developers
d) None of the Above
2. Why do GUI classes, have the letter J at the start of their names? (e.g., JButton, JLabel,
and JTextField)
52
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Laboratory Exercise
Write a java program that would implement one among the different types of layout
managers and panel. The program should ask for your Student Number, Last Name, First Name,
and Course. (Note: You can include additional GUI components to enhance your output)
53
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
LESSON 6
GRAPHICAL USER INTERFACE IN JAVA: SWING AND JAVAFX
LET’S START! LEARNING OBJECTIVES
INTRODUCTION TO SWING
Swing was launched in 1997 as part of JFC (Java Foundation Classes) after JDK 1.1 was
release. Subsequently, JFC has been an integral part of JDK starting from JDK 1.2. JFC consists
of the following:
The aim of Java GUI is to help developers build a user interface that looks good on any
platforms. JDK 1.0's AWT was cumbersome and non-object-oriented (using a lot of
event.getSource()). JDK 1.1's AWT presented a much simpler and object-oriented event-
delegation (event-driven) model. Furthermore, the introduction of JavaBeans and inner classes
enables the Java programmers to have a visual programming environment similar to VB (Visual
Basic).
SWING'S FEATURES
Swing is large it was made up of 737 classes unevenly distributed inside 18 packages.
Compared to AWT, Swing offers a broad and comprehensive set of reusable Interface
components, as shown in the figure below.
54
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
55
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
56
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
SWING'S COMPONENTS
Similar to AWT’s component classes, Swing components also have components such as
Button, TextField, Label, Panel, Frame, and Applet you just need to prefix it with letter “J” e.g.
JButton, JTextField and so on and so forth.
The figure below shows the hierarchy of the GUI swing classes. Same as AWT, it has two
class groups: containers and components. The container shall be used to house the components.
A container can also hold another container because it extends the Component class. As a rule of
thumb, do not use AWT components with Swing components as heavy-weight components (AWT
components) masks lightweight components (Swing components) when rendered.
57
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Just like the AWT application, the Swing application requires a top-level container, and
Swing has three:
1. JFrame - for creating the main window. It has an icon, title, content pane and an optional
menu bar. It also has the maximize, minimize, restore and close button at the top-right
position on Windows and at the top-left position on Mac and Linux.
2. JDialog - for creating the pop-up window. It has an icon, title, content pane and a close
button.
3. JApplet - for rendering applets within the browser window.
And just like AWT, Swing has a similar Panel class called JPanel for grouping
components.
EVENT-HANDLING IN SWING
To handle events Swing uses the classes from java.awt.event and javax.swing.event
packages, however the former is often used than the latter.
58
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Example: SwingAccumulator.java
59
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Activity:
1. Review your AWTAccumulator program and compare it to the SwingAccumulator source
file. Draw insights about the differences between the output of the two source file. How do
they differ? And what do you think are the reasons why the two source files have
differences in their outputs?
60
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
INTRODUCTION TO JavaFX
Same as AWT and Swing, JavaFX was developed to build GUI for Java applications.
Having a rich collection of graphic libraries it was initially designed for Rich Interface
Applications(RIA) and the like such as rendering GUI for web apps with the use of a browser
plugin and was just later become a part of JDK library starting from JDK 8.
JavaFX PACKAGES
JavaFX has 36 packages. The following are the commonly used ones:
javafx.application: JavaFX application
javafx.stage: Top-level containers
javafx.scene: Scenes and Scene Graphs.
javafx.scene.*: Controls, Layouts, and Shapes, etc.
javafx.event: Event Handling
javafx.animation: Animation
61
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Example: JavaFXHello.java
62
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
How It Works
1. A JavaFX program extends javafx.application.Application (same as Swing who extends
javax.swing.JFrame).
2. Just like AWT JavaFX has a variety of components such as Label, Button, TextField, etc.
3. In JavaFX you can add an event handler to a component using the setOnAction() method
which accepts a parameter with a type EventHandler<ActionEvent>. Just like the code below:
The handle() method can be triggered programmatically using fire() method or by a click,
touch or keypress event.
63
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
can be displayed on the stage at any given time. The contents of the scene are reflected in
the node(javafx.scene.Node) graph of the hierarchical scene.
In the code example, the root node is the container(in this case the
javafx.scene.layout.StackPane) that layouts the child nodes. It has a child node the Button which
is added to the layout using the code below:
64
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Laboratory Exercise
1. Recall your Java Exercise on Lesson 2 (BMI). Modify the java program and implement a
Graphical User Interface in it. You can choose between SWING, AWT and JavaFX to modify
and construct the GUI of the program.
65
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
LESSON 7
OBJECT-ORIENTED APPLICATION DEVELOPMENT PART 1
LET’S START! LEARNING OBJECTIVES
You can divide the real-world things such as students, teachers and courses into groups or
categories, called classes. If you are reading and studying this chapter you might and probably
belong to the student group or class. Your professor/instructor belongs to teacher class and this
IPT01 belongs to a course class. If you use the term object instead of thing, then you could say
that a real-world object (a thing in the real world object that has attributes and behaviors) can
belong to a particular real-world class (a category to which real-world object belongs). Figure 4.1
shows examples of specific objects that belong to particular, tree, car and people classes. The
representation of the real world object which belongs to a real-life class in necessary as with use
of software object (depiction of a real-world object in computer memory) that goes to a software
class (program code that depicts a real-world class) that you write using a programming language
such as Java.
66
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
What exactly is an object? It is simply an entity with two primary features. First a real-world
object has attributes. Object attributes are the characteristics or features that define the object.
For example a real-world student objects in a university information system have many attributes,
including the name, address, favorite color, and favorite food. Though, if your task is to develop a
UIS(University Information System), the attributes you must consider are the name and address,
and not the favorite color and favorite food. A student object in a UIS could have other attributes
which includes student ID number, a gender, contact number, address and birthdate.
A real-world student object would have another important attribute such as a class
schedule, which by itself can also be considered as an object. A schedule object has attributes,
such as semesters and courses. The course can also be assumed as an object in this example. A
course has attributes such as course number, course title, and section. A course section is an
object that has attributes such as number, meeting time, room number, and instructor. An
instructor is an object that has attributes such as a faculty ID number, name, gender and birthdate.
You can see that analyzing and designing an information system using all these objects
can get very involved. The fact that all these objects (student, schedule, course, section, and
instructor) contains attributes/feature/characteristics and can be related to each other. Modelling
this complex real-world system (UIS) involves real-world objects like students, course and
instructors can be done using an OOP language such as Java.
The second major feature of a real-world objects is object behavior. The object’s behavior
are methods, actions, operations or processes that describe what the object can do. As with
attributes, there are some action/methods relevant to a particular information system. The action
like eating, sleeping and studying can be an example of an object’s behavior, but those are not
applicable to a university information system. The behaviors that are relevant in the university
information system can include student behavior of registering for a particular course, paying
tuition fee, taking exam, attending class, submitting requirements and checking grades. You are
undoubtedly aware that a complex university system needs an information system to keep track of
all students, course and instructors, including their relevant attributes and behavior.
67
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
As you know, information systems are needed and manage real-world systems such as a
university or a business enterprise. An information system is often composed of many interacting
applications, such as a student-scheduling application, a grade-assignment application, and
learning management system. Applications can be developed in essentially one of two ways,
either using structured application development or object-oriented application development.
These two approaches have much in common- regardless of the approach, the developer must
perform these steps:
The difference is how these steps are performed. The structured application
development is a method for developing and creating an application that emphasize on the data
flow of the application from one system component to another, and in a way the system
components are related by system events. The applications created using this methodology often
lean towards procedural approach. For example: retrieve the data for the student, retrieve the data
for course, and assign the student to the course, and the output the data for schedule. The
procedural applications are typically made for a procedural programming language like C.
The objects and classes are the most important element or concept in an object oriented
application development. The following section will discuss and explain these concepts.
68
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Objects
An object can be recognized by giving reference or name. For example a student object can be
created as shown in the following Java statement:
The reference to the student object is myStudent (you can use any reference you choose, such as
theStudent, aStudent, studentA, or student1 ), which refers to the object in the memory. The
variable myStudent is actually a reference variable that holds a memory address of the object.
The data type for this object is Student. This is an example of an abstract data type, which is an
entire set of instance variable (sid, lastName, firstName, gender) and methods for manipulating
those variables.
The java keyword new is use to create an object. The code Student (sid, lastName, firstName,
gender) is a call to the constructor named Student, a class method that brings out the specifics or
the details in creating a Student object.
Classes
Representing real world objects with software objects is a great idea, but how are the
objects actually implemented? This is accomplished with the aid of a java class. You have already
created a dozen of class using java. The first one is created in the first chapter with the class
name Welcome and prints “Welcome to java!”. However, this class that you have created contains
a main method that contains procedural code designed to accomplish a specific computing
objective. This kind of software class, which is called application class, has nothing to do with
the concept of software objects. Its only purpose, as its name suggests, is to manage specific
computer application, not OO applications. The class can be used and considered as the blue
print or template for creating objects in OO applications. Such class is called an object-defined
class. An object-defining class is said to have members –data members (instance variable or
field) and method members (usually designed to manipulate the member fields). The object-
defining class in an OO application is the specification or blueprint for objects, rigorously defining
the object’s fields and methods. The class diagram is a tool that can be used to create, illustrate or
define object model. Instantiate is the technical term used to signify the method or procedure of
making and creating an object from a specific class.
69
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Variables that have been declared within a method have method scope. This means that a
variable can only be referred or access by their simple names inside that method (the local
scope). In object-defining class, the instance variables is declared within a class, not within a
method, and basically define what object is. Such variables have a characteristic known as
visibility which is similar to scope. The visibility means that the instance variable can also be
referenced or access by its simple name. The access modifier describe and define the visibility of
the instance variable. The access modifiers can be private, public or protected. In the private access
modifier variables has only visibility within its defining class, public access modifier means it has
visibility in any class, protected implies that the instance variable has visibility only in subclasses of
that class, or classes in the same package.
Why visibility is important? It is a matter of security. The instance variable helps define
exactly what an object is. Through visibility, accessing and manipulating other classes without
using carefully planned procedures can be avoided. The best way to access a private instance
variable of an object is to use public method written specifically for that purpose.
The class diagram is component of a Unified Modeling Language (UML) which defines the
static or fixed view of a class or application. Class diagram often use in describing, documenting,
and visualizing diverse components of an application. It defines both the attributes and behaviors
of a specific class. It also captures the constraints and relationship between classes on the
system. The use of class diagram is highly suggested in the modeling of object oriented systems.
Because this is the only UML diagrams that can be mapped directly with object-oriented
languages like java.
There are three sections in a standard class diagram which is shown in figure 4.2:
70
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Upper portion: The class name (Student). This portion contain the name of the class and is
required for reference.
Middle portion: The attributes of the class, (studentId, name, course, yearLevel and their
corresponding data types), is the portion where the attribute/qualities/characteristics of the class is
defined.
Bottom portion: The class operations or methods, is the portion where each operations and
methods are listed. The methods defines the interactions with data in the class.
The bottom portion in this class diagram can contain methods which can be a
mutator method (setter method) and accessor method (getter method). The term mutator
means to change or alter and the accessor means to access or retrieve. These sets of
methods are used to assign and get values from the instance variables.
There are different symbols use to denote the access modifier or visibility of attribute or
method in a class. The access modifiers can use plus sign (+) for public, minus (-) for private,
hashtag (#) for protected, tilde (~) for package, slash (/) for derived, and undeline (_) for static
attributes and methods. In visibility, the public and private are the most commonly used access
modifiers. See figure 4.2.
Application:
71
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
72
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
/*
* File Name : Invoice.java Date Created : 06/22/2020
* Purpose : to define Invoice Objects
*/
import java.util.Date
public class Invoice{
//declare instance variables
private String invoiceNumber;
private Date invoiceDate;
private int invoiceType;
private double invoiceTotal;
private double discountPercent;
//define constructor
public Invoice(String number, double total, int type){
invoiceNumber = number;
invoiceDate = new Date();
invoiceType = type;
setInvoiceTotal(total, type);
}
//mutator method
public void setInvoiceTotal(double invTotal, int invType){
if (invType ==1){
discountPercent= 0.05;
invoiceTotal = invTotal *(1-discountPercent);
}
else{
discountPercent = 0;
invoiceTotal= invTotal;
}
}
//accessor method
public String getInvoiceNumber(){
return invoiceNumber;
}
public Date getInvoiceDate(){
return invoiceDate;
}
public int getInvoiceType(){
return invoiceType;
}
public double getDiscountPercent(){
return discountPercent;
}
public double getInvoiceTotal(){
return invoiceTotal;
}
} // end class
73
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Encapsulation
The encapsulation can be defined as the process of wrapping, bundling or binding the data
and methods that manipulate data together. This OOP concept preserves the implementation
away from its user thus keeping it safe from outside, intrusion, and misuse. This concept headed
towards another important concept of OOP which is the data hiding and data abstraction.
Data abstraction is a process in which only the interface are expose to the users thus
hiding its implementations and details away from the user. Figure 4.5 shows how the attributes
and functions of the Invoice class are bundled into a single class.
Information Hiding
74
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
The succeeding application is an example of a complete OOA which follow the IPO(Input-
Process-Output) pattern. The application allows the users to enter data, generate objects in
computer memory, and provide necessary output or information about those objects.
Application Classes
The class with main method is required in an application class because this method is the
starting point of execution. The object-defining class simply contains attributes and behavior, and
another class is required in order to check whether the object-defining class is working properly.
This class is called an application class or a driver class. The Invoice class is used to define
invoice objects, but a program called InvoiceApp.java that contains the main method is needed to
drive the entire application, making it useful for processing invoices. This application class follows
the input-process-output pattern of most procedural applications. That is because application
class is indeed very procedural.
Object Interface
For example, part of the interface of an Invoice object could be its constructor. The
construct’s signature looks like this:
The Invoice object requires three variables in order to create/instantiate an invoice object:
the invoice number, invoice total, and invoice type). Another method in the Invoice class is
setInvoiceTotal() its signature is:
The method’s signature signify that the method is public, does not have return data, and
requires an invoice total and invoice type to work properly.
75
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Application:
/*
*Figure 7-7
* Filename : InvoiceApp.java
* Date Created : 06/22/2020
* Purpose : Application class for creating Invoice objects
*/
76
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
import javax.swing.JOptionPane;
import java.util. Formatter;
while( !(choice.equalsIgnoreCase("x"))){
//get user input
strNumber = JOptionPane.showInputDialog(null,"Enter
invoice number:");
strTotal = JOptionPane.showInputDialog(null,"Enter
invoice total:");
//convert String to Double
total = Double.parseDouble(strTotal);
strType = JOptionPane.showInputDialog(null,"Enter
invoice type:");
//convert String to Integer
type = Integer.parseInt(strType);
//display output
choice = JOptionPane.showInputDialog(null,
strOutput,"Invoice Application",
JOptionPane.PLAIN_MESSAGE);
}//end while
}//end main
}//end class
77
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
78
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Figure 7-9 Class diagram of InvoiceWithProduct and Products class showing composition
This kind of relationship is also called has-a relationship which implies that one class “has
a/an” object from another class. In figure 4.10 illustrates a composition. Example Person has-a
Leg, Person has-a Hand
79
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
1. Describe/Define in your own word, the meaning of real-world classes, real-world objects,
software classes and objects.
2. Explain the difference between structured and object oriented application development
methodologies.
3. Using UML class diagram, create/draw a diagram for Student/Instructor/Employee
capturing the significant attributes and behaviors.
4. Code/Create an object defining classes for your selected class.
5. Code/Create an applications that make use of your objects defining class following the
input-process-output pattern.
6. Draw a UML class diagram that illustrates the composition relationship between classes.
QUIZ IS IT!
True or False. Write True if the Statement is Correct; otherwise, write False.
1. Objects have two major characteristics: attributes and behaviors.
2. Information hiding refers to the process of concealing information about how an
object is implemented within the class.
3. String is an example of abstract data type.
4. Your class name and its constructor name should be different.
5. An object-defining class usually contains a main method.
6. A good analogy for an application class is a blueprint.
7. A class diagram uses “-” to indicate private and “+” to indicate public access.
8. Mutator methods are also called getter methods.
9. An application class is also called a driver class.
10. An object’s behavior are the characteristics that define an object.
11. An object attributes are the actions or operations that define what an object does.?
12. The structured application development is a methodology for developing application
that focus on how data flow from one application to another and on how the system
entities are related by system events.
13. The object-oriented application development is a methodology for developing
applications that focuses on objects in the system and how they interact.
80
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
16. In UML class diagram, which of the following is contained within the upper
section?
a. Data member / Attributes c. Class name
b. Method member / d. None of the above
Behavior
17. In visibility, which of the following symbol is used for protected?
a. + c. #
b. – d. $
18. On the given choices below, which is an example of abstract data type (ADT)?
a. int c. byte
b. float d. String
19. What keyword is always used with accessor methods?
a. private c. new
b. main d. return
20. On the given choices below, which is not an abstract data type (ADT)?
a. JFrame
b. Date
c. boolean
d. Scanner
81
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
LESSON 8
OBJECT-ORIENTED APPLICATION DEVELOPMENT PART 2
Inheritance
82
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
83
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
To give a working example let us create two object-defining classes. The Person
class as the parent class and Student class as the child class. As shown in figure 8-5
the Person class has 5 attributes (idNo, lastName, middleName,givenName and
address), Student has a single attribute (collegeClass) followed by the constructor,
setter method and the getter methods respectively. The arrow between the classes
indicates that the Student class is inheriting both the attributes and behavior of the
Person class.
84
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
The following figures contain the program code for Person.java (figure 8-6),
Student.java (figure 8-7) and the driver class StudentApp.java (figure 8-8).
/*
* Figure 8-6
* Filename : Person.java
* Date Created : 06/22/2020
* Purpose : to define Person objects
*/
//define constructor
public Person(String no, String lname, String gname,
String mname, String pAddress){
idNo = no;
lastName = lname;
givenName = gname;
middleName =mname;
address = pAddress;
}
85
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
//public methods
public void setAddress(String pAddress){
address = pAddress;
}
}
public String getName(){
String fullName = lastName +", "+givenName+ "
"+middleName;
return fullName;
}
public String getIdNo(){
return idNo;
}
} // end class
//define constructor
public Student(String sId, String sLastName, String
sGivenName, String sMiddleName, String sAddress, int
sCollegeClass){
super(sId,sLastName,sGivenName,sMiddleName,sAddress);
collegeClass = sCollegeClass;
}
//public methods
public void setCollegeClass(int sCollegeClass){
collegeClass = sCollegeClass;
}
public int getCollegeClass(){
return collegeClass;
}
} // end class
86
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
In this figure the keyword super is used. The “super” keyword denotes that it
access the constructor method of its base class (Person Class).
import javax.swing.JOptionPane;
import java.util.Formatter;
student.getIdNo(),student.getName(),student.getAddress(),student.getCollegeClass(
));
JOptionPane.showMessageDialog(null,output,"Application",JOptionPane.PLAIN_M
ESSAGE);
//modifying Student Object (address)
if (JOptionPane.showConfirmDialog(null, "Do you want to edit
address?", "Application",
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
// yes option
newAddress = JOptionPane.showInputDialog("Enter new addess: ");
student.setAddress(newAddress);
output = String.format("Student Id: %s\nName: %s\nAddress:
%s\nClass: %d\n",
student.getIdNo(),student.getName(),student.getAddress(),student.getCollegeClass(
));
JOptionPane.showMessageDialog(null,output,"Application",JOptionPane.PLAIN_M
ESSAGE);
}
else {
// no option
System.exit(0);
}
}//end
Figure 5.8 main
StudentApp.java
} // end class
87
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Application:
Create an application for a bank that offers both checking and savings account to
its customer. The customer can open checking account, savings account, or both.
When customer open a checking account, a monthly service fee is immediately
assessed depending on the amount of the original deposit. When customer open a
savings account, a month’s interest is paid immediately depending on the amount of
original deposit.
In planning this application three tasks are involved. First, identify the object-
defining classes required by the application. Second, draw/sketch/create a class
diagram for these classes. Third, flowchart for the application class.
88
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
the problem statement such as assess fee and pay interest could be used as the
method.
In the above figure, composition and inheritance are used to show relationship
among these classes. To describe the relationship, has-a (composition) and is-a
(inheritance) is used. The Customer has-a CheckingAccount. The Customer
has-a SavingAccount. The CheckingAccount is-a BankAccount. The
SavingAccount is-a BankAccount.
89
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
false
90
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
//Filename : Customer.java
import java.util.Formatter;
//define constructor
public Customer(String no, String cName, String chkAccountNo, double
begChkBal,
String svngAccountNo, double begSvngBal){
cNo = no;
name = cName;
setCheckingAccount(chkAccountNo, begChkBal);
setSavingAccount(svngAccountNo,begSvngBal);
}
//public methods
public void setCheckingAccount(String chkAccountNo, double begChkBal){
if(! chkAccountNo.equals("")){
chkAccount = new CheckingAccount(chkAccountNo,begChkBal);
}
}
public void setSavingAccount(String svngAccountNo, double begSvngBal){
if(! svngAccountNo.equals("")){
svngAccount = new SavingAccount(svngAccountNo,begSvngBal);
}
}
public CheckingAccount getCheckingAccount(){
return chkAccount;
}
public SavingAccount getSavingAccount(){
return svngAccount;
}
public String toString(){
String strFormat, strCustomer;
strFormat = "Customer Number: %s\nName: %s\nAccount Type:
%s\nAccount Type: %s\n";
strCustomer = String.format(strFormat, cNo, name, chkAccount,
svngAccount);
return strCustomer;
}
} // end class
91
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
//Filename : BankAccount.java
import java.util.Formatter;
//define constructor
public BankAccount(String aNum, double bal){
accountNum = aNum;
balance = bal;
}
92
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
//Figure 8-14
//Application of inheritance (CheckingAccount extends Bank
Account)
//Filename : CheckingAccount.java
//define constructor
public CheckingAccount(String aNum, double bal){
super(aNum,bal);
setServiceCharge(bal);
}
//public methods
public void setServiceCharge(double chkBal){
if(chkBal<100)
serviceCharge =10;
else
serviceCharge =0;
}
93
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
//Figure 8-15
//Another application of inheritance (SavingAccount extends
BankAccount)
//define constructor
public SavingAccount(String aNum, double bal){
super(aNum,bal);
setInterestRate(bal);
}
//public methods
public void setInterestRate(double savingBalance){
if(savingBalance>=100)
interestRate =0.05;
else
interestRate =0;
}
if(currentBalance>=100){
newBalance = currentBalance *(1+interestRate);
setBalance(newBalance);
}
}
} // end class
94
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
//Figure 8-16
//This is the driver class which contain the main method.
//Filename : BankApp.java
import javax.swing.JOptionPane;
//input
customerNo = JOptionPane.showInputDialog("Enter Customer Number:");
strName = JOptionPane.showInputDialog("Enter Customer Name:");
strChkAccNum = JOptionPane.showInputDialog("Enter Checking account number or press
Enter for none:");
if(! strChkAccNum.equals("")){
strBegChkBal = JOptionPane.showInputDialog("Enter Beginning Checking account
balance:");
begChkBal = Double.parseDouble(strBegChkBal);
}
strSvngAccNum = JOptionPane.showInputDialog("Enter Saving account number or press
Enter for none:");
if(! strSvngAccNum.equals("")){
strBegSvngBal = JOptionPane.showInputDialog("Enter Beginning Saving account
balance:");
begSvngBal = Double.parseDouble(strBegSvngBal);
}
//processing
aCustomer = new Customer(customerNo, strName, strChkAccNum, begChkBal,
strSvngAccNum,begSvngBal);
if(aCustomer.getCheckingAccount() != null){
aCustomer.getCheckingAccount().assessServiceCharge();
}
if(aCustomer.getSavingAccount() != null){
aCustomer.getSavingAccount().payInterest();
}
//output
JOptionPane.showMessageDialog(null,aCustomer.toString(),"Application",JOptionPane.PLAIN_MES
SAGE);
}//end main
} // end class
95
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
96
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Polymorphism
The term polymorphism comes from Greek word "poly" (means many) and
"morphos" (means form). In an object-oriented context, polymorphism refers to the
ability of a single method name to be used in many different ways with in single class or
within multiple classes. The implementation of polymorphism can be done thru
overriding and overloading of methods. This mechanism includes the early binding
(static) and the late binding (dynamic binding).
We can define the term Polymorphism as the capability of sole object to have
multiple forms or take different actions or forms. In OOP, the polymorphism occurs
when a single method name is use to perform different task. The succeeding topics
show how polymorphism is applied by overloading and overriding the constructors and
methods.
Overloading
97
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Overriding
Figure 8-18 Class diagram for Clock and WristWatch class illustrating Overriding
Early Binding
This binding occurs and done at compile-time where all the final, private and static
methods are linked together. This includes the binding of method calls and method
definitions during compile-time. In this binding the program execution will be faster and
method overloading is a concrete example. Illustration is shown in figure 8-19 the early
binding in java.
98
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
//Figure 8-19
//Polymorphism
//Filename : EarlyBinding.java
}//end class
Output:
print in Superclass.
print in Superclass.
Late Binding
The late binding or dynamic binding occurs and done during run-time where
actual objects are used to bind or link the methods. The appropriate example of
dynamic binding would be the overriding. Once an object is created, methods calls and
method definition can be linked. Figure 8-20 shows schematic of dynamic binding and
figure 8-21 sample code of dynamic binding (overriding).d
objectA
objectB
99
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
//Figure 8-20
//Polymorphism
//Filename : LateBinding.java
}//end class
Output:
print in Superclass.
print in Subclass.
100
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Programming Exercises
1. Write program code for Faculty.java. This class inherits from Person.java (using
figure 8-6) with an instance variable called title that holds values such as
“Professor”, “Associate Professor”, or “Assistant Professor”. Include a constructor,
setter method and getter method for the title. Make sure that both classes are
saved and compiled.
2. Using the program in exercise 1, write a program called FacultyApp.java. This
application asks the users to enter information for a faculty object, instantiate the
Faculty object and display information about the faculty.
3. Create a class called Vehicle in Vehicle.java with instance variables brand (such
as Toyota, Honda, Ford, Isuzu etc), year, horsepower (200, 300 or 400) and
milesPerGallon. Add necessary constructor, set and get methods. Then create
classes Bus and Truck in a program files Bus.java and Truck.java, respectively.
The Bus has numberOfPassengers (1 to 50) and the Truck has towingCapacity
(0.5, 1.0 , 2.0 or 3.0 tons) instance variables. Both class inherit from Vehicle and
contains their respective constructors, setter and getter methods. Both Bus and
Truck have a method called computeMPG(miles per gallon) and toString method
for displaying all attributes including the inherited one. The formula for Bus’
milesPerGallon is 1000/ numberOfPassengers/ horsepower and the formula for
Truck’s milesPerGallon is 1000/ towingCapacity/ horsepower.
4. Create an application called VehicleApp.java. The application ask the user to
enter information about Vehicle, for Bus the user enters brand, year, horsepower,
number of passengers and for Truck the user enters brand, year, horsepower,
number of passengers. By instantiating Bus and Truck objects, the application
computes the miles per gallon and display all the information about the specific
object (Bus and Truck).
101
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
QUIZ IS IT!
True or False. Read the following statements and identify whether the following
statements are correct or wrong. Write True if the statement is correct; otherwise, write
False before each number.
16. Which of the following term implies two methods have same name, same
parameters but exist in different class?
a. Instance c. Override
b. Overload d. clone
17. Which of the following java keyword is used to implement inheritance?
a. inherits c. extends
b. expands d. interface
102
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
18. This is kind of polymorphism that occurs when a single method name is used
more than once with in the same class.
a. Instance c. Overriding
b. Overloading d. Cloning
19. Which java class is at the root of the inheritance hierarchy?
a. String c. Object
b. Class d. Base
20. Which of the following term does NOT relate to inheritance?
a. Superclass c. Composition
b. Is-a d.Subclass
103
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
LESSON 9
UNIFIED MODELLING LANGUAGE
In the late 1970s and 1980s, object-oriented modeling language appeared. The
object concepts were popular until 1995, but they were applied in several ways. Every
developer had its notation and methodology. The industry as a whole was looking for a
modeling language that would act as industry de-facto standard. In 1995, the three
brilliant software engineers Grady Booch, Ivar Jacobson, and James Rumbaugh of
Rational software, created a standard set of diagramming techniques known as the
Unified Modeling Language. UML's goal to deliver standard object-oriented vocabulary
and diagramming techniques sufficiently rich for modeling any system development
project from analysis to implementation. In November 1997, UML was formally accepted
as industry standards for all object developers by Object Management Group (OMG).
Throughout the years, the UML has undergone numerous minor revisions. The most
recent version of UML is 2.5.1, released in December 2017.
104
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
UML Diagram
105
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
1. Class diagrams are used to model a system's static aspects by showing the
classes and relationships. It shows each class's classes, attributes, and
operations in a structure and the relationship between each class.
106
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
3. Package diagrams show the system dependencies between the various
packages.
107
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
6. Profile Diagram is a new type of diagram in UML 2.This is a type of diagram that
is rarely used in any specification.
7. Deployment Diagram represents the hardware topology used, and the runtime
system assigned.
108
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Behavior Diagram suggests the infrastructure that allows you to define behavior.
1. Use Case Diagram defines how users interact with a system through use cases
that yield measurable results. This diagram explains which users are using
certain system functionalities, but does not discuss precise implementation.
109
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
2. State Machine Diagram model the behavior of the system over several
transitions, such that the designer can see at any point the singular ‘state’ of the
system given the external stimuli indicated.
110
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
111
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
6. Interaction overview diagrams are somewhat related to activity diagrams. The
activity diagrams show the process in sequence while Interaction overview
diagrams display a series of interaction diagrams.
112
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
7. Timing diagrams closely mimic sequence diagrams. They represent object
behavior within a given time frame.
1. Actors are the users that interact with a system. An actor may be an individual,
an organization, or an external system that interacts with your application or
system. There are two symbols in UML specification to represents an actor. First
is the stick figure (shown in Figure 9-15a), and another way to describe an actor
is a class icon with the <<actor>> stereotype (shown in Figure 9-15b).
113
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Also, actors can be classified into two types: primary actors and secondary
actors. The principal actor takes the main benefit from case execution while the
secondary actor also called supporting actors, manages, supervises, and operates the
system. In Figure 16a, Professor is the primary actor, while the Email server is the
secondary actor. In Figure 9-16b, the student is the primary beneficiary. They are both
involved in the use case's execution, but the Professor has a lower benefit.
114
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
115
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
QUIZ IS IT!
_______________9. UML was formally accepted as industry standards for all object
developers by Object Management Group (OMG) on ______________.
______________10. It represents the hardware topology used, and the runtime system
assigned.
______________11. This closely mimic sequence diagrams. They represent object
behavior within a given time frame.
______________12. This show the system dependencies between the various
packages.
______________14. Model the behavior of the system over several transitions, such
that the designer can see at any point the singular ‘state’ of the system given the
external stimuli indicated.
______________15. It is define as a series of actions a system performs to produce an
observable outcome of value to a given actor.
116
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
II. ENUMERATION. Enumerate the following. (2 pts. Each)
______________2.
______________3.
________________19.
________________20.
117
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
LESSON 10
RATIONAL UNIFIED PROCESS
118
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Sometimes this collaborative know-how evolves out of processes, written manuals, educational
programs, and tiny notes collected over several tasks. Unfortunately, such activities frequently end
up accumulating dust on a developer's seldom revised shelf in pleasant binders, easily becoming
outdated and almost never pursued.
Regular upgrades
Pure Online
Customization
Many Integration
It illustrates the simplicity and broad use of the Rational Unified Method.
Here are the examples.
119
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
The horizontal axis shows time and reveals the life-cycle aspects of the phase as it
progresses. The vertical line reflects the main workflows of tasks that fundamentally coordinate
tasks.
The first dimension is the complex component of the system as it is implemented and
represented in terms of phases, steps, iterations, and milestones. The second aspect is the static
component of the method: the description of process components, processes, workflows, artifacts,
and personnel.
All parts of the Rational Unified Process depend on the arrangement of building obstructs that
are utilized to depict what should be made, who is responsible for creating it, how creation can
happen, and when creation is finished. The four squares of the structure are as follows:
120
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Business Modeling Workflow: The business sense (scope) of the project will be
illustrated throughout this workflow.
Requirements Workflow: Used to identify all possible project specifications during the
software development life cycle.
Analysis & Design Workflow: If the process specifications have been fulfilled, the review
and design phase must take these criteria into consideration and turn them into a
specification that can be effectively executed.
Implementation Workflow: That's where a lot of actual scripting takes place, combining
and sorting all the programming into layers that make up the entire system.
Test Workflow: Testing of all sorts is taking place inside this system.
Deployment Workflow: Finally, the development procedure is the whole delivery and
production period. It ensures that the software deliver to the customer as expected.
This segment addresses the five core traditional behaviors and contrasts them to the central
components of the Rational Unified Process.
Requirements Management
121
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
The design activities are focused on the concept of architecture-either system architecture
or software-intensive software architecture.
The essential target of the early emphases of the procedure is the creation and testing of a
product model that, in the underlying advancement stage, appears as an executable building
usage that in the end changes into the last system in ensuing cycles.
Individuals often worry if there is no clear authority in the rational unified process. The
response is that a few people are not adding consistency to the commodity. Consistency,
however, is the responsibility of each employee of the development company. In software
engineering, our concern for quality focuses on two areas: quality of product and process
performance.
122
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Iterative
The iterative process suggested by the Rational Unified Process is obviously built for a
straight-line technique or a cascade strategy for a number of reasons:
Requires that the specification of the can be taken into account. The truth is, the
requirements usually change. Changing requirements and "creep" requirements have also
been the main cause of project difficulty, leading to late completion, missing deadlines,
unsatisfied buyers, and disappointed developers.
In the RUP, integration is not a single "big bang" at the end; rather, the components are
slowly incorporated. This iterative approach is like a continuous integration process.
The iterative approach helps you to minimize threats faster as integration is usually the only
way that threats are detected or discussed.
Provides executives with the ability to make incremental improvements to the company for
some cause, for example, to compete with competing products.
123
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Facilitates re-use because it is easier to recognize similar components as partly planned or
applied rather than to recognise all commonalities from the outset before something has
been developed or introduced.
This helps in a very stable architecture, since you're fixing mistakes over many iterations.
Faults are observed only in early iterations as the project advances into development in the
past and not at the conclusion of a significant testing cycle.
The RUP has developed throughout the years and speaks to the basic comprehension of
numerous people and organizations who make up the differing inheritance of Rational Software
today. Taking a brief look at the rich ancestors of RUP 2000.
124
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Rational Unified Process is a rational representation of an extremely large technique
defined by Grady Booch, James Rumbaugh and Ivar Jacobson reading the Unified Application
Development System course.
Requires flexible ability to cope with evolving demands during the life cycle of construction,
whether from the client or from the project itself.
Emphasizes the need for (and thorough application of) correct documentation.
This depends heavily on skilled and experienced team leaders since the transfer of tasks to
specific staff will yield concrete, pre-planned outcomes in the form of objects.
Despite the focus on integration in the production process, this can often be
counterproductive during experimentation or other processes, when integrations are
overlapping and in the way of other, more basic operations.
Probably, RUP is a very complicated pattern. Given the number of components involved,
including best practices, stages, building blocks, goal requirements, iterations, and workflows, the
correct execution and use of the Rational Unified Process can also be difficult for many
organizations, especially smaller teams or programs.
QUIZ IS IT!
Part I. Identification
Instruction: Put an O at the underline if it is one of the best practices for software development
supported by RUP and an X if it is not
125
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
REFERENCES
(2003) An Introduction to the UML and the Unified Process. In: Guide to the Unified
Process featuring UML, Java and Design Patterns. Springer Professional Computing. Springer,
London
Ambler, S.W. (2001). Enterprise Unified Process White Paper: http://www.ronin-
intl.com/publications/unifiedProcess.htm
Cadenhead, R. (2012) Sams teach yourself Java. Sams Publishing. ISBN-13: 978-0-672-
33575-4
Cosmina, I. (2018) Java for Absolute Beginners, Apress Publishing. ISBN-13: 978-1-4842-3778-6
Curtis, T. Object-Oriented Technology (2nd Edition) From Diagram to Code with Visual
Paradigm for UML
Harold, E.R (2006). Java I/O 2nd Edition. O’Reilly. ISBN-10. 0-596-52750-0
Johnson, R. (2012). An introduction to java programming and object-oriented application
development. Cengage Learning.
Kasparian, R.M (2006). Java for Artists: The Art, Philosophy, and Science of Object-
Oriented Programming. Pulp Free Press. ISBN:1932504052
Kjell, B. (2003). Introduction to Computer Science using Java. Central Connecticut State
University
Kruchten, P. (2000). The Rational Unified Process: An Introduction, 2nd edn. Addison
Wesley Longman, Reading, MA
Malhotra, S., & Chaudhary, S. (2014). Programming in JAVA. Oxford University Press
India.
OMG Unified Modelling Language:
http://www.omg.org/technology/documents/formal/uml.htm
Rational Unified Process: http://www.rational.com/products/rup/
Rational Unified Process: What Is It And How Do You Use It?
https://airbrake.io/blog/sdlc/rational-unified-process
Suggested Readings
126
INTEGRATIVE PROGRAMMING AND TECHNOLOGIES
Digital Materials
Video: Unified Process Model: Definition & Application:
https://study.com/academy/lesson/unified-process-model-definition-application.html
Learning Java 8 – Full Tutorial for Beginners. YouTube Tutorial Video
127