You are on page 1of 27

College of Information and

Table of Contents Communications Technology


Table of Contents

A COMPILATION
OF LECTURES &
ACTIVITIES

Catanduanes State University College of Information and Communications Technolo

Catanduanes State University College of Information and Communications Technology


Table of Contents

Table of Contents

Table of Contents........................................................................................................................ 1
Disclaimer ..................................................................................................................................... 1
CHAPTER 1: Introduciton to Computer Programming ...................................................... 1
Module Overview .................................................................................................................... 2
Learning Outcomes ................................................................................................................ 2
Pre-Test ..................................................................................................................................... 3
Module Map .............................................................................................................................. 5
Definition of Key Terms / Unlocking of Difficulties ........................................................ 6
Introduction .............................................................................................................................. 7
LESSON 1: History of Computer Programming .............................................................. 8
Synthesis ................................................................................................................................ 10
Supplementary Learning Resources................................................................................ 11
Self-Assessment Questions 1-1 ............................................ Error! Bookmark not defined.
LESSON 2: Generations of Computer Programming Languages .............................
12 2.1. First Generation Language (Machine language) ........................................... 12
2.2. Second Generation Language (Assembly Language) ................................. 12 2.3.
Third Generation Languages (High-Level Languages) ............................... 13 2.4.
Fourth Generation Language (Very High-level Languages)....................... 13 2.5.
Fifth Generation Language (Artificial Intelligence Language) ................... 14
Supplementary Learning Resources................................................................................ 14
Self-Assessment Questions 2-1 ............................................ Error! Bookmark not defined.
LESSON 3: Programming Concepts ................................................................................ 15
3.1. Source code ........................................................................................................... 15
3.2. Compiler ................................................................................................................. 15
3.3. Data type ................................................................................................................. 15
3.4. Variable ................................................................................................................... 15
3.5. Constant ................................................................................................................. 15
3.6. Conditional ............................................................................................................. 15
3.7. Array ........................................................................................................................ 16

Catanduanes State University College of Information and Communications Technology


Table of Contents

3.8. Loop ......................................................................................................................... 16


3.9. Function .................................................................................................................. 16
3.10. Class ...................................................................................................................... 16
Supplementary Learning Resources................................................................................ 16

1
Self-Assessment Questions 3-1 ........................................................................................ 18
LESSON 4: Program Development Life Cycle ............................................................... 17
4.1 Problem Definition................................................................................................. 17
4.2 Problem Analysis................................................................................................... 18
4.3 Algorithm Development ....................................................................................... 18
4.4 Coding & Documentation .................................................................................... 18
4.5 Testing & Debugging ............................................................................................ 18
4.6 Maintenance ............................................................................................................ 18
Supplementary Learning Resources................................................................................ 18
Self-Assessment Questions 4-1 ............................................ Error! Bookmark not defined.
Post-Test ................................................................................................................................. 19
Assignment ................................................................................ Error! Bookmark not defined.
CHAPTER 2: PROGRAM DESIGN TOOLS .............................. Error! Bookmark not
defined.
Module Overview ...................................................................... Error! Bookmark not defined.
Learning Outcomes .................................................................. Error! Bookmark not defined.
Pre-Test ....................................................................................... Error! Bookmark not defined.
Module Map ................................................................................ Error! Bookmark not defined.
Definition of Key Terms / Unlocking of Difficulties .......... Error! Bookmark not defined.
Introduction ................................................................................ Error! Bookmark not defined.
LESSON 1: Algorithm .............................................................. Error! Bookmark not defined.
1.1. What is an algorithm? ............................................. Error! Bookmark not defined.
1.2. Characteristics of algorithm .................................. Error! Bookmark not defined.
1.3. Advantages of algorithm ........................................ Error! Bookmark not defined.
1.4. How to write algorithms .......................................... Error! Bookmark not defined.
Supplementary Learning Resources.................................... Error! Bookmark not defined.
Test Yourself 2-1-1 .................................................................... Error! Bookmark not defined.
LESSON 2: Pseudocode.......................................................... Error! Bookmark not defined.

Catanduanes State University College of Information and Communications Technology


Table of Contents

2.1 What is a pseudocode? ........................................... Error! Bookmark not defined.


2.2 Advantages of pseudocode ................................... Error! Bookmark not defined.
2.3 How to write pseudocode ....................................... Error! Bookmark not defined.
Supplementary Learning Resources.................................... Error! Bookmark not defined.
Test Yourself 2-2-1 .................................................................... Error! Bookmark not defined.
LESSON 3: Flowchart ............................................................. Error! Bookmark not defined.
3.1 What is a flowchart? ................................................ Error! Bookmark not defined.
3.2 Standard Symbols Used in Constructing Flowchart ....... Error! Bookmark
not defined.

