0% found this document useful (0 votes)
5 views

Week-3-Lecture-by-Doc-EVE

The document provides an overview of programming languages, their fields, and the basic elements of programming. It outlines the Programming Development Life Cycle (PDLC) and the generations of programming languages, detailing their characteristics and examples. Additionally, it explains the levels of programming languages, including machine, assembly, and high-level languages, along with their translation processes.

Uploaded by

fernandofriahmae
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Week-3-Lecture-by-Doc-EVE

The document provides an overview of programming languages, their fields, and the basic elements of programming. It outlines the Programming Development Life Cycle (PDLC) and the generations of programming languages, detailing their characteristics and examples. Additionally, it explains the levels of programming languages, including machine, assembly, and high-level languages, along with their translation processes.

Uploaded by

fernandofriahmae
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

PROGRAMMING LOGIC AND DESIGN | Dr. EVELYN A.

RODRIGUEZ

WEEK 3 – INTRODUCTION TO PROGRAMMING


Prepared by: Dr. EVELYN A. RODRIGUEZ

PROGRAMMING LANGUAGE
A programming language is a computer language that programmers use to develop
applications, scripts or other set of instructions for a computer to execute. Below is a listing of several
different programming languages and scripting languages.
ALGOL C dBase Java Prolog XML
Assembly C# FORTRAN JavaScript SQL
BASIC C++ FoxPro Perl Visual Basic
BCPL COBOL HTML PHP Visual FoxPro

FIELDS OF PROGRAMMING
1. Applications / Program Development
It involves programs you work on a daily basis. If you are interested in writing your own
programs you should consider the following languages: C, C++, C#, Java, Visual Basic

2. Artificial Intelligence Development


Artificial intelligence or related fields could involve anything from creating the character
interactions in computer games, portions of programs that make the decisions in programs, or any
other related programs. If you are interested to write your own AI you should consider the following
languages: C, C++, C#

3. Database Development
Database developers create and maintain databases. If you are interested in creating your
own database or maintaining other databases you should consider the following languages: dBase,
FoxPro, MySQL, Visual FoxPro

4. Game Development
It involves the development of computer games or other entertainment software. In writing
your own games, consider the following languages: C, C++, C#, DarkBasic, Java

5. Computer Drivers or other Hardware Interface Development


Computer drivers and programming hardware interface support is a necessity for computers
to operate with the hardware, without it your computer wouldn’t work. In writing your own drivers or
software interfaces, you should consider Assembly and C.

6. Internet and Web Page Development


The Internet and web page development is the essence of the Internet, without developers we
would have no Internet. If you are interested in creating your own web pages, developing Internet
applications, or Internet related tasks, you should consider the following languages: HDML, HTML,
Java, JavaScript, Perl, PHP, XML

BASIC ELEMENTS OF PROGRAMMING


1. Input – Getting data and commands into the computer
2. Output – Getting the results out of the computer
3. Arithmetic – Performing mathematical calculation on your data
4. Conditional – Testing to see if a condition is true or false
5. Looping – Cycling through a set of instructions until some condition is met.

TURBO C/C++ PROGRAMMING 1


PROGRAMMING LOGIC AND DESIGN | Dr. EVELYN A. RODRIGUEZ

CONTROL STRUCTURES IN PROGRAMMING


In programming, a control structure determines the order in which statements are executed.
The 3 basic types of control structures are:
1. Sequential – Sequential execution of code statements (one line after another).
2. Selection – Used for decisions and branching – choosing between 2 or more alternative
paths.
Examples: if, if-else, switch
3. Repetition – Used for looping – repeating a piece of code multiple times in a row.
Examples: while, do-while, for

PROGRAMMING DEVELOPMENT LIFE CYCLE (PDLC)


The formal creation process of programming is known as the PDLC, the programming
development life cycle. There are seven steps to this: define, outline, develop, test, code, run, and
document and maintain.

