IT102-LecturePresentation 3
IT102-LecturePresentation 3
IT102-LecturePresentation 3
COMPUTER
PROGRAMMING 1
Software Requirements:
a. Desktop/Laptop
Download & Install DEV C++ any version
b. Mobile Device
Download & Install CPPDROID APP
CPPDROID – MOBILE APP
CLASS CODE - k4sendi
1 2 3 4 5
WEEK 1 – WEEK 3 TOPICS
• Computer Program and Computer Programming
• Introduction on Computer Programming Language
• C++ Programming Language
• Generations and Types of Programming Language
• Six Stages in Developing Computer Program
• Integrated Development Environment
WEEK 4 – WEEK 8 TOPICS
• C++ Operators
• Base elements of a C++ Program
• Structure of a C++ program
• Variables and Data Types
• Declaration and Initialization of Variable
• Basic Input and Output
WEEK 9 – WEEK 12 TOPICS
• Control Structure 1 – Selection Statement
• If Statement
• If Else If Statement
• Switch Statement
WEEK 13 – WEEK 18 TOPICS
• Control Structure II – Iteration Statement or Looping
Statement
• While Loop Statement
• Do-While Loop Statement
• For Loop Statement
• Flow Chart
• User-Defined Functions
• Arrays
• Final Requirement / Individual Computer Program
DESIRED LEARNING OUTCOMES:
Moonton
SAMPLE COMPUTER PROGRAM WRITTEN IN C++
PROGRAMMING LANGUAGE:
# include <iostream>
using namespace std;
int main ()
{
cout<<“Hello World!”;
return 0;
}
THE PROGRAMMER SHOULD TRY TO INCORPORATE
THE FOLLOWING QUALITIES INTO ANY PROGRAM.
1. Program should be easy to read and understandable.
Data names should be descriptive. Statements should be
placed in a format that is easy to read and follow.
Placing enough comments can help in making the
program easier to understand.
2. Programs should be efficient. Programs should execute
in as little time as possible.
3. Programs should be reliable. Programs should consistently
produce the correct output. All formulas and computations, as
well as all logic test and transfer control must be accurate.
4. Programs must be robust. Programs should work under all
conditions. Reliability alone is no guarantee for a successful
program. Internal logic may be correct but incorrect data item
could produce an incorrect data item could produce incorrect
output.
For example, how would a program react if a person’s age is
between 16, 29, or -21? Or instead of accepting numerical
values such as 1, 10, 5, 3 but the person give a letter A?
• MACHINE LANGUAGE
It is the only language that the computer understands.
It only consists of binary numbers 0 and 1.
The use of binary number as basis of machine language was proposed by
Dr. John Von Neumann.
Programs written in machine language is very fast in terms of program
execution and uses only minimal amount of computer resources such as
memory, hard drive and CPU but it is not easy to write, debug and test
programs written in machine language on the part of the programmer.
Machine language is widely used in 1930’s up to early 1950’s primarily
because of the small storage capacity and CPU speed of computer during
that time.
ADVANTAGE OF MACHINE LANGUAGE:
Figure 2.0
Note: High-level languages, such as Swift and C++
must be compiled into machine language before the
code is run on a computer. Since computers are digital
devices, they only recognize binary data.
• Machine Language
• Uses binary codes that consist of string of only zeroes
and ones
• These are languages that a computer can understand
and execute directly
• Low level language
SECOND GENERATION (2GL)
• Assembly Language
• Instead of zeroes and ones, it uses mnemonics or very
short words for commands
• Program written in assembly language must be converted
by an ASSEMBLER
• Low level language TASM, MASM
THIRD GENERATION (3GL)
• Dev C++
• Visual Studio Code
• Code:: Blocks
• Eclipse
• CodeLite
• Sublime Text
• NetBeans
• Qt Creator
• Brackets
• Atom
• Borland C++
• CPPDROID – Android Mobile
Device