2
3.3 Advantages of Flowchart ........................................ Error! Bookmark not defined.
3.4 Limitations of Using a Flowchart .......................... Error! Bookmark not defined.
3.5 Rules for Flowchart .................................................. Error! Bookmark not defined.
3.6 General Rules for flowcharting ............................. Error! Bookmark not defined.
3.7 Basic Control Structures ........................................ Error! Bookmark not defined.
Supplementary Learning Resources.................................... Error! Bookmark not defined.
Test Yourself 2-2-1 .................................................................... Error! Bookmark not defined.
Learning Activity 2-1 ................................................................ Error! Bookmark not defined.
Synthesis .................................................................................... Error! Bookmark not defined.
Post-Test ..................................................................................... Error! Bookmark not defined.
Assignment ................................................................................ Error! Bookmark not defined.
CHAPTER 3: INTRODUCTION TO JAVA PROGRAMMING .. Error! Bookmark not
defined.
Module Overview ...................................................................... Error! Bookmark not defined.
Learning Outcomes .................................................................. Error! Bookmark not defined.
Module Map ................................................................................ Error! Bookmark not defined.
Pre-Test ....................................................................................... Error! Bookmark not defined.
Introduction ................................................................................ Error! Bookmark not defined.
LESSON 1: The Java Programming Language .................. Error! Bookmark not
defined.

Catanduanes State University College of Information and Communications Technology


Table of Contents

What is Java?............................................................................. Error! Bookmark not defined.


Why Use Java? .......................................................................... Error! Bookmark not defined.
Supplementary Learning Resources.................................... Error! Bookmark not defined.
Test Yourself 3-1 ....................................................................... Error! Bookmark not defined.
LESSON 2: The History of Java ............................................. Error! Bookmark not defined.
2.1 Versions of Java Programming .............................. Error! Bookmark not defined.
Supplementary Learning Resources.................................... Error! Bookmark not defined.
Test Yourself 3-2 ....................................................................... Error! Bookmark not defined.
LESSON 3: The Java Technology ......................................... Error! Bookmark not defined.
3.1 Java Virtual Machine ................................................. Error! Bookmark not defined.
3.2 Java Runtime Environment ..................................... Error! Bookmark not defined.
3.3 Java Development Kit (JDK) ................................... Error! Bookmark not defined.
Supplementary Learning Resources.................................... Error! Bookmark not defined.
Test Yourself 3-3 ....................................................................... Error! Bookmark not defined.
LESSON 4: The Java Platforms ............................................. Error! Bookmark not defined.
Supplementary Learning Resources.................................... Error! Bookmark not defined.
Test Yourself 3-4 ....................................................................... Error! Bookmark not defined.
LESSON 5: Java Features ....................................................... Error! Bookmark not defined.

3
Supplementary Learning Resources.................................... Error! Bookmark not defined.
Test Yourself 3-5 ....................................................................... Error! Bookmark not defined.
LESSON 6: Applications of Java ........................................... Error! Bookmark not defined.
Supplementary Learning Resources.................................... Error! Bookmark not defined.
LESSON 7: Java Terminologies ............................................ Error! Bookmark not defined.
Supplementary Learning Resources.................................... Error! Bookmark not defined.
Test Yourself 3-7 ....................................................................... Error! Bookmark not defined.
8.1 Text Editor and Console ......................................... Error! Bookmark not defined.
8.2 Graphical User Interface Environment (Eclipse-Window Builder) ....... Error!
Bookmark not defined.
Synthesis .................................................................................... Error! Bookmark not defined.
Supplementary Learning Resources.................................... Error! Bookmark not defined.
Test Yourself 3-8 ....................................................................... Error! Bookmark not defined.
Post-Test ..................................................................................... Error! Bookmark not defined.
Assignment ................................................................................ Error! Bookmark not defined.

Catanduanes State University College of Information and Communications Technology


Table of Contents

References.................................................................................. Error! Bookmark not defined.

Catanduanes State University College of Information and Communications Technology


Disclaimer

Disclaimer

This learning material is used in compliance with the flexible teaching-learning approach
espoused by CHED in response to the pandemic that has globally affected educational institutions.
Authors and publishers of the contents are well acknowledged. As such, the college and its faculty
do not claim ownership of all sourced information. This learning material will solely be used for
instructional purposes not for commercialization.

College of Information and Communications Technology

Catanduanes State University College of Information and Communications Technology


1

1
Catanduanes State University College of Information and Communications Technology
MODULE 1: Introduciton to Computer Programming

Chapter 1
Introduction
to
Computer
Programming

2
Catanduanes State University College of Information and Communications Technology
Module Overview