1. Define – To decide what real-world problem is to be solved and how a program can do this.
2. Outline – Breaking a large problem up into smaller ones. Deciding what the steps of the program
are. A tool that is available to help the programmer during this step is a flowchart, which is a visual
diagram of the flow of the program.
3. Develop the Algorithm – An algorithm is the steps that a programmer will write that will become a
program. It is written in a form of structured language called pseudocode. Pseudocode is a language
non-specific; it could be used by programmer to help him or her write the actual program using any
programming language. Each step of algorithm will be directly translated into a line of code when it is
time to write the program using programming language. Algorithms are written in sequential order of
action and are language non-specific.
To help write the algorithm, programmers use flowchart. This is the pictorial image of the
steps of a program.
4. Test – to make sure that the algorithm of your program does what it should. An error in a program is
also known as a bug and the process of finding bugs is known as debugging. Desk checking is
looking at the lines of code one by one to see if they have been written correctly and the logic is
correct. Desk checking is also called tracing. The walkthrough is just when a group of people do a
desk check.
5. Code – It is actually using any specific programming language to write lines of program. These lines
of code are also called listing, and are also known as source code. The program that you run is
called object code.
6. Run/Execute – To run the program on a computer. When you run a C++ program, first the program
(C++) will compile the source code. This translates the human code into machine code. When you run
the program, you will do further testing. There are two main types of errors, syntax and logic errors.
Syntax errors are problems with grammar, spelling, or punctuation. Logic errors are errors that
make the program’s results incorrect. There is another type of error called a run time error, which
C++ can find. One type of run time error is called linking error. If in your program, you referred to
wanting to use some code in a library and that library was not in your computer, you would get a run
time message stating that the program could not run.
7. Document and Maintain – To document mean to put together all of the materials that have been
generated throughout the PDLC process. All the flowcharts, messages, algorithms, lines of code, and
the user manuals are part of the documentation. Internal documentation is used by other
programmers to help them know why you did something a certain way or to tell them how you wrote a
program.
To maintain is to make sure that the program keeps running as it should and to do any
needed updating or fixing. Maintenance is the longest phase of the PDLC.

TURBO C/C++ PROGRAMMING 2


PROGRAMMING LOGIC AND DESIGN | Dr. EVELYN A. RODRIGUEZ

GENERATIONS OF PROGRAMMING LANGUAGES


The five generations of programming languages are:
1. First Generation Languages:
These are low-level languages like machine language.
2. Second Generation Languages:
These are low-level assembly languages used in kernels and hardware drives.
3. Third Generation Languages:
These are high-level languages like C, C++, Java, Visual Basic and JavaScript.
4. Fourth Generation Languages:
These are languages that consist of statements that are similar to statements in the human
language. These are used mainly in database programming and scripting. Examples of these
languages include Perl, Python, Ruby, SQL, MatLab (MatrixLaboratory).
5. Fifth Generation Languages:
These are the programming languages that have visual tools to develop a program. Examples
of fifth generation language include Mercury, OPS5, and Prolog.

The first two generations are called low level languages. The next three generations are called
high level languages.

LEVELS OF PROGRAMMING LANGUAGES

1. MACHINE LANGUAGES: It is the language that the computer can directly understand and
execute. Each unique computer has a unique machine language. A machine language
program is made up of a series of binary patterns (e.g., 01011100) which represent simple
operations that can be accomplished by the computer (e.g., add two operands, move data to a
memory location). Machine language programs are executable, meaning that they can be ran
directly. Programming in machine language requires memorization of the binary codes and can
be difficult for the human programmer.

2. ASSEMBLY LANGUAGES: They represent an effort to make programming easier for the
human. The machine language instructions are replaced with simple pneumonic
abbreviations (e.g., ADD, MOV). Thus, assembly languages are unique to a specific
computer (machine). Prior to execution, an assembly language program requires translation to
machine language. This translation is accomplished by a computer program known as an
Assembler. Assemblers are written for each unique machine language.

TURBO C/C++ PROGRAMMING 3


PROGRAMMING LOGIC AND DESIGN | Dr. EVELYN A. RODRIGUEZ

3. HIGH LEVEL LANGUAGES: High-level languages, like C, C++, JAVA etc., are more English-
like and, therefore, make it easier for programmers to “think” in the programming language.
High-level languages also require translation to machine language before execution. This
translation is accomplished by either a compiler or an interpreter.

Compilers translate the entire source code program before execution. (E.g.: C++,
Java)
Interpreters translate source code programs one line at a time. (E.g.: Python)
Interpreters are more interactive than compilers.

TURBO C/C++ PROGRAMMING 4

You might also like