cblm apply programming in a second language

67
SCC QA SYSTEM Computer Programming NC IV APPLYING PROGRAMMING SKILLS IN A SECOND LANGUAGE Date Developed: Document No. Issued by: Page: 1 Developed by: Revision # ____ 1 COMPETENCY BASED LEARNING MATERIAL COMPETENCY BASED LEARNING MATERIAL COMPETENCY BASED LEARNING MATERIAL COMPETENCY BASED LEARNING MATERIAL Sta. Cecilia College 108 Gen. T. de Leon, Valenzuela City Sector: ICT Qualification: Computer Programming NC IV Unit of Competency: APPLY PROGRAMMING SKILLS IN A SECOND LANGUAGE Module Title: APPLYING PROGRAMMING SKILLS IN A SECOND LANGUAGE Sta. Cecilia College 108 Gen. T. de Leon, Valenzuela City Tel. No:293-60-15 to 17 Website: www.santacecilia.edu.ph

Upload: bugmenotpls

Post on 26-Nov-2015

199 views

Category:

Documents


44 download

DESCRIPTION

SCC`

TRANSCRIPT

Page 1: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

1 Developed by:

Revision # ____

1

COMPETENCY BASED LEARNING MATERIALCOMPETENCY BASED LEARNING MATERIALCOMPETENCY BASED LEARNING MATERIALCOMPETENCY BASED LEARNING MATERIAL

Sta. Cecilia College 108 Gen. T. de Leon, Valenzuela City

Sector:

ICT Qualification:

Computer Programming NC IV Unit of Competency:

APPLY PROGRAMMING SKILLS IN A SECOND LANGUAGE

Module Title: APPLYING PROGRAMMING SKILLS IN A SECOND LANGUAGE

Sta. Cecilia College

108 Gen. T. de Leon, Valenzuela City Tel. No:293-60-15 to 17

Website: www.santacecilia.edu.ph

Page 2: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

2 Developed by:

Revision # ____

2

How to use this Competency-Based Learning Material

Welcome to the APPLY PROGRAMMING SKILLS IN A SECOND LANGUAGE. This module contains training materials and activities for you to complete.

The unit of competency "APPLY PROGRAMMING SKILLS IN A SECOND

LANGUAGE" contains the knowledge, skills and attitudes required for a Computer Programming. It is one of the core competencies at National Certificate IV (NC IV) level.

You are required to go through a series of learning activities in order to complete

each learning outcomes of the module. In each learning outcome there are Information Sheets and Resource Sheets (Reference Materials for further reading to help you better understand the required activities. Follow these activities on your own and answer the self-check at the end of each learning outcome. You may remove a blank answer sheet at the end of each module (or get one from your facilitator/trainer) to write your answers for each self-check. If you have questions, don’t hesitate to ask your facilitator for assistance.

Recognition of Prior Learning (RPL)

You may already have some or most of the knowledge and skills covered in this

learner's guide because you have: � been working for some time � already completed training in this area. If you can demonstrate to your trainer that you are competent in a particular

outcome, you don't have to do the same training again. Talk to your trainer about having them formally recognized. If you have a

qualification or Certificate of Competence from previous training, show it to you r trainer. If the skills you acquired are still current and relevant to the unit/s of competency they may become part of the evidence you can present for RPL. If you are not sure about the currency of your skills, discuss this with your trainer.

After completing this module ask your trainer to assess your competency. Result

of your assessment will be recorded in your competency profile. All the learning activities are designed for you to complete at your own pace.

Inside this learner's guide you will find the activities for you to complete and at the

back are the relevant information sheets for each learning outcome. Each learning outcome may have more than one learning activities.

At the back of this learner's guide is a Learner Diary. Use this diary to record

important dates, jobs undertaken and other workplace events that will assist you in

Page 3: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

3 Developed by:

Revision # ____

3

providing further details to your trainer or an assessor. A Record of Achievement is also provided for your trainer to complete once you complete the module.

Page 4: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

4 Developed by:

Revision # ____

4

MODULE CONTENT

Unit of Competency Apply Programming Skills in a Second Language

Module Applying Programming Skills in a Second Language

MODULE DESCRIPTOR:

Computer programming is a field that has to do with the analytical creation of source code that can be used to configure computer systems. Computer programmers may choose to function in a broad range of programming functions, or specialize in some aspect of development, support, or maintenance of computers for the home or workplace. Programmers provide the basis for the creation and ongoing function of the systems that many people rely upon for all sorts of information exchange, both business related and for entertainment purposes.

The computer programmer often focuses on the development of software that allows people to perform a broad range of functions. All online functions that are utilized in the home and office owe their origins to a programmer or group of programmers. Computer operating systems, office suites, word processing programs, and even Internet dialing software all exist because of the work of programmers.

In this course you will learn how to form a simple C program and expose to C language step by step. Additionally, you will learn more about the “fundamentals of C language”.

NOMINAL DURATION: 42 Hours LEARNING OUTCOMES Upon completion of this module you must be able to:

§ Apply basic language syntax and layout. § Code using standard algorithms § Debug code § Document Activities § Test Code

Page 5: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

5 Developed by:

Revision # ____

5

LEARNING OUTCOME #1: SELECT THE PROGRAM LOGIC DESIGN APPROACH CONTENTS:

1. Semantics and Syntax 2. Elements of Programming 3. Program Control Structure

ASSESSMENT CRITERIA

1. Observed basic language syntax rules and best practice based on the standard of specific programming language.

2. Used language data types, operators and expressions based on the standard of specific programming language.

3. Used appropriate language syntax for sequence, selection and iteration constructs based on the standard of specific programming language.

CONDITION:

Trainee must be provided with the following:

1. Workplace 2. Equipment

• Computer set with Dev C++ compiler installed 3. Learning materials

ASSESSMENT METHOD:

1. Written test 2. Practical test 3. Oral questioning

Page 6: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

6 Developed by:

Revision # ____

6

Learning Experiences Learning Outcome 1 APPLY PROGRAMMING SKILLS IN A SECOND LANGUAGE

Learning Activities Special Instructions 1. Read Semantics and Syntax (1.1-1) Perform all activities required by the module 2. Answer Self-Check for 1.1-1 Compare answers with the answer key.

You are required to get all answers correct. If not, read the information sheets again to answer all questions correctly.

3. Read Elements of programming (1.1-2) Answer Self-Check 1.1-2 & perform Job Sheet 1.1-2a, Job Sheet 1.1-2b, Job Sheet 1.1-2c, and Job Sheet 1.1-2d after reading Information Sheet 1.1-2

4. Answer Self-Check for 1.1-2 Compare answers with the answer key. You are required to get all answers correct. If not, read the information sheets again to answer all questions correctly.

5. Perform Job Sheet 1.1-2a Approach the trainer to check the work done

6. Perform Job Sheet 1.1-2b Approach the trainer to check the work done

7. Perform Job Sheet 1.1-2c Approach the trainer to check the work done

8. Perform Job Sheet 1.1-2d Approach the trainer to check the work done

9. Read Elements of programming (1.1-3) Answer Self-Check 1.1-3 & perform Job Sheet 1.1-3a, Job Sheet 1.1-3b, Job Sheet 1.1-3c, and Job Sheet 1.1-3d after reading Information Sheet 1.1-3

10. Answer Self-Check for 1.1-3 Compare answers with the answer key. You are required to get all answers correct. If not, read the information sheets again to answer all questions correctly.

11. Perform Job Sheet 1.1-3a Approach the trainer to check the work done

12. Perform Job Sheet 1.1-3a Approach the trainer to check the work done

13. Perform Job Sheet 1.1-3c Approach the trainer to check the work done

14. Perform Job Sheet 1.1-3d Approach the trainer to check the work done

Page 7: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

7 Developed by:

Revision # ____

7

INFORMATION SHEET 1.1-1 “Semantic and Syntax”

Learning Objective:

After reading this INFORMATION SHEET, YOU MUST be able to identify and understand C Language, its origin, and the skeleton of a C Program.

Please refer to Semantic and Syntax.

Semantic and Syntax

What is C Language?

C is a general-purpose computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system.

Although C was designed for implementing system software, it is also widely used for developing portable application software.

C is one of the most popular programming languages and there are very few computer architectures for which a C compiler does not exist. C has greatly influenced many other popular programming languages, most notably C++, which began as an extension to C.

History of C

The milestones in C's development as a language are listed below:

• UNIX developed c. 1969 -- DEC PDP-7 Assembly Language

• BCPL -- a user friendly OS providing powerful development tools developed from BCPL. Assembler tedious long and error prone.

• A new language ``B'' a second attempt. c. 1970.

• A totally new language ``C'' a successor to ``B''. c. 1971

• By 1973 UNIX OS almost totally written in ``C''.

Characteristics of C

The following are the C’s characteristics that define the language and also have lead to its popularity as a programming language.

• Small size

• Extensive use of function calls

Page 8: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

8 Developed by:

Revision # ____

8

• Loose typing -- unlike PASCAL

• Structured language

• Low level (BitWise) programming readily available

• Pointer implementation - extensive use of pointers for memory, array, structures and functions.

C has now become a widely used professional language for various reasons.

• It has high-level constructs.

• It can handle low-level activities.

• It produces efficient programs.

• It can be compiled on a variety of computers.

A program skeleton may be utilized as a template that reflects syntax and structures commonly used in a wide class of problems. Header File Declaration Constant Variable Declaration Function Prototype Global Variable Declaration and link list main(){ Local variable declaration Statement/body } Functions…

Header File

Declaration is used to announce the existence of the element to the compiler; this is important in many strongly-typed languages (such as C) that require variables and their types to be specified with a declaration before use.

The C programming language uses libraries as its primary method of extension. In C, a library is a set of functions contained within a single "archive" file. Each library typically has a header file, which contains the prototypes of the functions contained within the library that may be used by a program, and declarations of special data types and macro symbols used with these functions. In order for a program to use a library, it must include the library's header file, and the library must be linked with the program, which in many cases requires compiler flags (e.g., -lm, shorthand for "math library").

Page 9: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

9 Developed by:

Revision # ____

9

Some programming languages (most notably C, C++, and Objective-C) use header files. These files allow programmers to separate certain elements of a program's source code into reusable files. Header files commonly contain forward declarations of classes, subroutines, variables, and other identifiers. Programmers who wish to declare standardized identifiers in more than one source file can place such identifiers in a single header file, which other code can then include whenever the header contents are required. This is to keep the interface in the header separate from the implementation. The C standard library and C++ standard library traditionally declare their standard functions in header files.

Ex.

#include<stdio.h> #include<conio.h> #include<iostrem.h>

Constant Variable

A constant variable is an identifier whose associated value cannot typically be altered by the program during its execution (though in some cases this can be circumvented, e.g. using self-modifying code). Many programming languages make an explicit syntactic distinction between constant and variable symbols.

Although a constant's value is specified only once, a constant may be referenced many times in a program. Using a constant instead of specifying a value multiple times in the program can not only simplify code maintenance, but it can also supply a meaningful name for it and consolidate such constant bindings to a standard code location (for example, at the beginning).

Ex.

#define PI 3.1416

#define zero 0

#define one 1

Function

A function (also called procedure, subroutine, routine, method, or subprogram) is a portion of code within a larger program that performs a specific task and is relatively independent of the remaining code.

Function Prototype is a declaration of a function that omits the function body but does specify the function's name, arity, argument types and return type. While a function definition specifies what a function does, a function prototype can be thought of as specifying its interface.

Page 10: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

10 Developed by:

Revision # ____

10

Ex.

int fac(int no);

void sam(int x);

Global Variable

A global variable is a variable that is accessible in every scope (unless shadowed). Interaction mechanisms with global variables are called global environment (see also global state) mechanisms. The global environment paradigm is contrasted with the local environment paradigm, where all variables are local with no shared memory (and therefore all interactions can be reconducted to message passing).

They are usually considered bad practice precisely because of their non-locality: a global variable can potentially be modified from anywhere (unless they reside in protected memory or are otherwise rendered read-only), and any part of the program may depend on it.[1] A global variable therefore has an unlimited potential for creating mutual dependencies, and adding mutual dependencies increases complexity. See action at a distance. However, in a few cases, global variables can be suitable for use. For example, they can be used to avoid having to pass frequently-used variables continuously throughout several functions.

Global variables are used extensively to pass information between sections of code that do not share a caller/callee relation like concurrent threads and signal handlers. Languages (including C) where each file defines an implicit namespace eliminate most of the problems seen with languages with a global namespace though some problems may persist without proper encapsulation. Without proper locking (such as with a mutex), code using global variables will not be thread-safe except for read only values in protected memory.

Ex.

struct account {

int account_number;

char *first_name;

char *last_name;

float balance;

}; main() Function The main function is where a program starts execution. It is responsible for the high-level organization of the program's functionality, and typically has access to the command arguments given to the program when it was executed.

Page 11: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

11 Developed by:

Revision # ____

11

Ex. Int main(){ void main(){ Statement; or Statement; } } Local Variable

A local variable is a variable that is given local scope. Such a variable is accessible only from the function or block in which it is declared. In programming languages with only two levels of visibility, local variables are contrasted with global variables, on the other hand, many ALGOL-derived languages allow any number of levels of nested functions with private variables, functions, constants and types hidden within them.

In most languages, local variables are automatic variables stored on the call stack directly. This means that when a recursive function calls itself, local variables in each instance of the function are given separate memory address space. Hence variables of this scope can be declared, written to, and read, without any risk of side-effects to processes outside of the block in which they are declared.

Ex. Int x; Char y; Float z;

Page 12: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

12 Developed by:

Revision # ____

12

Self-Check 1.1-1

Instruction: Write the letter of the correct answer on your answer sheet.

1. A ____________ may be utilized as a template that reflects syntax and structures

commonly used in a wide class of problems.

a. Variable b. Programming c. Program skeleton d. Program

2. In C, a _____ is a set of functions contained within a single "archive" file.

a. Variable b. function prototype c. Library d. file header

3. _____________ is a portion of code within a larger program that performs a

specific task and is relatively independent of the remaining code.

a. File Header b. Function c. Variable d. Statement

4. ___________ is a variable which is accessible only from the function or block in

which it is declared.

a. local variable b. global variable c. header d. function

5. The _________ is where a program starts the execution.

a. function b. local variable c. global variable d. main function

6. ___________ is a variable that is accessible in every scope.

a. local variable b. library c. global variable d. constant variable

7. A ____________ is an identifier whose associated value cannot typically be

altered by the program during its execution.

a. global variable b. constant variable c. local variable d. function

8. __________ is an example of a basic file header that can be used in most of C

Language compilers.

a. #include<stdio.h> b.#includeme<stdnio.s> c. #include<stxvt.a>

9. Header files commonly contain forward declarations of ____________.

a. classes b. variables c. subroutines d. identifiers e. all a to d

10. __________ is a declaration of a function that omits the function body but does

specify the function's name, arity, argument types and return type.

a. function b. function prototype c. header file d. variable

Page 13: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

13 Developed by:

Revision # ____

13

Answer Key

Self-Check 1.1-1

1. D

2. C

3. B

4. A

5. D

6. C

7. B

8. A

9. E

10. B

Page 14: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

14 Developed by:

Revision # ____

14

INFORMATION SHEET 1.1-2 “Elements of Programming”

Learning Objective:

After reading this information sheet the trainee must identify, understand and apply all basic elements of programming.

Basic elements of programming:

• Variables: These will how data is represented. It can range from something very simple, such as the age of a person, to something very complex, such as a record of university students holding their names, ages, addresses, what courses they have taken, and the marks obtained.

• Loops: This will allow us to carry out execution of a group of commands a certain number of times.

• Conditionals: This will specify execution of a group of statements depending on whether or not some condition is satisfied.

• Input/Output: This will allow interaction of the program with external entities. This might be as simple as printing something out to the terminal screen, or capturing some text the user types on the keyboard, or it can involve reading and/or writing to files.

• Operators: Programming languages typically support a set of operators: operations which differ from the language's functions in calling syntax and/or argument passing mode. Common examples that differ by syntax are mathematical arithmetic operations, e.g. ">" for "greater than", with names often outside the language's set of identifiers for functions, and called with a syntax different from the language's syntax for calling functions. Common examples that differ by argument passing mode are boolean operations, e.g. a short-circuiting conjunction that only evaluates later arguments if earlier ones are not false, in a language with strict call-by-value functions.

• Subroutines and functions: This will allow you to put oft-used snippets of code into one location which can then be used over and over again.

Variables represent some segment of memory location in computer. Different values placed in the storage depend on the value type. Variable should be declared prior to storage of any values.

Page 15: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

15 Developed by:

Revision # ____

15

To write a program, we must select names for variables or identifiers to store data and to give name in a high-level language. It must satisfy the following rules:

• It must start with letters A-Z or a-z or an underscore character

• It must consist of only letters A-Z or a-z, digits 0-9 and underscore character

• It must not be a keyword

• C is case-sensitive, i.e. Value and value are not the same

• Must begin with non-digit character, i.e. 2nd chance is invalid

Reserved words:

auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned

continue for signed void default goto sizeof volatile do if static while

2 values in C

1. Numeric value – these are the number values 2. Character Value – consists of a letter or any other character surrounded by single

quote. Data type is some reserved words used to specify a value. Different storage space would be allocated depends on data type. Integral Data Type Integral data types allow only integral or whole numbers with no decimal points. Integral data type can be signed or unsigned. The signed integral data type means that the value may be either positive or negative. Generally, we do not need to specify whether a variable is signed because that is the default. The unsigned data type means the number may only be positive. Integral data type may also be either short or long, whereby it tells the computer the size of the integral number. In most of the cases, short is 16bits and long is 32bits. Floating-point Data Type

Page 16: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

16 Developed by:

Revision # ____

16

Real numbers, those numbers with decimal points, are stored a floating-point data types. For floating-point values, the computer stores mantissa and the exponent. The memory space allocated to the number is fixed, depending on the data type we declare, and is divided between mantissa and exponent. There are three different floating-point data types: float, double, and long double. These data types are differ from each other in terms of the size. Generally, a float is 32bits, a double is 64bits, and a long double is 80bits. Unlike integral data-types, floating-point data types always allow positive or negative values, and so cannot have signed or unsigned.

Basic Data Types in C:

1. Integer – int 2. Floating-point – float 3. Character – char

Declaration – is the process of reserving memory allocation on your computer.

Declaration Whenever we use a value or a variable, we will declare it and its data type. Variables must be explicitly declared before they are used. Each declaration statement in C must end with a semicolon. There are various way of declaring a variables, and the following are some examples: Syntax: Data_type Variable_name; Examples: int number; int NetPay; float real; float Rno; char letter; Arithmetic Expression In c arithmetic expression is anything that can be simplified into a single value, such as formulas. An arithmetic expression consists of values and or variables connected by arithmetic operators, which tell the computer how to combine the values.

Page 17: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

17 Developed by:

Revision # ____

17

Arithmetic Operators in precedence Level Type Associativity Operator Symbol Example I Unary Right to left Negate - -14 Plus + +4 II Multiplicative Left to right Multiply * 3*3 Divide / 10/5 Remainder % 4%2 III Additive Left to right Add + 2+3 Subtract - 10-9 IV Assignment Right to left Equals = A=10

Integer Arithmetic

C performs its arithmetic to the data-types on which it is currently operating. If the data-types in a particular operation are integer then the result will also be integer. When dividing an integer the result will be an integer – a truncated version of what a floating-point division would yield. The result of expression 3/2 is 1. Not 1.5. Since both 3 and 2 are integers, an integer calculation will be done, producing an integer result. There is not a round-off but a truncation; the result is not 2 but 1.

The remainder (or modulus) operator - % symbol, is valid only with positive integers. The result of is the remainder after dividing the value before the operator by the value after the operator. The result of an expression 5 % 3 is 2 because 5 divided by 3 is 1 with the remainder of 2. The following are more examples of remainder operation in C.

Example:

13 % 3 = 1;

1 % 5 = 1;

1 % 3 = 1;

8 % 3 = 2;

Assignment

As mentioned earlier, a variable identifies spaces in main memory. These spaces are variable because they can contain various and changeable values. Putting a value into one of these spaces is known as assignment. We usually refer to assigning a value to a variable, but technically, we are writing a value into the memory space identified by the variable.

Page 18: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

18 Developed by:

Revision # ____

18

Sometime, we must also make assignment as part of our program. For example, we wish to store the results of calculation in variable, but all of them follow this fundamental of rule:

A variable may have only one at a time

We may assign many different values to a variable, but each time we do, we write to the memory space reserved for that variable. The standard assignment operator is the equal sign (=). The following are some valid assignment statements.

Example:

X = 17;

X = (y+4)/2;

Total = GrossPay + OvertimeAmount;

Building Simple C program

Output

Output in C displays messages and values on screen. The printf() function is used to produced output. When use the printf() function to display something appropriate conversion code should be included depends on the type of values to be displayed. The size modifier enables a programmer to format the output for variable.

Example:

#include<stdio.h>

main(){

printf(“hello world!”);

}

Conversion Codes

Conversion codes in C are used to reserve space in the output for some other values to print – the value of a variable or expression, and to show how those values should be converted to characters and printed. All conversion codes begin with a % sign symbol and with a type specifier. A list of conversion codes for printf() is found in Table 1-4.

Table 1-4: Data Type Specifiers for printf()

Page 19: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

19 Developed by:

Revision # ____

19

SPECIFIER DATA TYPES SAMPLE OUTPUT

c char “%c”, ‘A’ A

d int “%d”, 123 123

i int “%i”, 345 345

f float or double “%f”, 123.45 123.450000

g float or double “%g”, 123.98 123.45

Size Modifiers

Size modifier normally appears before the type specifier. We may set the minimum width of a print field by putting a number before the type specifier, if one exists. The format of the size modifier with width and precision is as below.

%[width][precission][size]specifier

Table 1-5: Size Modifiers

Statement Output

“%4i”, 123 *123

“%04i”, 123 0123

“%8.2f”, 12.345 ***12.34

“%.2f”, 1234.567 1234.56

“%1.2f”, 1234.23 1234.23

“%5.1”, 12.3678 12.4

Output Examples:

1). printf(“HELLO WORLD!”);

2). int x = 1;

printf(“the value of x is %i”, x);

3). float y = 5.4;

printf(“the value of y is %f”, y);

Page 20: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

20 Developed by:

Revision # ____

20

Input

The input in C enables the user to enter values for e.g. data entry. The function enables programmer to prompt for data entry during program execution. Appropriate conversion codes should be specified in order to display the required value. Consider the following example:

scanf(“control_string”, [ampersand][variable]);

or

scanf(“%f”, &x);

The scanf() function takes input characters and then divide them into sets of characters to convert to appropriate data types for the locations. The ampersands (&) in front of the variable is the locations in main memory – the memory addresses of the variable.

Conversion Codes

When the scanf(); function executes, it matches the character in the input stream with the characters in the control string. A single conversion code in the control string will match input characters following the steps below:

1. Leading white space characters (spaces, tabs, and newlines) are skipped (except for type specifier C). A previous scanf() will leave a newline in the input stream.

2. Subsequent characters will be takenfor conversion and assignment up to the first character that is appropriate for the data type.

Prompts

The printf() before the scanf() is known as prompt. The printf() exist to display something on the screen to tell the person at the keyboard what to type.

Flushing the Input Stream

If the person at the keyboard is not careful to give responses that fit the control string in the scanf(), there is a chance that extra characters will be left in the input stream waiting to be converted by the next scanf().

Sample Programs:

Program 1-1:

#include<stdio.h> void main(){

Page 21: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

21 Developed by:

Revision # ____

21

int i; long l; float f; double d; printf(“Enter a values for an int and a long: ”); scanf(“%i %li”, &I, &l); printf(“Your int is %i and long is %li\n\n”, i,l); printf(“Now, enter values for float and a double: ”); scanf(“%f %f”, &f, &d); printf(“Your float is %f and double is %f\n\n”, f,d); }

Output:

Enter value for an int and a long: 524 79735

Your int is 524 and long is 79735

Now, enter values for float and a double: 12.345 12.34567890123

Your float is 12.345000 and double is 12.345 12.34567890123

Program 1-2:

#include<stdio.h> void main(){ int x, y, ans; printf(“Enter a number: “); scanf(“%i”, &x); printf(“Enter another number: ”); scanf(“%i”, &y); ans = x + y; printf(“The sum of %i + %i is: %i”, x, y, ans); }

Output

Enter a number: 5

Enter another number: 10

The sum of 5 + 10 is: 15

Page 22: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

22 Developed by:

Revision # ____

22

Relational Operators

Relational operator is a programming language construct or operator that tests or defines some kind of relation between two entities. These include numerical equality (e.g., 5 = 5) and inequalities (e.g., 4 ≥ 3). In programming languages that include a distinct boolean data type in their type system, like Java, these operators return true or false, depending on whether the conditional relationship between the two operands holds or not. In other languages such as C, relational operators return the integers 0 or 1. Relational operators are used in conditions. Condition’s outcome is either true or false.

Operator symbol Operator function/Meaning < Is less than to > Is greater than to

<= Is less than or equal to >= Is greater than or equal to

== Is equal to != Not equal to

Ex.

1. x = 45; -> the value of variable x is equal to 45 y = 40; -> the value of variable y is equal to 40 y==x -> is y equal to x? x<=y -> is x less than or equal to y? x!=y -> is x not equal to y?

Logical Operators:

Operator Symbol Operator function/Meaning || OR

&& AND ! Logical Not

RULES:

OR Operator AND Operator

True || True = True True || False = True False || True = True False || False = False

True && True = True True && False = False False && True = False False && False = False

Page 23: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

23 Developed by:

Revision # ____

23

Self-Check 1.1-2

Instruction: Matching type. Write the letter of the correct answer on your answer sheet.

1. Input 2. Less than 3. Prompts 4. Relational operator 5. Greater than or equal to 6. Arithmetic Expression 7. Declaration 8. AND Operator 9. printf() 10. Floating-point 11. Whole numbers 12. Numeric 13. Character value 14. ! 15. =

a. Anything that can be simplified into a single value, such as formulas.

b. Real numbers c. Assignment operator d. The function used to produced output e. Integer f. >= g. Consists of a letter or any other

character surrounded by single quote h. data entry i. These are the number values j. The printf() exist to display something

on the screen to tell the person at the keyboard what to type.

k. && l. < m. The process of reserving memory

allocation on your computer. n. An operator that tests or defines some

kind of relation between two entities. o. Logical not

Page 24: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

24 Developed by:

Revision # ____

24

Answer Key Self-Check 1.1-2

1. h 2. l 3. j 4. n 5. f 6. a 7. m 8. k 9. d 10. b 11. e 12. i 13. g 14. o 15. c

Page 25: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

25 Developed by:

Revision # ____

25

JOB SHEET 1.1-2a Title: Apply output in programming. Performance Objective: The trainee/student should be able to apply output in programming for 30 minutes. Supplies/Materials:

• Bond Paper

• Ball pen Equipment:

• Computer Steps/Procedures: On your pc…

1. Click start button 2. Select and click all programs. 3. Select and click bloodshed 4. Select and click Dev C++ 5. Choose and use a valid header file with appropriate syntax 6. Use the main function with appropriate syntax 7. Inside the main function, Select and use the function used to display output

(your output should be your name) w/ appropriate syntax 8. Press F5 to compile & run the program

Note: If in case there’s an error detected, debug the code.

Assessment Method: Performance Criteria Checklist

Page 26: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

26 Developed by:

Revision # ____

26

Performance Criteria Checklist Job Sheet 1.1-2a

Trainee’s Name: ___________________________________ Date: __________________

CRITERIA Yes No 1. Did the trainee found and click start button?

2. Did the trainee found and click all programs?

3. Did the trainee found and click bloodshed?

4. Did the trainee found and click Dev C++ Compiler?

5. Did the trainee choose and use a valid header file w/ appropriate syntax?

6. Did the trainee use the main function with appropriate syntax?

7. Did the trainee choose and use the appropriate output function w/ appropriate syntax?

8. Did the trainee successfully compile and run the program?

Page 27: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

27 Developed by:

Revision # ____

27

JOB SHEET 1.1-2b Title: Declare variable and display its value. Performance Objective: The trainee/student should be able to declare the required variable and display its value for 1 hour. Supplies/Materials:

• Bond Paper

• Ball pen Equipment:

• Computer Steps/Procedures: On your pc…

1. Click start button 2. Select and click all programs. 3. Select and click bloodshed 4. Select and click Dev C++ 5. Choose and use a valid header file with appropriate syntax 6. Use the main function with appropriate syntax 7. Choose a valid variable name. 8. Declare a local variable with integer data type 9. Assign a whole number to the variable declared in procedure no. 7 with an

appropriate syntax 10. Select a conversion code corresponding to the variable’s data type 11. Use the conversion code to display the value of the variable with an appropriate

syntax. 12. Press F5 to compile and run the program

Note: If in case there’s an error detected, debug the code.

Assessment Method: Performance Criteria Checklist

Page 28: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

28 Developed by:

Revision # ____

28

Performance Criteria Checklist Job Sheet 1.1-2b

Trainee’s Name: ___________________________________ Date: __________________

CRITERIA Yes No 1. Did the trainee found and click start button?

2. Did the trainee found and click all programs?

3. Did the trainee found and click bloodshed?

4. Did the trainee found and click Dev C++ Compiler?

5. Did the trainee choose and use a valid header file w/ appropriate syntax?

6. Did the trainee use the main function with appropriate syntax?

7. Did the trainee choose a valid variable name?

8. Did the trainee declare a local variable with integer data type?

9. Did the trainee assign a whole number to the variable declared in procedure no. 7 with an appropriate syntax?

10. Did the trainee select a conversion code corresponding to the variable’s data type?

11. Did the trainee use the conversion code to display the value of the variable with an appropriate syntax?

12. Did the trainee successfully compile & run the program?

Page 29: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

29 Developed by:

Revision # ____

29

JOB SHEET 1.1-2c Title: Use a variable as a storage location of input & display it Performance Objective: The trainee/student should be able to use the required variable as the storage location of the user’s input for 1 hour. Supplies/Materials:

• Bond Paper

• Ball pen Equipment:

• Computer Steps/Procedures: On your pc…

1. Click start button 2. Select and click all programs. 3. Select and click bloodshed 4. Select and click Dev C++ 5. Choose and use a valid header file with appropriate syntax 6. Use the main function with appropriate syntax 7. Choose a valid variable name. 8. Declare a local variable with a character data type 9. Use the printf() function to display “Enter a letter: ” 10. Use scanf() function to fetch user’s input w/ the appropriate string control. 11. Use printf() function to display the user’s input w/ the appropriate conversion

code. 12. Press F5 to compile and run the program

Note: If in case there’s an error detected, debug the code.

Assessment Method: Performance Criteria Checklist

Page 30: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

30 Developed by:

Revision # ____

30

Performance Criteria Checklist Job Sheet 1.1-2c

Trainee’s Name: ___________________________________ Date: __________________

CRITERIA Yes No 1. Did the trainee found and click start button?

2. Did the trainee found and click all programs?

3. Did the trainee found and click bloodshed?

4. Did the trainee found and click Dev C++ Compiler?

5. Did the trainee choose and use a valid header file w/ appropriate syntax?

6. Did the trainee use the main function with appropriate syntax?

7. Did the trainee choose a valid variable name?

8. Did the trainee declare a local variable with integer data type?

9. Did the trainee use printf() function to display “Enter a letter: ”?

10. Did the trainee use scanf() function to fetch user’s input w/ the appropriate string control?

11. Did the trainee use printf() function to display the user’s input w/ the appropriate conversion code?

12. Did the trainee successfully compile & run the program?

Page 31: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

31 Developed by:

Revision # ____

31

JOB SHEET 1.1-2d

Title: Using expression to calculate user’s input and display the result Performance Objective: The trainee/student should be able to use mathematical operator in calculating the required user’s input for 1 hour. Supplies/Materials:

• Bond Paper

• Ball pen Equipment:

• Computer Steps/Procedures: On your pc…

1. Click start button 2. Select and click all programs. 3. Select and click bloodshed 4. Select and click Dev C++ 5. Choose and use a valid header file with appropriate syntax 6. Use the main function with appropriate syntax 7. Choose three valid variable names. 8. Declare the selected variable names with an integer data type 9. Use the printf() function to display “Enter a number1 : ” 10. Use scanf() function to fetch user’s input w/ the appropriate string control to

store the input to the first variable. 11. Use the printf() function to display “Enter a number2 : ” 12. Use scanf() function to fetch user’s input w/ the appropriate string control to

store the input to the second variable. 13. Use an expression that will assign the sum of the two variable’s value into the

third variable. 14. Use printf() function to display the value of the third variable w/ the appropriate

conversion code. 15. Press F5 to compile and run the program

Note: If in case there’s an error detected, debug the code.

Assessment Method: Performance Criteria Checklist

Page 32: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

32 Developed by:

Revision # ____

32

Performance Criteria Checklist Job Sheet 1.1-2d

Trainee’s Name: _________________________________ Date: __________________

CRITERIA Yes No

1. Did the trainee found and click start button?

2. Did the trainee found and click all programs?

3. Did the trainee found and click bloodshed?

4. Did the trainee found and click Dev C++ Compiler?

5. Did the trainee choose and use a valid header file w/ appropriate syntax?

6. Did the trainee use the main function with appropriate syntax?

7. Did the trainee choose three valid variable names?

8. Did the trainee declare the selected variable names with an integer data type?

9. Did the trainee use printf() function to display “Enter a letter1: ”?

10. Did the trainee use scanf() function to fetch user’s input w/ the appropriate string control to store the input to the first variable?

11. Did the trainee use the printf() function to display “Enter a number2 : ”?

12. Did the trainee use scanf() function to fetch user’s input w/ the appropriate string control to store the input to the second variable?

13. Did the trainee use an expression that will assign the sum of the two variable’s value into the third variable?

14. Did the trainee use printf() function to display the value of the third variable w/ the appropriate conversion code

15. Press F5 to compile and run the program?

Page 33: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

33 Developed by:

Revision # ____

33

INFORMATION SHEET 1.1-3 “Program Control Structure”

Learning Objective:

1. Identify and apply the operators that can be use in creating condition. 2. Identify and apply the three control structures. 3. Apply calculation based on loops.

Structured Programming The technique of structured programming simplifies the programming process by using only three types of programming patterns, called control structures, to build programs. The Three Control Structures or program constructs:

• Sequence – The instructions are executed in a serial manner, one after another.

• Selection – It provides a decision point that enables the program to choose one between two or more pathways.

• Iteration – Repeats a set of instructions a number of times based on the condition stated.

Condition A condition enables the program to perform certain task base on the outcome of evaluation. The statements would not be in any sequence whereby some statements might be not executed. Execution is normally base on the outcome of conditions – true or false. A condition contains one or more comparisons that relate one to another. Relational and Equality Operators

< Less than > Greater than <= Less than or equal to

>= Greater than or equal to == Equal to != Not equal to

Page 34: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

34 Developed by:

Revision # ____

34

Ex. 6<10 10>2 5<=10 10>=10 0!=1 A==B Logical Operators

|| OR && AND ! Logical Not

Ex. 6<10 || 10>5 34!=10 && X==5 1. Sequence – You have encounter already this kind of program constructs from the

previous information. Example: #include<stdio.h> main(){ int number; printf(“Enter a number: ”); scanf(“%i”, &number); printf(“You entered %i”, number); } 2. Selection - under selection structure, we have two kinds of statements that we can

use:

• If & else statement Syntax:

Ø Single if – the body of if statement will be executed only if the condition’s. Syntax: if(condition){

Page 35: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

35 Developed by:

Revision # ____

35

statement/body; }

Example:

#include<stdio.h> #include<conio.h> main(){

int x; printf(“Enter number: ”); scanf(“%i”, &x); if(number>=5){ printf(“You entered a value greater than four”); } getch(); }

Ø If & else – the body of “if” will be executed if the condition’s outcome is true, if false, the body of “else” statement will be executed.

Syntax: if(condition){ body/statement; } Else{ Body/statement; }

Example:

#include<stdio.h> #include<conio.h> main(){

int x; printf(“Enter number: ”); scanf(“%i”, &x); if(number>=5){ printf(“You entered a value greater than four”); }

else{ printf(“You entered a value less than five”); } getch(); }

Page 36: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

36 Developed by:

Revision # ____

36

Ø If, else if & else – if the condition’s outcome of “if” statement is true, its body will be executed but if not it will test the condition of “else if” statement, if it is true it will be executed and if not it will execute the body of “else” statement.

Example: #include<stdio.h> #include<conio.h> main(){

int x; printf(“Enter number from 1 - 3: ”); scanf(“%i”, &x); if(number==1){ printf(“You entered one”); }

else if(number==2){ printf(“You entered two”);

} else if(number==3){

printf(“You entered three”); }

else{ printf(“Invalid Input!”); }

getch(); }

• Switch case statement Syntax:

switch(basis){ case 1: statement; break; case 2: statement; break; case n: statement: break; default: statement; break; }

Example: #include<stdio.h>

Page 37: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

37 Developed by:

Revision # ____

37

#include<conio.h> main(){

int x; printf(“Enter a number from 1 - 3: ”); scanf(“%i”, &x); switch(x){ case 1: printf(“you entered one”); break; case 2: printf(“you entered two”); break; case 3: printf(“you entered three”); break; default: printf(“invalid input”); break; } getch(); }

3. Iteration

• Pre-test Loop - while loop is a control flow statement that allows code to be executed repeatedly based on a given boolean condition. The while loop can be thought of as a repeating if statement.The while construct consists of a block of code and a condition. The condition is evaluated, and if the condition is true, the code within the block is executed. This repeats until the condition becomes false. Because while loop checks the condition before the block is executed. Syntax:

while(condition){ statement; } Example: #include<stdio.h> #include<conio.h> main(){ int x=1; while(x<=5){ printf(“%i ”,x); x=x+1; } getch(); }

• Post-test Loop - is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. He do while construct consists of a block of code and a condition. First, the code within the block is executed, and then the condition is evaluated. If the condition is true the code within the

Page 38: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

38 Developed by:

Revision # ____

38

block is executed again. This repeats until the condition becomes false. Because do while loops check the condition after the block is executed.

Syntax: do{

statement; } while(condition); Example: #include<stdio.h> #include<conio.h> main(){ int x=1; do { printf(“%i ”,x); x=x+1; } while(x<=5); getch(); }

• Counter-controlled Loop syntax – is a programming statement which allows code to be repeatedly executed. Unlike many other kinds of loops, such as the while loop, the for loop is often distinguished by an explicit loop counter or loop variable. This allows the body of the for loop (the code that is being repeatedly executed) to know about the sequencing of each iteration. For loops are also typically used when the number of iterations is known before entering the loop. For loops are shorthand way to make loops when the number of iterations is known, as a for loop can be written as a while loop. Syntax:

for(initialization;condition;counter){ statement; } Example: #include<stdio.h> #include<conio.h> main(){ int x; for(x=1;x<=5;x++) { printf(“%i ”,x); } getch(); }

Page 39: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

39 Developed by:

Revision # ____

39

Page 40: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

40 Developed by:

Revision # ____

40

Self-Check 1.1-3 Instruction: Write the letter of the correct answer on your answer sheet.

1. It provides a decision point that enables the program to choose one between two or more pathways. a. Selection b. Iteration c. Sequence d. Loop

2. It enables the program to perform certain task base on the outcome of evaluation. a. Loop b. Condition c. Sequence d. Expression

3. Repeats a set of instructions a number of times based on the condition stated. a. Sequence b. Selection c. Iteration d. Loop

4. The instructions are executed in a serial manner, one after another. a. Sequence b. Selection c. Condition d. Iteration

5. The technique of structured programming simplifies the programming process by using only three types of programming patterns called _________. a. Condition b. Control Structures c. Loop d. Database

Page 41: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

41 Developed by:

Revision # ____

41

Answer key Self-Check 1.1-3

1. A 2. B 3. C 4. A 5. B

Page 42: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

42 Developed by:

Revision # ____

42

JOB SHEET 1.1-3a Title: Applying pre-test loop in programming to display statement repeatedly. Performance Objective: The trainee/student should be able to use a pre-test loop to display a statement to the required number of times for 30 minutes. Supplies/Materials:

• Bond Paper

• Ball pen Equipment:

• Computer Steps/Procedures: On your pc…

1. Click start button 2. Select and click all programs. 3. Select and click bloodshed 4. Select and click Dev C++ 5. Choose and use a valid header file with appropriate syntax 6. Use the main function with appropriate syntax 7. Declare a valid variable with an integer data type 8. Use a relational operator to form a condition 9. Use a pretest loop to display “hello world” three times 10. Use mathematical operators to form an expression that will increment the

value of the variable every time it loops. 11. Press F5 to compile & run the program

Note: If in case there’s an error detected, debug the code.

Assessment Method: Performance Criteria Checklist

Page 43: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

43 Developed by:

Revision # ____

43

Performance Criteria Checklist Job Sheet 1.1-3a

Trainee’s Name: _________________________________ Date: __________________

CRITERIA Yes No

1. Did the trainee found and click start button?

2. Did the trainee found and click all programs?

3. Did the trainee found and click bloodshed?

4. Did the trainee found and click Dev C++ Compiler?

5. Did the trainee choose and use a valid header file w/ appropriate syntax?

6. Did the trainee use the main function with appropriate syntax?

7. Did the trainee declare three valid variables w/ appropriate data types?

8. Did the trainee relational operators to form a condition?

9. Did the trainee use a pre-test loop to display “hello world” three times

10. Did the trainee use mathematical operators to form an expression that will increment the value of the variable every time it loops?

11. Did the trainee successfully compile and run the program?

Page 44: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

44 Developed by:

Revision # ____

44

JOB SHEET 1.1-3b Title: Applying post-test loop in programming to display statement repeatedly. Performance Objective: The trainee/student should be able to use a post-test loop to display a statement to the required number of times for 30 minutes. Supplies/Materials:

• Bond Paper

• Ball pen Equipment:

• Computer Steps/Procedures: On your pc…

1. Click start button 2. Select and click all programs. 3. Select and click bloodshed 4. Select and click Dev C++ 5. Choose and use a valid header file with appropriate syntax 6. Use the main function with appropriate syntax 7. Declare a valid variable with an integer data type 8. Use a relational operator to form a condition 9. Use a post-test loop to display “hello world” three times 10. Use mathematical operators to form an expression that will increment the value

of the variable every time it loops. 11. Press F5 to compile & run the program

Note: If in case there’s an error detected, debug the code.

Assessment Method: Performance Criteria Checklist

Page 45: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

45 Developed by:

Revision # ____

45

Performance Criteria Checklist Job Sheet 1.1-3b

Trainee’s Name: _________________________________ Date: __________________

CRITERIA Yes No

1. Did the trainee found and click start button?

2. Did the trainee found and click all programs?

3. Did the trainee found and click bloodshed?

4. Did the trainee found and click Dev C++ Compiler?

5. Did the trainee choose and use a valid header file w/ appropriate syntax?

6. Did the trainee use the main function with appropriate syntax?

7. Did the trainee declare three valid variables w/ appropriate data types?

8. Did the trainee relational operators to form a condition?

9. Did the trainee use a post-test loop to display “hello world” three times

10. Did the trainee use mathematical operators to form an expression that will increment the value of the variable every time it loops?

11. Did the trainee successfully compile and run the program?

Page 46: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

46 Developed by:

Revision # ____

46

JOB SHEET 1.1-3c Title: Applying counter-controlled loop in programming to display statement repeatedly. Performance Objective: The trainee/student should be able to use a counter-controlled loop to display a statement to the required number of times for 30 minutes. Supplies/Materials:

• Bond Paper

• Ball pen Equipment:

• Computer Steps/Procedures: On your pc…

1. Click start button 2. Select and click all programs. 3. Select and click bloodshed 4. Select and click Dev C++ 5. Choose and use a valid header file with appropriate syntax 6. Use the main function with appropriate syntax 7. Declare a valid variable with an integer data type 8. Use a relational operator to form a condition 9. Use a counter-controlled loop to display “hello world” three times 10. Use mathematical operators to form an expression that will increment the value

of the variable every time it loops. 11. Press F5 to compile & run the program

Note: If in case there’s an error detected, debug the code.

Assessment Method: Performance Criteria Checklist

Page 47: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

47 Developed by:

Revision # ____

47

Performance Criteria Checklist Job Sheet 1.1-3c

Trainee’s Name: _________________________________ Date: __________________

CRITERIA Yes No

1. Did the trainee found and click start button?

2. Did the trainee found and click all programs?

3. Did the trainee found and click bloodshed?

4. Did the trainee found and click Dev C++ Compiler?

5. Did the trainee choose and use a valid header file w/ appropriate syntax?

6. Did the trainee use the main function with appropriate syntax?

7. Did the trainee declare three valid variables w/ appropriate data types?

8. Did the trainee relational operators to form a condition?

9. Did the trainee use a counter-controlled loop to display “hello world” three times

10. Did the trainee use mathematical operators to form an expression that will increment the value of the variable every time it loops?

11. Did the trainee successfully compile and run the program?

Page 48: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

48 Developed by:

Revision # ____

48

JOB SHEET 1.1-3d Title: Applying expression in calculation within the loop Performance Objective: The trainee/student should be able to use an expression to calculate the required result within the loop for 1 hour and 30 minutes. Supplies/Materials:

• Bond Paper

• Ball pen Equipment:

• Computer Steps/Procedures: On your pc…

1. Click start button 2. Select and click all programs. 3. Select and click bloodshed 4. Select and click Dev C++ 5. Choose and use a valid header file with appropriate syntax 6. Use the main function with appropriate syntax 7. Declare a valid & required variable with an integer data type 8. Use a relational operator to form a condition 9. Decide and use which loop to be used(Nested Loop) 10. Use mathematical operators to form an expression that will calculate the product

of the variable every time it loops. 11. Use printf() function w/ appropriate conversion code to display the result every

time it loops that will form a multiplication table. 12. Use any selection statement to align the output identify and create next line. 13. Press F5 to compile & run the program

Note: If in case there’s an error detected, debug the code.

Assessment Method: Performance Criteria Checklist

Page 49: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

49 Developed by:

Revision # ____

49

Performance Criteria Checklist

Job Sheet 1.1-3d

Trainee’s Name: _________________________________ Date: __________________

CRITERIA Yes No

1. Did the trainee found and click start button?

2. Did the trainee found and click all programs?

3. Did the trainee found and click bloodshed?

4. Did the trainee found and click Dev C++ Compiler?

5. Did the trainee choose and use a valid header file w/ appropriate syntax?

6. Did the trainee use the main function with appropriate syntax?

7. Did the trainee declare a valid & required variable with an integer data type?

8. Did the trainee use a relational operator to form a condition?

9. Did the trainee decide and use which loop to be used(Nested Loop)

10. Did the trainee use mathematical operators to form an expression that will calculate the product of the variable every time it loops?

11. Did the trainee use printf() function w/ appropriate conversion code to display the result every time it loops that will form a multiplication table?

14. Did the trainee use any selection statement to align the output identify and create next line.

12. Did the trainee successfully compile & run the program?

Plan

NOTE: *Critical Aspects of Competency

Prepared by: Date:

Checked by: Date:

Page 50: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

50 Developed by:

Revision # ____

50

ASSESSMENT TOOLS

Written Test

Competency Standard: Programming NC IV

Unit of Competency: Apply Programming Skills as a Second Language

Type of Assessment Tool: Written

Name:____________________________ Date:_____________________________

Title: Basic language syntax rules and best practices are observed. Test I: Multiple Choice Direction: Write the letter of the correct answer on your answer sheet.

1. A ____________ may be utilized as a template that reflects syntax and structures

commonly used in a wide class of problems.

a. Variable b. Programming c. Program skeleton d. Program

2. In C, a _____ is a set of functions contained within a single "archive" file.

a. Variable b. function prototype c. Library d. file header

3. _____________ is a portion of code within a larger program that performs a

specific task and is relatively independent of the remaining code.

b. File Header b. Function c. Variable d. Statement

4. ___________ is a variable which is accessible only from the function or block in

which it is declared.

c. local variable b. global variable c. header d. function

5. The _________ is where a program starts the execution.

a. function b. local variable c. global variable d. main function

6. ___________ is a variable that is accessible in every scope.

a. local variable b. library c. global variable d. constant variable

Page 51: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

51 Developed by:

Revision # ____

51

7. A ____________ is an identifier whose associated value cannot typically be

altered by the program during its execution.

a. global variable b. constant variable c. local variable d. function

8. __________ is an example of a basic file header that can be used in most of C

Language compilers.

a. #include<stdio.h> b.#includeme<stdnio.s> c. #include<stxvt.a>

9. Header files commonly contain forward declarations of ____________.

a. classes b. variables c. subroutines d. identifiers e. all a to d

10. __________ is a declaration of a function that omits the function body but does

specify the function's name, arity, argument types and return type.

a. function b. function prototype c. header file d. variable

Test II: Matching Type Instruction: Matching type. Write the letter of the correct answer on your answer sheet.

1. Input 2. Less than 3. Prompts 4. Relational operator 5. Greater than or equal to 6. Arithmetic Expression 7. Declaration 8. AND Operator 9. printf() 10. Floating-point 11. Whole numbers 12. Numeric 13. Character value 14. ! 15. =

a. Anything that can be simplified into a single value, such as formulas.

b. Real numbers c. Assignment operator d. The function used to produced output e. Integer f. >= g. Consists of a letter or any other

character surrounded by single quote h. data entry i. These are the number values j. The printf() exist to display something

on the screen to tell the person at the keyboard what to type.

k. && l. < m. The process of reserving memory

allocation on your computer. n. An operator that tests or defines some

kind of relation between two entities. o. Logical not

Page 52: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

52 Developed by:

Revision # ____

52

Answer Key Test I: Multiple Choice 1. D

2. C

3. B

4. A

5. D

6. C

7. B

8. A

9. E

10. B

Test II: Matching Type

1. h 2. l 3. j 4. n 5. f 6. a 7. m 8. k 9. d 10. b 11. e 12. i 13. g 14. o 15. c

Page 53: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

53 Developed by:

Revision # ____

53

Observation & Questioning

Competency Standard: Programming NC IV

Unit of Competency: Apply Programming Skills as a Second Language

Type of Assessment Tool: Observation & Questioning

Name:____________________________ Date:_____________________________ Title: Language data-types, operators and expressions are used.

Performance Objective: The trainee/student should be able to use mathematical operator in calculating the required user’s input for 1 hour.

Supplies/Materials:

• Bond Paper

• Ball pen Equipment:

• Computer Steps/Procedures:

On your pc… 1. Click start button 2. Select and click all programs. 3. Select and click bloodshed 4. Select and click Dev C++ 5. Choose and use a valid header file with appropriate syntax 6. Use the main function with appropriate syntax 7. Choose three valid variable names. 8. Declare the selected variable names with an integer data type 9. Use the printf() function to display “Enter a number1 : ” 10. Use scanf() function to fetch user’s input w/ the appropriate string control to

store the input to the first variable. 11. Use the printf() function to display “Enter a number2 : ” 12. Use scanf() function to fetch user’s input w/ the appropriate string control to

store the input to the second variable. 13. Use an expression that will assign the sum of the two variable’s value into the

third variable. 14. Use printf() function to display the value of the third variable w/ the appropriate

conversion code. 15. Press F5 to compile and run the program

Page 54: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

54 Developed by:

Revision # ____

54

Note: If in case there’s an error detected, debug the code.

Assessment Method:

Performance Criteria Checklist

Performance Criteria Checklist

Trainee’s Name: _______________________________ Date: __________________

CRITERIA Yes No

1. Did the trainee found and click start button?

2. Did the trainee found and click all programs?

3. Did the trainee found and click bloodshed?

4. Did the trainee found and click Dev C++ Compiler?

5. Did the trainee choose and use a valid header file w/ appropriate syntax?

6. Did the trainee use the main function with appropriate syntax?

7. Did the trainee choose three valid variable names?

8. Did the trainee declare the selected variable names with an integer data type?

9. Did the trainee use printf() function to display “Enter a letter1: ”? 10. Did the trainee use scanf() function to fetch user’s input w/ the

appropriate string control to store the input to the first variable?

11. Did the trainee use the printf() function to display “Enter a number2 : ”?

12. Did the trainee use scanf() function to fetch user’s input w/ the appropriate string control to store the input to the second variable?

13. Did the trainee use an expression that will assign the sum of the two variable’s value into the third variable?

14. Did the trainee use printf() function to display the value of the third variable w/ the appropriate conversion code

15. Press F5 to compile and run the program?

Page 55: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

55 Developed by:

Revision # ____

55

Observation & Questioning

Competency Standard: Programming NC IV

Unit of Competency: Apply Programming Skills as a Second Language

Type of Assessment Tool: Observation & Questioning

Name:____________________________ Date:_____________________________

Title: The appropriate language syntax for sequence, selection and iteration constructs is used.

Performance Objective: The trainee/student should be able to apply the three control structures and use an expression to calculate the required result within the loop for 1 hour and 30 minutes.

Supplies/Materials:

• Bond Paper

• Ball pen Equipment:

• Computer Steps/Procedures:

On your pc… 1. Click start button 2. Select and click all programs. 3. Select and click bloodshed 4. Select and click Dev C++ 5. Choose and use a valid header file with appropriate syntax 6. Use the main function with appropriate syntax 7. Declare a valid & required variable with an integer data type 8. Use a relational operator to form a condition 9. Decide and use which loop to be used(Nested Loop) 10. Use mathematical operators to form an expression that will calculate the product of

the variable every time it loops. 11. Use printf() function w/ appropriate conversion code to display the result every time

it loops that will form a multiplication table. 12. Use any selection statement to align the output identify and create next line. 13. Press F5 to compile & run the program

Note: If in case there’s an error detected, debug the code.

Page 56: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

56 Developed by:

Revision # ____

56

Assessment Method:

Performance Criteria Checklist

Performance Criteria Checklist

Trainee’s Name: _______________________________ Date: __________________

CRITERIA Yes No

1. Did the trainee found and click start button?

2. Did the trainee found and click all programs?

3. Did the trainee found and click bloodshed? 4. Did the trainee found and click Dev C++ Compiler?

5. Did the trainee choose and use a valid header file w/ appropriate syntax?

6. Did the trainee use the main function with appropriate syntax?

7. Did the trainee declare a valid & required variable with an integer data type?

8. Did the trainee use a relational operator to form a condition?

9. Did the trainee decide and use which loop to be used(Nested Loop)

10. Did the trainee use mathematical operators to form an expression that will calculate the product of the variable every time it loops?

11. Did the trainee use printf() function w/ appropriate conversion code to display the result every time it loops that will form a multiplication table?

12. Did the trainee use any selection statement to align the output identify and create next line.

13. Did the trainee successfully compile & run the program?

Page 57: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

57 Developed by:

Revision # ____

57

Demonstration & Questioning

Competency Standard: Programming NC IV

Unit of Competency: Apply Programming Skills as a Second Language

Type of Assessment Tool: Demonstration & Questioning

Name:____________________________ Date:_____________________________

Title: Application program are designed and built in accordance with systems and programming requirements and standards

Performance Objective: The trainee/student should be able to apply the three control structures and use an expression to calculate the required result within the loop for 1 hour and 30 minutes.

Supplies/Materials:

• Bond Paper

• Ball pen Equipment:

• Computer Steps/Procedures:

On your pc… 1. Click start button 2. Select and click all programs. 3. Select and click bloodshed 4. Select and click Dev C++ 5. Choose and use a valid header file with appropriate syntax 6. Use the main function with appropriate syntax 7. Declare a valid & required variable with an integer data type 8. Use a relational operator to form a condition 9. Decide and use which loop to be used(Nested Loop) 10. Use mathematical operators to form an expression that will calculate the product

of the variable every time it loops. 11. Use printf() function w/ appropriate conversion code to display the result every

time it loops that will form a multiplication table. 12. Use any selection statement to align the output identify and create next line. 13. Press F5 to compile & run the program

Note: If in case there’s an error detected, debug the code.

Page 58: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

58 Developed by:

Revision # ____

58

Assessment Method:

Performance Criteria Checklist

Performance Criteria Checklist

Trainee’s Name: _______________________________ Date: __________________

CRITERIA Yes No

1. Did the trainee found and click start button?

2. Did the trainee found and click all programs?

3. Did the trainee found and click bloodshed? 4. Did the trainee found and click Dev C++ Compiler?

5. Did the trainee choose and use a valid header file w/ appropriate syntax?

6. Did the trainee use the main function with appropriate syntax?

7. Did the trainee declare a valid & required variable with an integer data type?

8. Did the trainee use a relational operator to form a condition?

9. Did the trainee decide and use which loop to be used(Nested Loop)

10. Did the trainee use mathematical operators to form an expression that will calculate the product of the variable every time it loops?

11. Did the trainee use printf() function w/ appropriate conversion code to display the result every time it loops that will form a multiplication table?

12. Did the trainee use any selection statement to align the output identify and create next line.

13. Did the trainee successfully compile & run the program?

Page 59: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

59 Developed by:

Revision # ____

59

Demonstration & Questioning

Competency Standard: Programming NC IV

Unit of Competency: Apply Programming Skills as a Second Language

Type of Assessment Tool: Demonstration & Questioning

Name:____________________________ Date:_____________________________

Title: Application or programs developed are tested and meets systems and/or user specification

Performance Objective: The trainee/student should be able to apply the three control structures and use an expression to calculate the required result within the loop for 1 hour.

Supplies/Materials:

• Bond Paper

• Ball pen Equipment:

• Computer Steps/Procedures:

On your pc… 1. Click start button 2. Select and click all programs. 3. Select and click bloodshed 4. Select and click Dev C++ 5. Open you source code 6. Run your program 7. Test your program for errors 8. Explain the source codes

Assessment Method:

Performance Criteria Checklist

Page 60: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

60 Developed by:

Revision # ____

60

Performance Criteria Checklist

Trainee’s Name: _______________________________ Date: __________________

CRITERIA Yes No 1. Did the trainee found and click start button?

2. Did the trainee found and click all programs?

3. Did the trainee found and click bloodshed?

4. Did the trainee found and click Dev C++ Compiler?

5. Did the trainee open his/her own source code?

6. Did the trainee successfully run his/her program?

7. Did the trainee tests the program for errors?

8. Did the trainee explain the source code?

Page 61: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

61 Developed by:

Revision # ____

61

Inventory of Tools

Competency Print-

materials Non-print Materials

Tools Equipments

BASIC

1. Utilize specialized communication skills 1.1. Apply communication

strategies CBLM Presentation ball pen

Coupon Bond

Computer & Projector

1.2. Represent the organization in internal and external forums

CBLM Presentation ball pen Coupon

Bond

Computer & Projector

2. Develop teams and individuals 2.1. Determine development

needs CBLM Presentation ball pen

Coupon Bond

Computer & Projector

2.2. Foster individual and organizational growth

CBLM Presentation ball pen Coupon

Bond

Computer & Projector

2.3. Monitor and evaluate workplace learning

CBLM Presentation ball pen Coupon

Bond

Computer & Projector

2.4. Development team commitment and cooperation

CBLM Presentation ball pen Coupon

Bond

Computer & Projector

3. Apply problem solving techniques in the workplace 3.1. Analyze the problem CBLM Presentation ball pen

Coupon Bond

Computer & Projector

3.2. Identify individual and organizational growth

CBLM Presentation ball pen Coupon

Bond

Computer & Projector

3.3. Determine possible solution

CBLM Presentation ball pen Coupon

Bond

Computer & Projector

3.4. Prepare communication or documentation report

CBLM Presentation ball pen Coupon

Bond

Computer & Projector

Page 62: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

62 Developed by:

Revision # ____

62

3.5. Present recommendation to appropriate personnel

CBLM Presentation ball pen Coupon

Bond

Computer & Projector

3.6. Implement solution CBLM Presentation ball pen Coupon

Bond

Computer & Projector

4. Collect, analyze and organize information 4.1. Study information

requirements CBLM Presentation ball pen

Coupon Bond

Computer & Projector

4.2. Process data CBLM Presentation ball pen Coupon

Bond

Computer & Projector

4.3. Analyse, interpret and organize information gathered

CBLM Presentation ball pen Coupon

Bond

Computer & Projector

4.4. Present findings/recommendations

CBLM Presentation ball pen Coupon

Bond

Computer & Projector

5. Plan and organize work 5.1. Set work objectives CBLM Presentation Ballpen

Coupon Bond

Computer & Projector

5.2. Plan and schedule work objectives

CBLM Presentation ball pen Coupon

Bond

Computer & Projector

5.3. Implement and monitor plans/activities

CBLM Presentation Ballpen Coupon

Bond

Computer & Projector

5.4. Review and evaluate work plans and activities

CBLM Presentation ball pen Coupon

Bond

Computer & Projector

6. Promote environmental protection 6.1. Study guidelines for

environmental concerns CBLM Presentation ball pen

Coupon Bond

Computer & Projector

COMMON

1. Apply Quality Standards 1.1. Assess quality of

received materials CBLM Presentation ball pen

Coupon Bond

Computer & Projector

1.2. Assess own work CBLM Presentation ball pen Coupon

Bond

Computer & Projector

1.3. Engage in quality CBLM Presentation ball pen Computer &

Page 63: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

63 Developed by:

Revision # ____

63

standards Coupon Bond

Projector

2. Operate a Personal Computer 2.1. Start and shut down the

computer CBLM Presentation ball pen

Coupon Bond

Computer & Projector

2.2. Arrange and customize desktop display/window settings

CBLM Presentation Ball pen Coupon

Bond

Computer & Projector

2.3. Work with files and folders(directories)

CBLM Presentation ball pen Coupon

Bond

Computer & Projector

2.4. Work with user application programs

CBLM Presentation ball pen Coupon

Bond

Computer & Projector

2.5. Print information CBLM Presentation ball pen Coupon

Bond

Computer & Projector

CORE

1. Design Program logic 1.1. Select the program logic

design approach CBLM Presentation Ballpen

Coupon Bond

Computer & ProjectorGB

1.2. Document the program logic or design

CBLM Presentation Ballpen Coupon

Bond

Computer & Projector

1.3. Validate the design CBLM Presentation Ballpen Coupon

Bond

Computer & Projector

2. Apply program development approach 2.1. Determine and select

appropriate program development approach

CBLM Presentation Ballpen Coupon

Bond

Computer & Projector

2.2. Apply the selected development approach

CBLM Presentation Ballpen Coupon

Bond

Computer & Projector

3. Apply object-oriented program language skills 3.1. Apply basic language

syntax and layout CBLM Presentation Ballpen

Coupon Bond

Computer & Projector

3.2. Apply basic OOP principles in the target language

CBLM Presentation Ballpen Coupon

Bond

Computer & Projector

3.3. Debug code CBLM Presentation Ballpen Coupon

Computer & Projector

Page 64: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

64 Developed by:

Revision # ____

64

Bond 3.4. Document activities CBLM Presentation Ballpen

Coupon Bond

Computer & Projector

3.5. Test Code CBLM Presentation Ballpen Coupon

Bond

Computer & Projector

4. Apply programming skills in a second language 4.1. Apply basic language

syntax and layout CBLM Presentation Ballpen

Coupon Bond

Computer & Projector

4.2. Code using standard algorithm

CBLM Presentation Ballpen Coupon

Bond

Computer & Projector

4.3. Debug code CBLM Presentation Ballpen Coupon

Bond

Computer & Projector

4.4. Document activities CBLM Presentation Ballpen Coupon

Bond

Computer & Projector

4.5. Test Code CBLM Presentation Ballpen Coupon

Bond

Computer & Projector

Page 65: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

65 Developed by:

Revision # ____

65

Terms and Definition Program (Computer Program) - is a sequence of instructions written to perform a specified task for a computer. Programming language – is a language used to write instructions that can be translated into machine language and then executed by a computer.

Programming: The process of writing or creating a program.

Value - is a sequence of bits that is interpreted according to some data type.

Numeric Values - is a mathematical object used in counting and measuring. Character - is a unit of information that roughly corresponds to a grapheme, grapheme-like unit, or symbol, such as in an alphabet or syllabify in the written form of a natural language. Variable - is a facility for storing data Data-types - a classification identifying one of various types of data. Operator - refers to any function or keyword whose name is a symbol or series of symbols. Declaration – the process of defining a method, classes, types and others on the system. Assignment – putting a value into the variable. Expressions – is anything that can be simplified into a single value, such as formula. Precedence – is an expression or string of symbols intended to represent a numerical value must follow commonly accepted and unambiguous rules. Conversion Codes: Are used to reserve space in the output for some other values to be print.

Syntax – is the proper arrangement of instruction. A programming language's surface form and it describes the possible combinations of symbols that form a syntactically correct program.

Page 66: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

66 Developed by:

Revision # ____

66

Compiler: A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code). The most common reason for wanting to transform source code is to create an executable program.

Source Code: source code is text written in a computer programming language.

Programmer: Is someone who writes computer software/programs. It can refer to a specialist in one area of computer programming or to a generalist who writes code for many kinds of software.

Output – means display messages and values on screen and/or the processed input.

Conversion codes – are symbols used to reserve space in the output for some other values to be displayed.

Input – is the data/values entered by the user into the computer/program.

Program Construct - is a syntactically allowable part of a program that may be formed from one or more lexical tokens in accordance with the rules of a programming language. Condition: Enables the computer program to perform certain task base on the outcome of evaluation.

Sequence – A program construct that Executes the statements in a serial manner, one after another.

Selection – A program construct that enables the program to choose one between two or more pathways based on the condition/basis stated.

Iteration – A program construct that repeats a set of instruction a number of times based on the condition stated. Function – enables program segments to be grouped as one module. Array – is a consecutive storage location in computer’s memory that store’s similar type of data. Is a collection of data with the same data type. Database - consists of an organized collection of data for one or more multiple uses. Debugging - is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware, thus making it behave as expected.

Page 67: CBLM Apply Programming in a Second Language

SCC

QA

SYSTEM

Computer Programming

NC IV

APPLYING PROGRAMMING

SKILLS IN A SECOND

LANGUAGE

Date Developed: Document No.

Issued by: Page:

67 Developed by:

Revision # ____

67

Binary File - s a computer file which may contain any type of data, encoded in binary form for computer storage and processing purposes; for example, computer document files containing formatted text. Reserved words – are words with a special meaning and/or with a special function. String: Is an array of alphanumeric characters.