This module provides lecture on the introduction to computer programming. It covers the
lessons on programming concepts, generation of programming languages, and program
development life cycle.

Learning Outcomes

By successfully completing this module, you will be able to:

1. Summarize the history of programming languages.


2. State the principles of computer programming.
3. Compare the generations of programming languages.
4. Apply the steps in the program planning and development.

3
Catanduanes State University College of Information and Communications Technology
Pre-Test

I. Identification. Select the best answer from the choices below. Write your answer for
each item on the space provided before the number.

Machine Language Object Programming Language


Object-Oriented Prog. Lang. Java Programming
Assembly Language Artificial Intelligence High-Level Prog. Lang.
C++ Program Low-Level Prog. Lang.
Ada Lovelace Grace Hopper Class

_____________ 1. It is the process of developing and implementing various sets of instructions


to enable a computer to do a certain task.
_____________ 2. A programming language originally developed by James Gosling.
_____________ 3. It is a set of rules that provides a way of telling a computer what operations
to perform.
_____________ 4. Problem Defib
_____________ 5. This programming language make it simple to program applications in
windows by focusing on objects and events.
_____________ 6. This language is used mainly in 5 th generation language.
_____________ 7. In this generation, symbolic operation codes replaced the binary operation
codes.
_____________ 8. It is the language that is understood by computers.
_____________ 9. A programming language that provides statements that are closer to the
way the humans solve problems than assembly language.
_____________ 10. She is the first woman computer programmer.

II. True or False. Write TRUE if the statement is correct, otherwise write FALSE.

_____________ 1. Artificial Intelligence requires high standard of maintenance.


_____________ 2. Formerly, computers were more expensive than programmers.
_____________ 3. Java applications are compiled to bytecode that cannot be interpreted on
any java virtual machine regardless of computer architecture.
_____________ 4. In assembly language, instruction is not translated into machine language
instruction.
_____________ 5. Syntax is the process of writing instructions that get executed by
computers.
_____________ 6. In developing a program, it is not necessary to follow sequence of steps.
_____________ 7. Programming concepts vary in every programming languages.
_____________ 8. Software developers create software with the help of powerful tools called
programming languages.
_____________ 9. The machine language also referred to as the native language of the
computer system.
_____________ 10. The first computer programming language was created in 1883.

III. Enumeration.

Give examples of Programming Languages

1. ______________________ 4. ____________________
2. ______________________ 5. ____________________
3. ______________________

Give examples of Object-Oriented Programming Languages

4
Catanduanes State University College of Information and Communications Technology
6. ______________________ 8. ____________________
7. ______________________ 9. ____________________

Give the 5 Generations of Programming Languages

10. ______________________ 13. ____________________


11. ______________________ 14. ____________________
12. _____________________

Give the 6 steps in Program Development Life Cycle

15. _____________________ 18. ____________________


16. _____________________ 19. ____________________
17. _____________________ 20. ____________________

5
Catanduanes State University College of Information and Communications Technology
Module Map

summarize the
history of
programming
languages.

Design, implement, test, and


State the principles debug a program, based on a
given specification, that uses
of computer
each of the following
programming fundamental programming
Introduction to
Computer components: (1) primitive CC102
Compare the Programming data types, (2} basic
computation, (3) simple I/0,
generations of
(4) conditional and iterative
programming
structures, (5) definition of
languages functions and parameter
passing, and (6) recursion

Apply the steps in


the program plannin g
and development.

6
Catanduanes State University College of Information and Communications Technology
Definition of Key Terms / Unlocking of Difficulties

Computer Program. Series of instructions written to perform specified task on a computer.

Programming Language. The programmer uses this tool to write or code programs.

Programmer. A person who writes, develops or debugs a computer program.

7
Catanduanes State University College of Information and Communications Technology
Introduction

Do you know what a programming is? Have you seen a computer program?

The term programming means to create (or develop) software, which is also called a
program. In basic terms, software contains the instructions that tell a computer—or a
computerized device—what to do.

Software is all around you, even in devices that you might not think would need it. Of
course, you expect to find and use software on a personal computer, but software also plays a
role in running airplanes, cars, cell phones, and even toasters. On a personal computer, you
use word processors to write documents, Web browsers to explore the Internet, and e-mail
programs to send and receive messages. These programs are all examples of software.
Software developers create software with the help of powerful tools called programming
languages.

You will gain understanding on how to create programs by using a programming


language. There are many programming languages, some of which are decades old. Each
language was invented for a specific purpose—to build on the strengths of a previous
language, for example, or to give the programmer a new and unique set of tools. Knowing that
there are so many programming languages available, it would be natural for you to wonder
which one is best. But, in truth, there is no “best” language. Each one has its own strengths
and weaknesses. Experienced programmers know that one language might work well in some
situations, whereas a different language may be more appropriate in other situations. For this
reason, seasoned programmers try to master as many different programming languages as
they can, giving them access to a huge collection of software-development tools.

