of 78
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
1/78
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
2/78
Data Gathering Instrument for Trainees Characteristics
Please answer the following instrument according to the characteristicsdescribed below. Encircle the letter of your choice that best describes you as alearner. Blank spaces are provided for some data that need your response.
Characteristics of learners
Language, literacy
and numeracy(LL&N)
Average grade in:
English
a. 95 and above
b. 90 to 94
c. 85 to 89
d. 80 to 84
a. 75 to 79
Average grade in:
Math
a. 95 and above
b. 90 to 94
c. 85 to 89
d. 80 to 84
e. 75 to 79
Cultural and
language
background
Ethnicity/culture:
a. Ifugao
b. Igorot
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
3/78
Characteristics of learners
f. Diabetesg. Others(please specify) ___________________
Previous
experience with
the topic
Certificates
a. Microsoft Certified Professionalb. Java Certified Programmer
Number of years as a programmer ______
Previous learning
experience
List down trainings related to Software Development
______________________________________________________
___________________________
Training Level
completed
National Certificates acquired and NC level
___________________________
___________________________
Special coursesOther courses related to Software Development
a. Units in educationb. Masters degree units in educationc. Others(please specify) _________________________
Learning styles a. Visual - The visual learner takes mental pictures ofinformation given, so in order for this kind oflearner to retain information, oral or written,
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
4/78
Multiple Intelligences Survey 1999 Walter McKenzie, The One and Only Surfaquarium
http://surfaquarium.com/MI/inventory.htm
Part IComplete each section by placing a 1 next to each statement you feelaccurately describes you. If you do not identify with a statement, leave thespace provided blank. Then total the column in each section.
Section 1
1_____ I enjoy categorizing things by common traits_____ Ecological issues are important to me1_____ Hiking and camping are enjoyable activities_____ I enjoy working on a garden1_____ I believe preserving our National Parks is important1_____ Putting things in hierarchies makes sense to me_____ Animals are important in my life_____ My home has a recycling system in place
_____ I enjoy studying biology, botany and/or zoology1_____ I spend a great deal of time outdoors5_____TOTALfor Section 1
Section 21 I easily pick up on patterns
http://surfaquarium.com/MI/inventory.htmhttp://surfaquarium.com/MI/inventory.htmhttp://surfaquarium.com/MI/inventory.htm7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
5/78
Section 41_____ It is important to see my role in the big picture of things
1_____ I enjoy discussing questions about life1_____ Religion is important to me
_____ I enjoy viewing art masterpieces1_____ Relaxation and meditation exercises are rewarding1_____ I like visiting breathtaking sites in nature_____ I enjoy reading ancient and modern philosophers1_____ Learning new things is easier when I understand their value_____ I wonder if there are other forms of intelligent life in the universe
_____ Studying history and ancient culture helps give me perspective6_____TOTALfor Section 4
Section 51_____ I learn best interacting with others
1_____ The more the merrier1_____ Study groups are very productive for me
_____ I enjoy chat rooms_____ Participating in politics is important_____ Television and radio talk shows are enjoyable
1_____ I am a team player1_____ I dislike working alone1_____ Clubs and extracurricular activities are fun
I tt ti t i l i d
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
6/78
Section 7_____ I enjoy reading all kinds of materials
1_____ Taking notes helps me remember and understand_____ I faithfully contact friends through letters and/or e-mail
_____ It is easy for me to explain my ideas to others_____ I keep a journal_____ Word puzzles like crosswords and jumbles are fun_____ I write for pleasure_____ I enjoy playing with words like puns, anagrams and spoonerisms_____ Foreign languages interest me
_____ Debates and public speaking are activities I like to participate in1_____TOTALfor Section 7
Section 81_____ I am keenly aware of my moral beliefs
1_____ I learn best when I have an emotional attachment to the subject1_____ Fairness is important to me
1_____ My attitude effects how I learn_____ Social justice issues concern me1_____ Working alone can be just as productive as working in a group
1_____ I need to know why I should do something before I agree to do it1_____ When I believe in something I will give 100% effort to it1_____ I like to be involved in causes that help others
I illi t t t i titi t i ht
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
7/78
Part IINow carry forward your total from each section and multiply by 10 below:
Section TotalForward
Multiply Score
1 5 x 10 50
2 6 x 10 60
3 10 x 10 100
4 6 x 10 60
5 6 x 10 60
6 6 x 10 60
7 1 x 10 10
8 8 x 10 80
9 8 x 10 80
Part IIINow plot your scores on the bar graph provided:
100 100
9080 80 80
70
60 60 60 60 60
50 50
40
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
8/78
FORM 1.1 SELF-ASSESSMENT CHECK
INSTRUCTIONS: This Self-Check Instrument will give the trainer necessary data or
information which is essential in planning training sessions. Please
check the appropriate box of your answer to the questions below.
CORE COMPETENCIES
CAN I? YES NO
1. Design program logic
1.1 Select program logic design approach?
1.2 Document the program logic design?
1.3 Validate the design?
2. Apply program development approach?
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
9/78
CORE COMPETENCIES
CAN I? YES NO
3.5 Test code?
Note: In making the Self-Check for your Qualification, all required
competencies should be specified. It is therefore required of a Trainer to
be well-versed of the CBC or TR of the program qualification he is
teaching.
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
10/78
Evidences/Proof of Current Competencies
Form 1.2: Evidence of Current Competencies acquired related to
Job/Occupation
Current
competencies
Proof/Evidence Means of validating
Design Program
Logic
Certificate of Achievement /
Recognition (from IT related
courses/programs/trainings)
Certificate of Employment
(with IT related positions)
Programmers System developers System engineers
System analyst System designer Encoder
Contact previous employer
verify the authenticity of the
document
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
11/78
Identifying Training Gaps
From the accomplished Self-Assessment Check (Form 1.1) and the evidences of
current competencies (Form 1.2), the Trainer will be able to identify what the training
needs of the prospective trainee are.
Form 1.3 Summaries of Current Competencies versus Required Competencies
Required Units of
Competency/Learning
Outcomes based on CBC
Current Competencies Training
Gaps/Requirements
1. Design Program Logic
1.1 Select the program
logic design approach
Select the program logic
design approach
1.2 Document theprogram logic ordesign
Document the program
logic or design
1 3 Validate the design Validate the design
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
12/78
4.4 Document Activities Document Activities
4.5 Test Code Test Code
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
13/78
Using Form No.1.4, convert the Training Gaps into a Training Needs/Requirements. Refer to the CBC in identifying the Module Title or Unit of
Competency of the training needs identified.Form No. 1.4: Training Needs
Training Needs
(Learning Outcomes)
Module Title/Module of
Instruction
Apply basic language syntax and layout 1. Apply Object-OrientedProgram Language Skills
Apply basic OO principles in the target
language
Debug code
Document activities
Test code
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
14/78
Session Plan
Sector : Information and Communications Technology (ICT) Sector
Qualification Title : Programming NC IV
Unit of Competency : Apply Object-Oriented Program Language Skills using JAVA Programming Language
Module : Applying Object-Oriented Program Language Skills using JAVA Programming Language
Learning Outcomes:
1. Apply basic language syntax and layout
2. Apply basic OO principles in the target language (JAVA)
3. Debug JAVA Codes
4. Document Activities
5. Test JAVA Codes
A. Introduction
This unit of competency covers the knowledge, skills and attitudes in programming tasks using an object oriented programming language competence includes tool usage,documentation, debugging and testing techniques in support of the programming activities
B. Learning Activities
LO 1: Apply basic language syntax and layout
Learning Content MethodsPresentation
Practice Feedback Resources Time
Semantics and Syntax Modular self-paced
ReadInformationSheet 3.1-1
AnswerSelf-Check 3.1-1
Compareanswers toAnswer Key 3.1-1
CBLM 1 HR
Elements of a JAVA
Programming Language
Modular self-
paced
Read
InformationSheet 3.1-2
Answer
Self-Check 3.1-2
Compare
answers toAnswer Key 3.1-2
CBLM 6 HRS
Practice PerformTask Sheet 3.1-2
Evaluateyourwork usingPerformanceCriteria
Computer
Package w/ Java
Program Installed,
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
15/78
Checklist 3.1-2 Project Sheet 3.1-
2
Control Statements in JAVAProgramming Language
Modular self-paced
ReadInformationSheet 3.1-3
AnswerSelf-Check 3.1-3
Compareanswers toAnswer Key 3.1-3
CBLM 15 HRS
Practice PerformTask Sheet 3.1-3
Evaluateyourwork using
PerformanceCriteriaChecklist 3.1-3
Computer
Package w/ Java
Program Installed,
Project Sheet 3.1-
3
Arrays in JAVA ProgrammingLanguage
Modular self-paced
ReadInformationSheet 3.1-4
AnswerSelf-Check 3.1-4
Compareanswers toAnswer Key 3.1-4
CBLM 3 HRS
Practice PerformTask Sheet 3.1-4
Evaluateyourwork usingPerformanceCriteriaChecklist 3.1-4
Computer
Package w/ Java
Program Installed,
Project Sheet 3.1-
4
LO 2: Apply basic OO principles in the target language (JAVA)
Learning Content MethodsPresentation
Practice Feedback Resources Time
Principles of Object-OrientedProgramming Language
Modular self-paced
Read informationsheet 3.2-1
Answer self-check 3.2-1
Comparer toanswer key 3.2-1
CBLM 1 HR
Apply principle ofEncapsulation on JAVAPrograms
Modular self-paced
Read informationsheet 3.2-2
Answer self-check 3.2-2
Comparer toanswer key 3.2-2
CBLM 2 HRS
Practice PerformTask Sheet 3.2-2
Evaluateyourwork usingPerformanceCriteriaChecklist 3.2-2
Computer
Package w/ Java
Program Installed,
Project Sheet 3.2-
2 Apply principle of Inheritance
on JAVA Programs Modular self-
paced Read information
sheet 3.2-3 Answer self-
check 3.2-3 Comparer to
answer key 3.2-3CBLM 2 HRS
Practice PerformTask Sheet 3.2-3
Evaluateyourwork usingPerformance
Computer
Package w/ Java
Program Installed,
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
16/78
CriteriaChecklist 3.2-3
Project Sheet 3.2-
3
Apply principle ofPolymorphism on JAVAPrograms
Modular self-paced
Read informationsheet 3.2-4
Answer self-check 3.2-4
Comparer toanswer key 3.2-4
CBLM 2 HRS
Practice PerformTask Sheet 3.2-4
Evaluateyourwork usingPerformance
CriteriaChecklist 3.2-4
Computer
Package w/ Java
Program Installed,
Project Sheet 3.2-
2
Use Forms in JAVA Modular self-paced
Read informationsheet 3.2-5
Answer self-check 3.2-5
Comparer toanswer key 3.2-5
CBLM 2 HRS
Practice PerformTask Sheet 3.2-5
Evaluateyourwork usingPerformanceCriteriaChecklist 3.2-5
Computer
Package w/ Java
Program Installed,
Project Sheet 3.2-
2
LO 3: Debug Code
Learning Content Methods Presentation Practice Feedback Resources Time
Errors Handling Modular self-paced
Read informationsheet 3.3-1
Answer self-check 3.3-1
Comparer toanswer key 3.3-1
CBLM 1 HR
Practice PerformTask Sheet 3.3-1
Evaluateyourwork usingPerformanceCriteriaChecklist 3.3-1
Computer
Package w/ Java
Program Installed,
Project Sheet 3.3-
1
Debugging Options Modular self-paced
Read informationsheet 3.3-2
Answer self-check 3.3-2
Comparer toanswer key 3.3-2
CBLM 1 HR
Practice PerformTask Sheet 3.3-2
Evaluateyourwork using
PerformanceCriteriaChecklist 3.3-2
Computer
Package w/ JavaProgram Installed,
Project Sheet 3.3-
2
Procedures in debugging andediting the program
Modular self-paced
Read informationsheet 3.3-3
Answer self-check 3.3-3
Comparer toanswer key 3.3-3
CBLM 1 HR
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
17/78
Compiling the Program Modular self-paced
Read informationsheet 3.3-4
Answer self-check 3.3-4
Comparer toanswer key 3.3-4
CBLM 1 HR
LO 4: Document Activities
Learning Content MethodsPresentation
Practice Feedback Resources Time
Documentation Techniques Modular self-paced
Read informationsheet 3.4-1
Answer self-check 3.4-1
Comparer toanswer key 3.4-1
CBLM 1 HR
Program and DocumentationStandards
Modular self-paced
Read informationsheet 3.4-2
Answer self-check 3.4-2
Comparer toanswer key 3.4-2
CBLM 1 HR
Practice PerformTask Sheet 3.4-2
Evaluateyourwork usingPerformanceCriteriaChecklist 3.4-2
Computer
Package w/ Java
Program Installed,
Project Sheet 3.4-
2
Internal DocumentationTechniques
Modular self-paced
Read informationsheet 3.4-3
Answer self-check 3.4-3
Comparer toanswer key 3.4-3
CBLM 1 HR
Practice PerformTask Sheet 3.4-3
Evaluateyourwork using
PerformanceCriteriaChecklist 3.4-3
Computer
Package w/ JavaProgram Installed,
Project Sheet 3.4-
3
LO 5: Test Code
Learning Content MethodsPresentation
Practice Feedback Resources Time
Testing Techniques Modular self-paced
Read informationsheet 3.5-1
Answer self-check 3.5-1
Comparer toanswer key 3.5-1
CBLM 1 HR
Practice PerformTask Sheet 3.4-1
Evaluateyourwork usingPerformance
CriteriaChecklist 3.5-1
Computer
Package w/ Java
Program Installed,Project Sheet 3.5-
1
Program and DocumentationStandards
Modular self-paced
Read informationsheet 3.5-2
Answer self-check 3.5-2
Comparer toanswer key 3.5-2
CBLM 1 HR
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
18/78
User Manual Modular self-paced
Read informationsheet 3.5-3
Answer self-check 3.5-3
Comparer toanswer key 3.5-3
CBLM 1 HR
Printing Documents of thePrograms
Modular self-paced
Read informationsheet 3.5-4
Answer self-check 3.5-4
Comparer toanswer key 3.5-4
CBLM 1 HR
C. Assessment Plan
Written Test:
Performance Test:
D. Teachers Self-Reflection of the Session
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
19/78
PARTS OF A COMPETENCY-BASED LEARNING MATERIAL
List of Competencies
M d l C t t
Module Content
Module ContentModule Content
Learning Outcome Summary
Learning Experiences
Information Sheet
Self Check
Self Check Answer Key
Operation/Task/Job Sheet
Performance Criteria Checklist
References/Further Reading
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
20/78
PROGRAMMING NC IVCOMPETENCY-BASED LEARNING MATERIALS (CBLM)
List of Competencies
No. Unit of Competency Module Title Code
1. Design Program Logic Designing Program Logic CECSD01
2.Apply ProgramDevelopment Approach
Applying ProgramDevelopment Approach
CECSD02
3.Apply Object-OrientedProgram LanguageSkills
Applying Object-Oriented ProgramLanguage Skills
CECSD03
4.Apply ProgrammingSkills in a SecondLanguage
Applying ProgrammingSkills in a SecondLanguage
CECSD04
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
21/78
MODULE CONTENT
UNIT OF COMPETENCY : APPLY OBJECT-ORIENTED PROGRAM LANGUAGE SKILLS
MODULE TITLE : APPLYING OBJECT-ORIENTED PROGRAM LANGUAGE SKILLS
MODULE DESCRIPTOR : This module defines the competency required to undertake
programming tasks using an object oriented programming
language competence includes tool usage, documentation,
debugging and testing techniques in support of the
programming activities
NOMINAL DURATION : 54 hours
LEARNING OUTCOMES:
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
22/78
11.Used program debugging techniques to detect and resolve errors based on programstructure.
12.Followed the guidelines for developing maintainable code adhering to a set of codingstandard.
13.Followed and used internal documentation standards and tools.14.Designed a built-in application programs in accordance to systems and programming
requirements and standards.15.Developed and conducted simple test to confirm the coding process to meet design
specification16.Documented the tests performed based on program and documentation standard.17.Made corrections to the code and documentation as needed.
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
23/78
LEARNING OUTCOME NO. 1
APPLY BASIC LANGUAGE SYNTAX AND LAYOUT
CONTENTS:
1. Semantics and Syntax2. Elements of Programming3. Program Control Structure4. Arrays
ASSESSMENT CRITERIA:
1. Observed basic language syntax rules and best practice based on program standardand structure.
2. Used language data types, operators and expressions based on program standardand structure.
3. Used appropriate language syntax for sequence, selection and iteration constructsbased on program standard and structure.
4. Used Arrays and array objects based on program standard and structure.
CONDITIONS:
Trainees must be provided with the following:
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
24/78
Learning Experiences
Learning Outcome 1APPLY BASIC LANGUAGE SYNTAX AND LAYOUT
Learning Activities Special Instructions
1. Read Information Sheet 3.1-1 onSyntax and Semantics
In this learning outcome you shall learn andunderstand the difference of Semantics and
syntax, the basic programming tools and
elements together with different forms of
control structures.
Go through the information sheets and do
Some source code placed on specific
information and answer self-checks to
ensure that knowledge of the standards in
procedural programming language.
2. Answer Self-Check 3.1-1Compare your answers withAnswer Key 3.1-1
3. Read Information Sheet 3.1-2 onElements of a Java ProgrammingLanguage
4. Answer Self-Check 3.1-2Compare your answers withAnswer Key 3.1-2
5. PerformTask Sheet 3.1-2Evaluate your work using
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
25/78
Information Sheet 3.1-1Syntax and Semantics
Learning Objectives:
After reading this INFORMATION SHEET, YOU MUST be able to:
1. Describe syntax and semantics2. Explain the relationship of syntax and semantics3. Use basic language syntax rules based on the standard of Java Programming Language.
Introduction
Language provides a means of communication by sound and written symbols. Human
beings learn language as a consequence of their life experiences, but in linguisticsthe
science of languagesthe forms and leanings of languages are subjected to a more rigorous
examination. This science can also be applied to the subject of this text, programming
languages. In contrast to the natural languages, with which we communicate our thoughts
and feelings, programming languages can be viewed as artificial languages defined by men and
women initially for the purpose of communicating with computers but, as importantly, for
communicating algorithms among people.
What is Syntax?
A f i l b l d i l d d
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
26/78
What is Semantic?
Semantic is
Meaning of statement
Compatibility of statement correct usage of statement Computers can't read your mind, so they don't help much if the meaning of your
program is not what you wanted.
In this regard, semantics permits programs to be separated into their syntacticalpart (grammatical structure) and their semantic part (meaning).
Example:
If instead of
X = 1;
it were given as
Y = 1;
WHERE X was declared in program but Y was not
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
27/78
Self- Check 3.1-1
True or FalseDirection: Write T if the statement is correct and F if the statement is false. Write your
answers on the space provided before each number
___1. Semantic is a set of strict grammar rules, symbols, and special words used to
construct a computer program.
___2. Syntax is the speaking of the language, that is the rules for constructing valid
statements in that language.
___3. If you break the rules the compiler will complain.
___4.The term semantic can also be used to refer to these rules themselves, as in
the syntax of a language.
___5. If a syntax error is encountered during compilation (mapping high level
language to low level language) it must be corrected if the source code is to be
successfully compiled.
___6. Computers can read your mind, so they don't help much if the meaning of
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
28/78
ANSWER KEY 1.1
1. F2. F3. T4. F5. T6. F
7. F8. T9. T
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
29/78
Information Sheet 3.1-2Elements of a Java Programming Language
Learning Objectives:
After reading this INFORMATION SHEET, YOU MUST be able to:
1. Define the different programming elements in Java2. Enumerate the different program elements in Java3. Enumerate the different operators used in Java4. Use language data types, operators and expressions based on the standard of specific
programming language.
The previous information sheet, you were introduced to the importance of following the
correct syntax and understanding the different semantics of the every program code you are
writing. In this information sheet, you will be introduced on the different elements of Java
programming language which later will be used to create your Java program
A JAVA program is made up of many elements. These elements are the building blocks
of a Java program. Some of these elements are a MUST to run any Java program and there are
some that can be made available if it is critical in satisfying specific program requirements.
Proper use of the different syntax and understanding of their semantics are important
to write, compile and run any Java program regardless of their provided functions.
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
30/78
Documentation
This indicates a documentation comment (doc comment, for short). The compiler ignores this
kind of comment, just like it ignores comments that use /* and */. The JDK javadoc tool uses
doc comments when preparing automatically generated documentation.
Example:
/**
This applet tests graphics.
*/
public class testApplet extends applet{...
or
/**
* Asterisks inside the comment are ignored by
javadoc so they
* can be used to make nice line markers.
**/
Java Data and Variables
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
31/78
For each primitive type, there is a corresponding wrapper class. A wrapper class can be
used to convert a primitive data value into an object, and some type of objects into primitive
data. The table shows primitive types and their wrapper classes:
primitive typeWrapper type
Byte Byte
Short Short
Int Int
Long Long
Float Float
Double Double
Char Character
Boolean Boolean
Variables only exist within the structure in which they are defined. For example, if a variable
is created within a method, it cannot be accessed outside the method. In addition, a differentmethod can create a variable of the same name which will not conflict with the other variable.
A java variable can be thought of as a little box made up of one or more bytes that can hold a
value of a particular data type:
Syntax: variabletype variablename data;
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
32/78
public class MaxDemo {
public static void main(String[]args) {
//integers
byte largestByte = Byte.MAX_VALUE;short largestShort = Short.MAX_VALUE;
int largestInteger = Integer.MAX_VALUE;
long largestLong = Long.MAX_VALUE;
//real numbers
float largestFloat = Float.MAX_VALUE;
double largestDouble = Double.MAX_VALUE;
//other primitive datatypes
char aChar = '';boolean = aBoolean = true;
//Display them all
System.out.println("largest byte value is " +
largestByte);
System.out.println("largest short value is " +
largestShort);
System.out.println("largest integer is " +
largestInteger);System.out.println("largest long is " +
largestLong);
System.out.println("largest float is " +
largestFloat);
System.out.println("largest double is " +
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
33/78
Java Arithmetic Operators
The Java programming language has includes five simple arithmetic operators like are +
(addition), - (subtraction), * (multiplication), / (division), and % (modulo). The following tablesummarizes the binary arithmetic operators in the Java programming language.
The relation operators in Java are: ==, !=, , =. The meanings of these operators
are:
Use Returns true if
op1 + op2 op1 added to op2
op1 - op2 op2 subtracted from op1
op1 * op2 op1 multiplied with op2
op1 / op2 op1 divided by op2
op1 % op2 Computes the remainder of dividing op1 by op2
The following java program, ArithmeticProg , defines two integers and two double-precision
floating-point numbers and uses the five arithmetic operators to perform different arithmetic
operations This program also uses + to concatenate strings The arithmetic operations are
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
34/78
Java Relational Operators
A relational operator compares two values and determines the relationship between them. For
example, != returns true if its two operands are unequal.
Relational operators are used to test whether two values are equal, whether one value is
greater than another, and so forth. The relation operators in Java are: ==, !=, , =.
The meanings of these operators are:
Use Returns true if
op1 > op2 op1 is greater than op2
op1 >= op2 op1 is greater than or equal to op2
op1 < op2 op1 is less than to op2
op1
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
35/78
Java Logical Operators
The logical operators are: OR(||) , AND(&&) , and NOT(!) . Java supplies a primitive data type
called Boolean, instances of which can take the value true or false only, and have the defaultvalue false. The major use of Boolean facilities is to implement the expressions which control if
decisions and while loops.
These operators act on Boolean operands according to this table
A B A && B A || B !A !B
T T T T F F
T F F T F T
F T F T T F
F F F F T T
! the NOT operator
|| the short-circuit OR operator
&& the short circuit AND operator
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
36/78
Self- Check 3.1-2
(Enumeration) : Enumerate the following:Java Arithmetic Operators:
1.___________________
2.___________________
3.___________________
4.___________________
5.___________________
Java Relational Operators
1.___________________
2.___________________
3.___________________
4.___________________
5.___________________
6.___________________
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
37/78
ANSWER KEY 3.1-2
Java Arithmetic Operators:
1. Java Arithmetic Operators:
2. + (addition)
3. - (subtraction)
4. * (multiplication)
5. / (division)6. % (modulo).
Java Relational Operators
7. ==
8. !=
9.
11. =
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
38/78
TASK SHEET 3.1-2
Title: Create a Program Using Basic Java Programming Elements
Performance Objective: Given the problem narrative assigned to you (refer to
Project Sheet 3.2-1), you should be able to
create/develop a program or application that will
satisfy the requirements specified in your problem
narrative, following the standard syntax and
semantics of different Java Programming Elements
Supplies/Materials : Problem Narrative 3.2-1
Equipment : Computer Package with a JAVA IDE installed
Steps/Procedure:
Read and Analyze the requirements specified in the ProblemNarrative
Identify the required variables and their respective datatypes
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
39/78
Project Sheet 3.1-2
Create a program that will assign numeric values to five (5) numeric variables then print the
following results:
1.The sum of the first and last number
2.The difference of the second and third number
3.The product of the computed sum of the 1st and 5th number and the computed
difference of the 2nd and 3rd number
4.The quotient of the resulting values in requirements number 3 and 1
5. Value of the last number
Test case #1
Your 1st number: 5
Your 2nd number: 4
Your 3rd number: 3
Your 4th number: 2
Your 5th number: 1
Result no. 1: 6
Result no. 2: 1
Result no. 3: 6
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
40/78
Performance Criteria Checklist 3.1-2
CRITERIADid you.
YES NO
1. Declare five (5) variables with numeric type such
as:a. intb. bytec. long
d. shorte. floatf. Double
2. Assign numeric values as defined in the test cases
3. Use proper operators to get the right results asdefined in the problem
4. Use proper syntax and semantics in the program
5. Displayed the right results in the monitor as per
test cases
6 Included internal documentation in the program
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
41/78
Information Sheet 3.1-3Control Statements in Java Programming Language
Learning Objectives:
After reading this INFORMATION SHEET, YOU MUST be able to:
1. Used appropriate language syntax for sequence, selection and iteration
constructs based on the standard of specific programming language.
Introduction
The statements inside your source files (source code, / program) are
generally executed from top to bottom, in the order that they appear. Control
statements, however, break up the flow of execution by employing decision
making, looping, and branching, enabling your program
to conditionallyexecute particular blocks of code. This section describes thedecision-making statements (if-then, if-then-else, switch), the looping statements
(for, while, do-while), and the branching statements (break, continue, return)
supported by the Java programming language.
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
42/78
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
43/78
1. Java If-Else Statement
The if-else class of statements should have the following form:
if (condition_1) {
statement(s)_if_condition_1_is_met;
} else if (condition) {
statement(s)_if_condition_2_is_met;
} else {
Statement(s)_if_none_of_the_first_conditions_ar
e_met;
}
All programming languages have some form of an if statement that allows you to test
conditions. All arrays have lengths and we can access that length by referencing the variable
arrayname.length. We test the length of the args array as follows:
Source Code 1.1:
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
44/78
Source Code 1.2:
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
45/78
We could add an else statement like so:
Source Code 1.3:
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
46/78
Example 1
if(color == BLUE)) {
System.out.println("The color is blue.");} else if(color == GREEN) {
System.out.println("The color is green.");
}
Example 2
if(employee.isManager()) {
System.out.println("Is a Manager");
} else if(employee.isVicePresident()) {
System.out.println("Is a Vice-President");
} else {
System.out.println("Is a Worker");
}
Source Code 1.5
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
47/78
2. Java Loops (while, do-while and for loops)
There may be a situation when we need to execute a block of code several number of times,
and is often referred to as a loop.
Java has very flexible three looping mechanisms. You can use one of the following three loops:
while Loop do...while Loop for Loop
The while Loop:
A while loop is a control structure that allows you to repeat a task a certain number of times.
Syntax:
The syntax of a while loop is:
while(Boolean_expression){
//Statements}
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
48/78
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
49/78
A for loop is useful when you know how many times a task is to be repeated.
Syntax:
The syntax of a for loop is:
for(initialization; Boolean_expression; update){
//Statements}
Here is the flow of control in a for loop:
1.The initialization step is executed first, and only once. This step allows you to declareand initialize any loop control variables. You are not required to put a statement here,as long as a semicolon appears.
2. Next, the Boolean expression is evaluated. If it is true, the body of the loop is executed.If it is false, the body of the loop does not execute and flow of control jumps to the nextstatement past the for loop.
3. After the body of the for loop executes, the flow of control jumps back up to the updatestatement. This statement allows you to update any loop control variables. Thisstatement can be left blank, as long as a semicolon appears after the Booleanexpression.
4.The Boolean expression is now evaluated again. If it is true, the loop executes and thet it lf (b d f l th d t t th B l i ) Aft th
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
50/78
Self- Check 3.1-3
Simulation: Analyze the source code below and show the proper output.
public class Count{
public static void main(String[]args){
int count;
for(count = 0;count
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
51/78
ANSWER KEY 3.1-3
Number: 0Number: 1Number: 2Number: 3Number: 4Number: 5
Number: 6Number: 7Number: 8Number: 9Number: 10
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
52/78
TASK SHEET 3.1-3
Title: Create a Program Using Control Statements
Performance Objective: Given the problem narrative assigned to you (refer to
Project Sheet 3.1-3), you should be able to
create/develop a program or application that will
satisfy the requirements specified in your problem
narrative, following the standard syntax andsemantics of different Java Programming Control
Statements
Supplies/Materials : Project Sheet 3.1.3
Equipment : Computer Package with a JAVA IDE installed
Steps/Procedure:
Read and Analyze the requirements specified in the Problem
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
53/78
Project Sheet 3.1-3
Create a program that will assign numeric values to four (4) numeric variables. Apply
the following rules to get the required result.1. If the 1st number is higher than the last number, print the computed sum of the
2nd and 3rd number
2. If the 2nd number is lower than the 3rd number, print the computed difference of
the 1st and last number
3. If 1st number is equal to the 2nd number, print the computed product of the 3rd
number and last number
4. If the 3rd and last number are equal, print the computed quotient of the 1st and
2nd number
5. If the sum of the 1st two numbers is higher than the sum of the last two
numbers, print POO, otherwise, print MOO
Test case #1Your 1st number: 1
Your 2nd number: 2
Your 3rd number: 3
Your 4th number: 4
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
54/78
Performance Criteria Checklist 3.1-3
CRITERIADid you.
YES NO
1. Declare at least four (4) numeric variables
a. intb. bytec. longd. short
e. floatf. double
2. Assign numeric values as defined in the test cases
3. Use proper operators to get the right results asdefined in the problem
4.The appropriate syntax for selection constructs is
used
5. Displayed the right results in the monitor as pertest cases
6. Included internal documentation in the programusing comments such as:
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
55/78
Information Sheet 3.1-4Arrays in a Java
Learning Objectives:
After reading this INFORMATION SHEET, YOU MUST be able to:
1. Define Java Array2. Explain the difference between an Array and a Variable3. Identify the advantages of using an Array
4. Use Arrays to efficiently write a Java Program
Introduction
In the previous lessons, you should now be able to create programs using different elements of
Java programming language together with its different control statements. To be more efficient
in writing codes, knowledge on arrays is important. This lesson will provide all necessary
information to enable a programmer to effectively and efficiently integrate the use of arrays
and arrays of object to satisfy a given problem requirement.
What is an Array?
So far, you have been working with variables that hold only one value. The integervariables you have set up have held only one number, and the string variables just onel i f i h ld h l i ' lik
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
56/78
But this just tells Java that you want to set up an integer array. It doesn't say howmany positions the array should hold. To do that, you have to set up a new array
object:
aryNums = new int[6];
You start with your array name, followed by the equals sign. After the equals sign, youneed the Java keyword new, and then your data type again. After the data type come a
pair of square brackets. In between the square brackets you need the size of the array.The size is how many positions the array should hold.
If you prefer, you can put all that on one line:
int[ ] aryNums = new int[6];
So we are telling Java to set up an array with 6 positions in it. After this line isexecuted, Java will assign default values for the array. Because we've set up an integerarray, the default values for all 6 positions will be zero ( 0 ).
To assign values to the various positions in an array, you do it in the normal way:
aryNums[0] = 10;
H l f 10 i b i i d t iti 0 i th ll d N A i
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
57/78
boolean[ ] aryBools = new boolean[ ] {false, true, false, true};
To get at the values held in your array, you type the name of the array followed by an
array position in square brackets. Like this:
System.out.println( aryNums[2] );
The above code will print out whatever value is held at array position 2 in the arraycalled aryNums. But let's get some coding practice.
Start a new project and call it anything you like. Don't forget to change the name of
the Class to something relevant.
Type the following code into your new Main method:
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
58/78
The sample program below demonstrates the translation of code from a variable-centric
approach to an array-based approach.
Creation of five (5) numeric variables to hold five (5) numeric values
A variable-centric approach
int n1;
int n2;
int n3;
int n4;
int n5;
An Array-based approach
int n[] = new int[5];
Comparing the two approaches, less code is needed when using arrays instead of variables
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
59/78
Self- Check 3.1-4Identifications
Instruction: Write your answer on the space provided in each number
________________ 1. Programming element that can hold multiple values simultaneously of the
same type
________________ 2. These are the positions where values in an array is stored
________________ 3. Index number of the first element in an array
________________ 4. Symbol that is used to enclose the number that defines the number of
elements an array will have
________________ 5. Keyword used to set the number of elements an array will have
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
60/78
Answer Key 3.1-41. Array2. Element3. 04. [ ]5. new
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
61/78
Evidence Plan
Competency
standard:
Programming NC IV
Unit of
competency:
Apply Object-Oriented Program Language Skills
Ways in which evidence will be collected:
[tick the column]
Portfolio
Demonstration
OralQ
uestioning
Writte
n
The evidence must show that the trainee
Designed and built application programs in accordance
with the systems and programming requirements and
standards*
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
62/78
TABLE OF SPECIFICATION
Objectives/Content
area/TopicsKnowledge Comprehension Application
# ofitems/
% of test
Semantics and Syntax 2 (8%) 2 (8%) 6 (24%) 10 (40%)
Elements of a Java
Programming Language
2 (8%) 4 (16%) - 6 (24%)
Control Statements in
Java2 (8%) - 4 (16%) 6 (24%)
Arrays in Java 2 (8%) - 1 (4%) 3 (12%)
TOTAL 8 (32%) 6 (24%) 11 (44%) 25 (100%)
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
63/78
Written Exam
Multiple Choice Questions
Instruction: Read the following questions and encircle the letter of your answer(s).
1. Study of the rules that govern the structure of sentences, and which determine
their relative grammaticality (LC1K1)
a. Syntax
b. Semantics
c. Grammar
d. Keyword
2. A set of strict grammar rules, symbols, and special words used to construct a
computer program. (LC1K2)
a. Syntax
b. Semantics
c. Grammar
d. Keyword
3. It is a name referenced to a value stored in the temporary memory of a computer
(LC2K1)
a. Operators
b D t t
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
64/78
8. A program element that can be used to hold multiple values of the same type
without the use of multiple variables
a. Arrays
b. Identifiers
c. Comments
d. Operators
9. Which of the following DOES NOT describe the data types used in JAVA (LC2C1)
a. Java has eight (8) built-in, non-object data types
b. Integers can hold both whole and fractional numeric values
c. Data type represent what type of data a variable can holdd. Boolean type can ONLY hold two (2) distinct values, TRUE or FALSE
10.Which of the following choices can best describe these two (2) statements? (LC2C2)
Statement A. A char data type is used for variables that will store single charactervalues
Statement B. A char data type value is always enclosed with an asterisk ( * )
a. Statement A is CORRECT while B is NOT
b. Statement B is CORRECT while A is NOTc. Both statement are CORRECT
d. None of the statements is CORRECT
11.Which of the following statements best describe the below program? Choose two (2)
(LC1C1)
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
65/78
13.Which of the following statements best describe the below program? Choose two (2)
(LC2C3)
int moo;
moo = 4;
moo++;
System.out.println(This will NOT be
printed!!!) ;
a. The program will NOT print ANYTHING
b.The program will print the given string constant
c. The program will decrement the value of variable moo by 1
d.The program will increment the value of variable moo by 1
14.Which of the following statements best describe the below program? Choose two (2)
(LC2C4)
int number;
number = input.nextInt();
System.out.println(You just entered +
number) ;
A t fl ti i t l f th k b d th i t it th
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
66/78
Simulation
Instruction: Analyze each of the given source code and identify the FINAL value of the specified
variable. Use a separate sheet to do your simulation
1. Consider the following program. What is the final value of variable foo? (LC3A1)
int foo;
foo = 15;
if ( foo % 5 == 0)
foo = foo * 2;
else
foo = foo + 2;
2. Consider the following program. What is the final value of variable goo? (LC3A2)
int goo, woo, foo;
goo = 30 ;
woo = goo / 2 * 2 + 5 ;foo = goo + woo goo + 10 ;
goo = foo ;
if ( woo > = foo )
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
67/78
5. Consider the following program. What is the final value of variable wooh? (LC4A1)
int[] pooh = {1,10,3,5,20,40,18,63,1,8};
int wooh = 5;
for (int index=0; index
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
68/78
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
69/78
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
70/78
Consider the following program. Place a check () mark on the space provided in each line
that made this program syntactically erroneous. Choose three (6)
public class SomeOtherClass {
public Static void main(string[] args){
System.out.println(THIS PROGRAM DISPLAYS A SERIES OF TEXT\n)
System.out.println(This is a series of text\n\n\n)
System.out.println(This is another series of text);
System.out.println(END);
}
}
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
71/78
Performance Test
Specific Instruction for the Candidate
Qualification Programming NC IV
Unit of Competency Apply Object-Oriented ProgramLanguage Skills
PLEASE READ CAREFULLY
Given the necessary materials and equipment, you are required tocreate/develop a program that will satisfy the requirement specified in theProblem Sheet in accordance with the accepted institutional/industrystandards. (Allotted time: 5 hrs)
1. Gather instructions and relevant materials
2. Read and analyze the problem given in the Project Sheet
3 Identify the required input process and output
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
72/78
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
73/78
Performance Criteria Checklist
CRITERIA YES NO
1. Declared/Created all the necessary variables
and/or arrays
2. Use proper operators to get the right results asdefined in the problem
3.The appropriate syntax for control statementsconstructs
4. Displayed the right results in the monitor as pertest cases
5. Included internal documentation in the programusing comments such as:
a. in-line
b. multi-linec. documentation
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
74/78
QUESTIONING TOOL
Questions to probe the candidates underpinning knowledge
Satisfactory
responseExtension/Reflection Questions Yes No
1. Why do we need to include internal documentations in ourprogram? (To make your source code easy for others to readand understand)
2. Discuss the Object-Oriented programming approach?(Identifying and Creating objects in a program to satisfy theuser requirements and making it the center of it)
2. What are the principles of Object-Oriented programming?
(Encapsulation, Polymorphism, Abstraction, Inheritance)
4.
Safety Questions
5. What will you do to avoid the corruption of program sourcecode? (Continuous saving of files, Creating Backups, Use ofRepository)
6. How will you minimize eye strain specially when working oncomputers within long period of time?
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
75/78
17. What are the best-practices in programming in creating amaintainable code? (Proper indentions, well commented codes,proper spacing, standard naming conventions are followed)
18. What is the standard naming convention for naming a Javaclass?(Java class name should begin with a capital letter. If theclass name is made-up of multiple words, all words shouldbegin with capital letters)
19.
20.
The candidates underpinningknowledge was:
Satisfactory NotSatisfactory
f T i i
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
76/78
Inventory of Training Resources
For 10 trainees
Resources for presenting instruction
Print Resources As per TR As per
Inventory
Remarks
Books 10 10
Computer Manuals 10 10
CBLM 10 10 For
reproducti
on
Non Print Resources As per TR As per
Inventory
Remarks
Installer CDs (JAVA IDEs) 1 1 Forreproducti
on
LCD P j t 1 1
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
77/78
LCD Projector 1 1
White Board 1 1
Note: In the remarks section, remarks may include for repair, for replenishment, for
reproduction, for maintenance etc.
WORKSHOP LAYOUTFOR CAREER ENTRY COURSE FOR SOFTWARE DEVELOPMENT (JAVA)
7/30/2019 Tamayo, Mark Robert a - Pts Portfolio
78/78