Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

1

What is Programming?
What is a program?
A computer program is a set of instructions telling a computer what to do
a series of separate commands one after the another
each instruction telling a computer to do something small but very specific
What is a program (continued)
Example of a program:
Photoshop
Video
robots
What is a program (continued)
Example of a program:
Photoshop
Video
robots
What is programming (continued)
Example of basic instructions you give to the computer:
add two number together 200 + 300 = 500
Display a letter on the screen
What is programming (continued)
statementsare just like sentences in english, words , numbers, and punctuation to express one
thought but it depends on what programming languages you will use
BasicLet Balance = 500
AppleScriptset balance to 500
Javabalance = 500;
CobolMOVE 500 TO BALANCE
What is programming (continued)
Understandingthe rules of each language is understanding the syntax of a programming language

Programmingis writing your statements in the right order using the right syntax
Aspects of Programming
Programming is controlling:
computer does exactly what you tell it to do.
Programming is teaching:
computer can only learntodo new things if you tell it how.
Programming problem solving:
always trying to makecomputerdo something useful i.e., finding an optimal travel route.

Aspects of Programming(continued)
Programming is creative:
must find a good solution out ofmany possibilities.
Programming is modeling:
describe salient (relevant)properties and behaviors of a system of components.
Programming is abstraction:
identify important features without getting lost in detail.
Programming is concrete:
must provide detailed instructions to complete task
Terms and Definitions
Programis set of directions telling a computer exactly what to do.
Programming languages are languages for specifying sequences of directions to a computer.
Algorithmis sequence of language independent steps which may be followed to solve a problem.
Flowchart is a diagrammatic representation of step for solving the given problem.
Sample Algorithm 1
Calculating the area of a circle
1.Start
2.Input radius in cm.
3.Calculate area= 3.14 *(radius * radius)
4.Display area
5.Stop

Sample Algorithm 2
Calculating the division obtained by the student according to the inputted marks
1.Start
2.Accept 5 different subjects marks
Example: s1, s2, s3, s4, s5
3.Calculate scr= (s1+s2+s3+s4+s5)/5
4.If scr>=75 then display Distinction else
if scr>=60 then display Second class else
if scr>=50 then display Pass class else
Display Fail
1.Stop
Programming Languages
What is Programming Language
It is a type of written language that tellscomputerswhat to do
A programmer writessource codetext in the programming language to create programs
Types of Programming Language
Machine Language
Low Level Language
High Level Language
Machine Language
It is the basic low-level programming language designed to be recognized by a computer
It is written in a binary code of 0s and 1s
Example: A program that display Hello World

Low Level Language


Low-level languages are considered to be closer to computers

Programs and applications written in low-level language are directly executable on the computing
hardware without any interpretation or translation.
Example: Assembly
Example program

High Level Language


an advanced computer programming language that isn't limited by the computer, designed for a
specific job, and is easier to understand.
Example:Basic
C
Java
Example Program

Machine Code
CPU
Assembly Language
CJavascript, ActionScriptRuby, PhytonJavamC#, VB.netObjective CC++
Low Level LanguageHigh Level Language
Stages in Programming Process
Each computer system understands a low-level language that is specific to that type of hardware,
which is called its machine language.
Programmers typically write their software in a higher-level language that is easier for humans to
understand.
Stages(continued)
To execute a programs written in a higher-level language, the computer must adopt one of two
strategies:
The classical approach is to translate the higher-level language into machine language. This strategy
is called compilation.
A second approach is to simulate the program operation without actually translating it to machine
language. This strategy is called interpretation.

You might also like