If you learn to program using one language, you should find it is easier for you to learn
other programming languages. The key is to learn how to solve problems using a
programming approach.

LESSON 1: History of Computer


Programming

The first computer programming language was created in 1883, when Ada Lovelace
worked with Charles Babbage on his very early mechanical computer, the Analytical Engine.
While Babbage was concerned with simply computing numbers, Lovelace saw that the
numbers the computer worked with could represent something other than just amounts of
things. She wrote an algorithm for the Analytical Engine that was the first of its kind. Because of
her contribution, Lovelace is credited with creating the first computer programming language.
As different needs have arisen and new devices have been created, many more languages
have followed.

1883: Algorithm for the Analytical Engine: Created by Ada Lovelace for Charles
Babbage’s Analytical Engine to compute Bernoulli numbers, it’s considered to be the first
computer programming language.

1949: Assembly Language: First widely used in the Electronic Delay Storage
Automatic Calculator, assembly language is a type of low-level computer programming
language that simplifies the language of machine code, the specific instructions needed to tell
the computer what to do.

1952: Autocode: Autocode was a generic term for a family of early computer
programming languages. The first was developed by Alick Glennie for the Mark 1 computer at
8
Catanduanes State University College of Information and Communications Technology
the University of Manchester in the U.K. Some consider autocode to be the first compiled
computer programming language, meaning that it can be translated directly into machine code
using a program called a compiler.

1957: Fortran: A computer programming language created by John Backus for


complicated scientific, mathematical, and statistical work, Fortran stands for
FormulaTranslation. It is the one of the oldest computer programming languages still used
today.

1958: Algol: Created by a committee for scientific use, Algol stands for Algorithmic
Language. Algol served as a starting point in the development of languages such as Pascal, C,
C++, and Java.

1959: COBOL: Created by Dr. Grace Murray Hopper as a computer programming


language that could run on all brands and types of computers, COBOL stands for COmmon
Business Oriented Language. It is used in ATMs, credit card processing,telephone systems,
hospital and government computers, automotive systems, andtraffic signals. In the movie The
Terminator, pieces of COBOL source code were used in theTerminator’s vision display.

1959: LISP: Created by John McCarthy of MIT, LISP is still in use. It stands for LISt
Processing language. It was originally created for artificial intelligence research but today can
be used in situations where Ruby or Python are used.

1964: BASIC: Developed by John G. Kemeny and Thomas E. Kurtz at Dartmouth


College so that students who did not have a strong technical or mathematical understanding
could still use computers, it stands for Beginner’s All-purpose Symbolic Instruction Code. A
modified version of BASIC was written by Bill Gates and Paul Allen. This was to become the
first Microsoft product.

1970: Pascal: Developed by Niklaus Wirth, Pascal was named in honor of the French
mathematician, physicist, and philosopher Blaise Pascal. It is easy to learn and was originally
created as a tool for teaching computer programming. Pascal was the main language used for
software development in Apple’s early years.

1972: Smalltalk: Developed by Alan Kay, Adele Goldberg, and Dan Ingalls at Xerox
Palo Alto Research Center, Smalltalk allowed computer programmers to modify code on the fly
and also introduced other aspects now present in common computer programming languages
including Python, Java, and Ruby.

1972: C: Developed by Dennis Ritchie at Bell Labs, C is considered by many to be the


first high-level language. A high-level computer programming language is closer to human
language and more removed from the machine code. C was created so that an operating
system called Unix could be used on many different types of computers. It has influenced many
other languages, including Ruby, C#, Go, Java, JavaScript, Perl, PHP, and Python.

1972: SQL: SQL was developed by Donald D. Chamberlin and Raymond F. Boyce at
IBM. SQL stands for Structured Query Language. It is used for viewing and changing
information that is stored in databases. SQL uses command sentences called queries to add,
remove, or view data.

1978: MATLAB: Developed by Cleve Moler. MATLAB stands for Matrix Laboratory. It is
one of the best computer programming languages for writing mathematical programs and is
mainly used in mathematics, research, and education. It can also be used to create two- and
three-dimensional graphics.

1983: Objective-C: Created by Brad Cox and Tom Love, Objective-C is the main
computer programming language used when writing software for macOS and iOS, Apple’s
operating systems.

1983: C++: C++ is an extension of the C language and was developed by Bjarne
Stroustrup. It is one of the most widely used languages in the world. C++ is used in game
9
Catanduanes State University College of Information and Communications Technology
engines and high-performance software like Adobe Photoshop. Most packaged software is still
written in C++.

