Computer Programming Java J SHS Quarter 2 LAS 6 Week 6 Final
Computer Programming Java J SHS Quarter 2 LAS 6 Week 6 Final
TLE/TVL-ICT(Computer Programming-
Java)
Activity Sheet Quarter 2 – LO 6
Apply Basics of Java Language
Republic Act 8293, section 176 states that: No copyright shall subsist in any
work of the Government of the Philippines. However, prior approval of the
government agency or office wherein the work is created shall be necessary for
exploitation of such work for profit. Such agency or office may, among other things,
impose as a condition the payment of royalties.
2
Introductory Message
Welcome to TLE/TVL- ICT (Computer Programming - Java)!
The TLE/TVL- ICT (Computer Programming - Java) Activity Sheet will help
you facilitate the leaching-learning activities specified in each Most Essential
Learning Competency (MELC) with minimal or no face-to-face encounter between
you and learner. This will be made available to the learners with the references/links
to ease the independent learning.
3
Quarter 2, Week 6
Name of Learner:_____________________________________________________
Grade and Section:_________________________________Date: ______________
Java Technology
Systems Development Life Cycle
What is Systems Development Life Cycle?
The Systems Development Life Cycle (SDLC) is the process of
understanding how an information system (IS) can support
4
business needs, analyzing and designing the system, developing
and delivering it to the end‐users.
The SDLC is usually broken down to the following phases: Systems
Planning, Systems Analysis, Design Phase, System
Implementation and Systems Operations, Support and Security.
Systems Planning
Systems Analysis
Design Phase
System Implementation
Systems Operations
5
system including its inputs, outputs, processes, performance,
and security.
Data and Process Modelling
Data and process modeling is the translation of data gathered into a
graphical representation the using traditional analysis techniques.
Pseudocode
Pseudocode is a compact and informal high‐level description of the
operating principle of a computer program or other algorithm. It uses
the structural conventions of a programming language, but is
intended for human reading rather than machine reading. It
allows the designer to focus on the logic of the algorithm without
being distracted by details of language syntax.
At the same time, the pseudocode needs to be complete. It describes
the entire logic of the algorithm so that implementation becomes a
rote mechanical task of translating line by line into source code.
6
ENDIF
Example
IF HoursWorked > NormalMax THEN
Display overtime message
ELSE
Display regular time message
ENDIF
WHILE
The WHILE construct is used to specify a loop with a test at the top.
The beginning and ending of the loop are indicatedby twokeywords
WHILE and ENDWHILE. The general form is:
WHILE condition
sequence
ENDWHILE
The loop is entered only if the condition is true. The "sequence" is per
formedfor each iteration. At the conclusion of each iteration, the
condition is evaluated and the loop continues as long as the
condition is true.
CASE
A CASE construct indicates a multi‐way branch based on conditions
that are mutually exclusive. Four keywords, CASE,OF,OTHERS, and
ENDCASE, and conditions are used to indicate the various
alternatives. The general form is:
CASE expression OF
condition 1 : sequence 1
condition 2 : sequence 2
...
condition n : sequence n
OTHERS:
default sequence
ENDCASE
The OTHERS clause with its default sequence is optional.
Conditions are
normally numbers or characters indicating thevalue of "expression",
but they can be English statements or some other notation that spec
ifies the condition under which the given sequence is to be
performed. A certain sequence may be associated
with more than one condition.
Example:
CASE Title OF
Mr : Print "Mister"
Mrs : Print "Missus"
Miss : Print "Miss"
7
Ms : Print "Mizz"
Dr : Print "Doctor"
ENDCASE
Example:
CASE grade OF
A : points = 0
B : points = 1
C : points = 2
D : points = 3
F : points = 4
ENDCASE
REPEAT‐UNTIL
This loop is similar to the WHILE loop except that the test is perform
ed at the bottom of the loop instead of at the top. Two keywords,
REPEAT and UNTIL are used. The general form is:
REPEAT
sequence
UNTIL condition
The "sequence" in this type of loop is always performed at least once,
because the test is performed after the sequence is executed. At the
conclusion of each iteration, the condition is evaluated, and the loop
repeats if the condition is false. The loop terminates when the
condition becomes true.
FOR
This loop is a specialized construct for iterating a specific number of
times, often called a "counting" loop. Two keywords, FOR and
ENDFOR are used. The general form is:
FOR iteration bounds
sequence
ENDFOR
Flow Charting
The flowchart is a means of visually presenting the flow of data
through an information processing systems, the operations
performed within the system and the sequence in which they are
performed. The program flow chart can be likened to the blueprintof
8
a building. As we know a designer draws a blueprint
beforestartingconstruction on a building. Similarly, a programmer
prefers to draw a flowchart prior to writing a computer program. As
in the case of the drawing of a blueprint, the flowchart is drawn
according to defined rules and using standard flowchart symbols
prescribed by the American National Standard Institute, Inc.
Different flow chart symbols have different meanings.The following
are the most common flow chart symbols:
Denotes either
Parallelogra
an input
m
operation (e.g.,
INPUT) or an
output operation
(e.g. PRINT)
Rectangle Denotes a
process to be
carried out (e.g.,
an addition).
Diamond Denotes a
decision (or
branch) to be
made. The
program should
continue along
one of two
routes
9
Terminator: An oval flow chart shape indicating the start or end
of the process.
Process: A rectangular flow chart shape indicating a normal
process flow step.
Decision: A diamond flow chart shape indication a branch in
the process flow.
Connector: A small, labeled, circular flow chart shape used to
indicate a jump in the process flow.
Data: A parallelogram that indicates data input or output (I/O)
for a process.
Document: used to indicate a document or report
System Construction
After designing the new system, the whole system is ready to be
translated from program specifications into computer instructions
using a programming language of choice. This process is known as
coding.
System Testing
After the system is built, it is then tested to ensure it performs as
designed. A test plan should be developed and run on a given set of
test data. The output of the test run should match the expected
results. Test to be performed: Unit Test, Integration Test and System
Test.
Installation
After testing the system is tested, it will be deployed to the client and
be used by the end‐users.
Training Plan
Training Plan includes detailed instructions on how to use the new
system and help manage the changes caused by the new system.
System Test
10
Post‐implementation evaluations verify that the new system meets
specified requirements, complies with user objectives, and produces
the anticipated benefits.
Java Technology
11
classes for all the Java technology packages, which includes
basic language classes, GUI component classes, and so on. The
other main deployment environment is the web browse. Most
commercial browsers supply a Java Technology Interpreter and
Runtime environment.
12
always loaded first. After loading all the classes, the memory layout of
the executable is then determined. This adds protection against
unauthorized access to restricted areas of the code since the memory
layout is determined during runtime.
After loading the class and lay outing of memory, the bytecode verifier th
etests the format of the code fragments and checks the code fragments for
illegal code that can violate access rights to objects.
After all of these have been done, the code is then finally executed.
Source: https://sites.google.com/site/beginnerofcs/object-oriented-program
Figure 2: Five Phases in Java Program
Phase 1: Creating a Program
13
Phase 1 consists of editing a file with an editor program (normally known
simply as an editor). You type a Java program (typically referred to as source
code) using the editor, make any necessary corrections and save the
program on a secondary storage device, such as your hard drive. A file
name ending with the.java extension indicates that the file contains Java
source code. We assume that the reader knows how to edit a file. Two
editors widely used on Linux systems are viand emacs. On Windows, a
simple editing program like Windows Notepad will suffice. Many freeware
and shareware editors are also available for download from the Internet.
For organizations that develop substantial information systems,
integrated development environments (IDEs)are available from many major
software suppliers, including Sun Microsystems. IDEs provide tools that
support the software development process, including editors for writing
and editing programs and debuggers for locating logic errors.
14
arriving over the network do not damage your files or your system (as
computer viruses and worms might).
Phase 5: Execution
In Phase 5, the JVM executes the program’s bytecodes, thusperforming the
actions specified by the program. In early Java versions, the JVM was
simply an interpreter for Java bytecodes. This caused most Java programs
to execute slowly because the JVM would interpret and execute
one bytecode at a time. Today’s JVMs typically execute bytecodes using a
combination of interpretation and so‐called just‐in‐time(JIT) compilation.
In this process, The JVM analyzes the bytecodes as they are interpreted,
searching for hot spots— parts of the bytecodes that execute frequently.
For these parts, a just‐in‐time(JIT) compiler—known as the Java.
HotSpot compiler translates the bytecodes into the underlying computer’s
machine language. When theJVMencountersthesecompiled parts again,the
faster machine‐language code executes. Thus Java programs actually go
through two compilation phases—one in which source code is translated
into bytecodes (for portability across JVMs on different computer platforms)
and a second in which, during execution, the bytecodes are translated into
machine language for the actual computer on which the program executes.
Gosling, J., Joy, B., Steele, G., Bracha, G., & Buckley, A. (2014). The
Java® Language Specification. Retrieved from
https://docs.oracle.com/javase/specs/jls/se8/jls8.pdf
Hebb, N. (n.d.). What is a Flow Chart? Retrieved from BreezeTree
Software: https://www.breezetree.com/articles/what-is-a-flow-
chart/
History of Java programming language. (n.d.). Retrieved from Free
Java Guide: http://www.freejavaguide.com/history.html
15
Java Example Codes and Tutorials. (n.d.). Retrieved from Rose India:
https://www.roseindia.net/java/
Malik, D. S. (2006). Java Programming: From Problem Analysis to
Program Design (2nd ed.).
Pandey, S. B. (n.d.). Retrieved from
http://www.geocities.ws/shaileshpandeynec/cflowchart.pdf
Criteria Percentage
Creativity and Originality. The 40%
pseudo code is simple and the
process is written with learner’s
own language. Exhibited
uniqueness of style and
16
execution process.
Clarity and Logic. The code
shows clear output. Every step
shows logical connections from 40%
the previous and next stage of
execution.
Application of Principles. The
principles of systems
development are applied. Each
20%
step shows executability of the
code. Flow charting is used and
consistent with the code.
V. Answer Key
17