1987: Perl: Perl was originally developed by Larry Wall in 1987 as a scripting language
designed for text editing. Its purpose was to make report processing easier. It is now widely
used for many purposes, including Linux system administration, Web development, and
network programming.

1990: Haskell: Named after Haskell Brooks Curry, an American logician and
mathematician. Haskell is called a purely functional computer programming language, which
basically means that it is mostly mathematical. It is used by many industries, especially those
that deal with complicated calculations, records, and number-crunching.

1991: Python: Designed by Guido Van Rossum, Python is easier to read and requires
fewer lines of code than many other computer programming languages. It was named after the
British comedy group Monty Python. Popular sites like Instagram use frameworks that are
written in Python.

1991: Visual Basic: Developed by Microsoft, Visual Basic allows programmers to


choose and change pre-selected chunks of code in a drag-and-drop fashion through a
graphical user interface (GUI).

1993: R: Developed by Ross Ihaka and Robert Gentleman at the University of


Auckland, New Zealand, R is named after the first names of the first two authors. It is mostly
used by statisticians and those performing different types of data analysis.

1995: Java: Originally called Oak, Java was developed by Sun Microsystems. It was
intended for cable boxes and hand-held devices but was later enhanced so it could be used to
deliver information on the World Wide Web. Java is everywhere, from computers to
smartphones to parking meters. Three billion devices run Java!

1995: PHP: Created by Rasmus Lerdorf, PHP is used mostly for Web development and
is usually run on Web servers. It originally stood for Personal Home Page, as it was used by
Lerdorf to manage his own online information. PHP is now widely used to build websites and
blogs. WordPress, a popular website creation tool, is written using PHP.

1995: Ruby: Ruby was created by Yukihiro “Matz” Matsumoto, who combined parts of
his favorite languages to form a new general-purpose computer programming language that
can perform many programming tasks. It is popular in Web application development. Ruby
code executes more slowly, but it allows for computer programmers to quickly put together and
run a program.

1995: JavaScript: Created in just 10 days by Brendan Eich, this language is mostly
used to enhance many Web browser interactions. Almost every major website uses Javascript.

2000: C#: Developed by Microsoft with the goal of combining the computing ability of
C++ with the simplicity of Visual Basic, C# is based on C++ and is similar to Java in many
aspects. It is used in almost all Microsoft products and is primarily used for developing desktop
applications.

2003: Scala: Created by Martin Odersky. Scala is a computer programming language


that combines functional programming, which is mathematical, with object-oriented
programming, which is organized around data that controls access to code. Its compatibility
with Java makes it helpful in Android development.

2003: Groovy: Developed by James Strachan and Bob McWhirter, Groovy is derived
from Java and improves the productivity of developers because it is easy to learn and concise.

2009: Go: Go was developed by Google to address problems that can occur in large
software systems. Since computer and technology use is much different today than it was when
languages such as C++, Java, and Python were introduced and put to use, problems arose
10
Catanduanes State University College of Information and Communications Technology
when huge computer systems became common. Go was intended to improve the working
environment for programmers so they could write, read, and maintain large software systems
more efficiently.

2014: Swift: Developed by Apple as a replacement for C, C++, and Objective-C, Swift
is supposed to be easier to use and allows less room for mistakes. It is versatile and can be
used for desktop and mobile apps and cloud services.

Most computer programming languages were inspired by or built upon concepts from
previous computer programming languages. Today, while older languages still serve as a
strong foundation for new ones, newer computer programming languages make programmers’
work simpler. Businesses rely heavily on programs to meet all of their data, transaction, and
customer service needs. Science and medicine need accurate and complex programs for their
research. Mobile applications must be updated to meet consumer demands. And all these new
and growing needs ensure that computer programming languages, both old and new, will
remain an important part of modern life.

Synthesis
Computer programming is defined as telling a computer what to do through a special set
of instructions which are then interpreted by the computer to perform some task(s). These
instructions can be specified in one or more programming languages including Java, C, C++
and a lot more.
A computer goes through a set of steps whose purpose is to achieve something. These
steps are instructed to the computer by computer programs. Essentialy, computer programming
is the process by which these programs are designed and implemented.
The advantages to learning computer programming include gaining new skills, being
able to tell the computer what to do, and becoming better acquainted with computers. Computer
programming is a challenging and rewarding discipline. Whatever you plan on building, the road
ahead of you is an interesting one.

Supplementary Learning Resources


1. LearningLad. (2017). Introduction to Computer Programming | What is it? Programming
Language Types [YouTube Video]. In YouTube. https://www.youtube.com/watch?
v=ifo76VyrBYo&t=7s
2. freeCodeCamp.org. (2020). Introduction to Programming and Computer Science - Full
Course [YouTube Video]. In YouTube. https://www.youtube.com/watch?v=zOjov-2OZ0E
3. Jeremy, A. (2013). Computer Programming 1 - Introduction to computer programming (For
the absolute beginner). In YouTube. https://www.youtube.com/watch?v=gT4CemTAjAg
4. Double D. (2019b). 5 Basic Concepts of Programming [YouTube Video]. In YouTube.
https://www.youtube.com/watch?v=quW5dAGpXiU&t=322s

11
Catanduanes State University College of Information and Communications Technology
LESSON 2: Generations of Computer
Programming Languages

Programming languages have been developed over the year in a phased manner. Each
phase of developed has made the programming language more user-friendly, easier to use and
more powerful. Each phase of improved made in the development of the programming languages
can be referred to as a generation. The programming language in terms of their performance
reliability and robustness can be grouped into five different generations:

2.1. First Generation Language (Machine language)

The first-generation programming language is also called low-level programming


language because they were used to program the computer system at a very low level of
abstraction. i.e. at the machine level. The machine language also referred to as the native
language of the computer system is the first-generation programming language. In the
machine language, a programmer only deals with a binary number. It is difficult to understand,
write as well as modify. Because how do you understand when an instruction is supposed to
be written like “00011100101010”. The whole process of writing, updating codes are also time
consuming since it requires a lot of calculations to write anything in the form of binary. The
first-generation programming language doesn’t require any translator or converter to run the
codes by a machine. So, the codes are very fast and efficient. But for each type of processor,
it requires its own type of language. This is the reason that the first generation of
programming languages are also known as the machine dependent language.

12
Catanduanes State University College of Information and Communications Technology
Advantages of First-Generation Language

• They are translation free and can be directly executed by the computers.
• The programs written in these languages are executed very speedily and efficiently by
the CPU of the computer system.
• The programs written in these languages utilize the memory in an efficient manner
because it is possible to keep track of each bit of data.

2.2. Second Generation Language (Assembly Language)

The second-generation programming language also belongs to the category of


lowlevel- programming language. The second-generation language comprises assembly
languages that use the concept of mnemonics for the writing program. In the assembly
language, symbolic names are used to represent the opcode and the operand part of the
instruction. The instructions are written in the form of mnemonics to simplify the program. To
execute these instructions, all mnemonics are converted into binary form with the help of a
translator known as the assembler. The program written using mnemonics is called source
program and the translated binary form of the source program is called object program.
American Standard Code for Information Interchange (ASCII) is commonly used to
translate the source program into the object program. The second generations of
programming languages are still used to write programs for electronic controls using
microprocessors like computerized copier machine, computerized telephone billing etc.

Advantages of Second-Generation Language

• It is easy to develop understand and modify the program developed in these


languages are compared to those developed in the first-generation programming
language.
• The programs written in these languages are less prone to errors and therefore can be
maintained with a great case.

2.3. Third Generation Languages (High-Level Languages)

The third-generation programming languages were designed to overcome the


various limitations of the first- and second-generation programming languages. The
languages of the third and later generation are considered as a high-level language
because they enable the programmer to concentrate only on the logic of the programs
without considering the internal architecture of the computer system.

In the third generations of programming languages, English language with symbols


and digits were used to write the programs. The third generation programming languages
are also known as high-level languages. FORTRAN, BASIC, COBOL, PASCAL, PROLOG,
C, C++ etc are the commonly used high-level programming languages.

In order to execute the instructions or programs written in third generation language,


the source program is to be translated to the binary form. This is done by a compiler or
interpreter. The compiler is also used to translate source program to object program and the
interpreter is also used for translation, but it translates the program line by line.

For example, C language uses a compiler to translate the programs written in C


language to machine understandable language. To execute the source program, it is also
necessary to create an executable program to execute those instructions by linking the
input and output devices in the program. The program which performs this job done is
called linker. The linker links the input-output devices and generates an executable program
from an object program.

13
Catanduanes State University College of Information and Communications Technology
Advantages of Third Generation Programming Language

• It is easy to develop, learn and understand the program.


• As the program written in these languages are less prone to errors, they
are easy to maintain.
• The program written in these languages can be developed in very less
time as compared to the first- and second-generation language.

2.4. Fourth Generation Language (Very High-level Languages)

The languages of this generation were considered as very high-level programming


languages required a lot of time and effort that affected the productivity of a programmer. The
fourth-generation programming languages were designed and developed to reduce the time,
cost and effort needed to develop different types of software applications.

The fourth generations of programming languages basically referred to the software


packages which are mostly written in one of the high-level languages like C, C++, JAVA,
Python for any specific application. Here, a user can perform a task without writing any
programs. The user only has to enter the command which calls the specific program that is
available in the package.
Oracle, SQL, MS Word, PageMaker, AutoCAD etc are some of the most commonly
used fourth-generation packages. These programs are specially developed for performing
some specific task and they are also referred as Application Software. You can also make use
of coding tests to hire developers of the all the generations of programming languages.

Advantages of Fourth Generation Languages

• These programming languages allow the efficient use of data by implementing the
various database.
• They require less time, cost and effort to develop different types of software
applications.
• The program developed in these languages are highly portable as compared to the
programs developed in the languages of other generation.

2.5. Fifth Generation Language (Artificial Intelligence Language)

The programming languages of this generation mainly focus on constraint


programming. The major fields in which the fifth-generation programming language are
employed are Artificial Intelligence and Artificial Neural Networks

Advantages of Fifth Generation Languages

• These languages can be used to query the database in a fast and efficient manner.
• In this generation of language, the user can communicate with the computer system
in a simple and an easy manner.

Supplementary Learning Resources

1. Techno Creats. (2017). Generations of programming languages [YouTube Video]. In


YouTube. https://www.youtube.com/watch?v=NFcYll6uJCo
2. Simply Coding. (2019). Generation of Computer [YouTube Video]. In YouTube.
https://www.youtube.com/watch?v=NqgpZ_v4Ne8

14
Catanduanes State University College of Information and Communications Technology
LESSON 3: Programming Concepts

The concepts discussed here are essential knowledge to anyone who wants to become
skilled in computer programming. While some are not universal, these concepts are present in
most computer programming languages and/or are a fundamental part of the programming
process.

3.1. Source code

The actual text used to write the instructions for a computer program. This text is then
translated into something meaningful the computer can understand.

3.2. Compiler

A software tool that translates source code into data that the computer can
understand. Specifically, a compiler is used to turn source code into object code. The object
code is then passed through a program called a linker which turns it into an executable
program.
3.3. Data type

The classification of pieces of information in a program. The amount of different data types
varies between languages. Typically, there are data types for integers (whole numbers),
floating-point numbers (numbers with a decimal part), and single characters. To distinguish
between different data types, a computer uses special internal codes.

3.4. Variable

A container which represents a value in a program. Variables can store different types
of data including numeric values, single characters, and text strings. The value of a variable
can change all throughout a program.

3.5. Constant

The same thing as a variable with one major difference - the value of a constant does
not change, while the value of a variable can change all throughout a program.

3.6. Conditional

A set of code that will execute only if a certain condition is true. Conditionals are used
to test expressions and perform certain operations accordingly. For example, you could test a
number input by the user and if it is too high print the message "The number entered is to
high" and the program exits. Thanks to conditionals, a program can work differently every
time it runs.

15
Catanduanes State University College of Information and Communications Technology
3.7. Array

A special type of variable used in many programming and web languages including
PHP, Javascript, and Java that contains a list of related values. For example, a colors array
would contain a list of colors.

3.8. Loop

A segment of code that executes repeatedly based on a certain condition. Loops are
used to perform tasks repeatedly a certain amount of times. For example, if you needed to print
the numbers 1 to 10. You can use a loop for this task instead of manually printing all the
numbers.

3.9. Function

A set of code used to carry out specific tasks. A function can take parameters
which will affect its output as well as return values. Functions prevent unnecessary
redundancy because you can use them as much as needed instead of retyping some
code over and over. For example, if you need to multiply two numbers, instead of
doing the calculation manually every time, you can supply the data to a function
through some parameters which will do it for you.

3.10. Class

A template for a real-world object to be used in a program. For example, a programmer


can create a car class which represents a car. This class can contain the properties of a car
(color, model, year, etc.) and functions that specify what the car does (drive, reverse, stop,
etc.). Classes are used in object-oriented programming.

Supplementary Learning Resources


1. Finch, E. (2016). Intro to Programming: Concepts [YouTube Video]. In YouTube.
https://www.youtube.com/watch?v=xbFoZhC_wdY
2. Double D. (2019a). 5 Basic Concepts of Programming [YouTube Video]. In YouTube.
https://www.youtube.com/watch?v=quW5dAGpXiU

LESSON 4 : Program Development Life Cycle

When we want to develop a program using any programming language, we follow a


sequence of steps. These steps are called phases in program development. The program
development life cycle is a set of steps or phases that are used to develop a program in any
programming language. Generally, program development life cycle contains 6 phases, they
are as follows….

• Problem Definition
16
Catanduanes State University College of Information and Communications Technology
• Problem Analysis
• Algorithm Development
• Coding & Documentation
• Testing & Debugging
• Maintenance

Figure 1. Program Development Life Cycle Model

4.1 Problem Definition

In this phase, we define the problem statement and we decide the boundaries
of the problem. In this phase we need to understand the problem statement, what is
our requirement, what should be the output of the problem solution. These are
defined in this first phase of the program development life cycle.

4.2 Problem Analysis

In phase 2, we determine the requirements like variables, functions, etc. to


solve the problem. That means we gather the required resources to solve the
problem defined in the problem definition phase. We also determine the bounds of
the solution.
4.3 Algorithm Development

During this phase, we develop a step by step procedure to solve the problem
using the specification given in the previous phase. This phase is very important for
program development. That means we write the solution in step by step statements.

4.4 Coding & Documentation

This phase uses a programming language to write or implement actual


programming instructions for the steps defined in the previous phase. In this phase,

17
Catanduanes State University College of Information and Communications Technology
we construct actual program. That means we write the program to solve the given
problem using programming languages like C, C++, Java etc.,

4.5 Testing & Debugging

During this phase, we check whether the code written in previous step is
solving the specified problem or not. That means we test the program whether it is
solving the problem for various input data values or not. We also test that whether it
is providing the desired output or not.

4.6 Maintenance

During this phase, the program is actively used by the users. If any
enhancements found in this phase, all the phases are to be repeated to make the
enhancements. That means in this phase, the solution (program) is used by the end
user. If the user encounters any problem or wants any enhancement, then we need
to repeat all the phases from the starting, so that the encountered problem is solved,
or enhancement is added.

Supplementary Learning Resources

1. Alyssa joy salazar. (2014). Program Development Life Cycle [YouTube Video]. In
YouTube. https://www.youtube.com/watch?v=YV6ykfG1nQY
2. Destin Learning. (2019). What Are The Steps of the Software Development
Lifecycle? [YouTube Video]. In YouTube. https://www.youtube.com/watch?
v=gNmrGZSGK1k
3. FuseupTech. (2020). FuseupTech [YouTube Video]. In YouTube.
https://www.youtube.com/watch?v=N8q1r99CUs4

Post-Test

I. Identification. Select the best answer from the choices below. Write your answer for
each item on the space provided before the number.

Machine Language Object Programming Language Object-Oriented Prog. Lang.


Java Programming
Assembly Language Artificial Intelligence High-Level Prog. Lang.
C++ Program Low-Level Prog. Lang.
Ada Lovelace Grace Hopper Class

_____________ 1. It is the process of developing and implementing various sets of


instructions to enable a computer to do a certain task.
_____________ 2. A programming language originally developed by James Gosling.
_____________ 3. It is a set of rules that provides a way of telling a computer what
operations to perform.
_____________ 4. A/an _________ is software, bundle of related variables and methods.
_____________ 5. This programming language make it simple to program applications in
windows by focusing on objects and events.
_____________ 6. This language is used mainly in 5th generation language.

18
Catanduanes State University College of Information and Communications Technology
_____________ 7. In this generation, symbolic operation codes replaced the binary
operation codes.
_____________ 8. It is the language that is understood by computers.
_____________ 9. A programming language that provides statements that are closer to the
way the humans solve problems than assembly language.
_____________ 10. She is the first woman computer programmer.

II. True or False. Write TRUE if the statement is correct, otherwise write FALSE.

_____________ 1. Artificial Intelligence requires high standard of maintenance.


_____________ 2. Formerly, computers were more expensive than programmers.
_____________ 3. Java applications are compiled to bytecode that cannot be interpreted on
any java virtual machine regardless of computer architecture.
_____________ 4. In assembly language, instruction is not translated into machine language
instruction.
_____________ 5. Syntax is the process of writing instructions that get executed by
computers.
_____________ 6. In developing a program, it is not necessary to follow sequence of steps.
_____________ 7. Programming concepts vary in every programming languages.
_____________ 8. Software developers create software with the help of powerful tools called
programming languages.
_____________ 9. The machine language also referred to as the native language of the
computer system.
_____________ 10. The first computer programming language was created in 1883.

III. Enumeration.

Give examples of Programming Languages


1. ______________________ 4. ____________________
2. ______________________ 5. ____________________
3. ______________________

Give examples of Object-Oriented Programming Languages


6. ______________________ 8. ____________________
7. ______________________ 9. ____________________

Give the 5 Generations of Programming Languages


10. ______________________ 13. ____________________
11. ______________________ 14. ____________________
12. _____________________

Give the 6 steps in Program Development Life Cycle


15. _____________________ 18. ____________________
16. _____________________ 19. ____________________
17. _____________________ 20. ____________________

19
Catanduanes State University College of Information and Communications Technology

You might also like