SlideShare a Scribd company logo
Computer Programming
Languages
Lecture – 1
Computer Basics
• Computer systems consist of hardware and
software
• A set of instructions for the computer to carry
out is called a program
• All the different kinds of programs used to
give instructions to the computer are
collectively referred to as software
Hardware and Memory
• The CPU, or central processing unit, or processor,
performs the instructions in a program
• Computer’s memory holds data for the computer
to process
– It holds the result of the computer’s intermediate
calculations
– A byte is the quantity of memory
• 1 gigabyte of RAM is approximately 1 billion bytes of
memory
Hardware and Memory
Main memory consists of a long list
of numbered bytes
The number of a byte is called its
address
A byte is the smallest addressable
unit of memory
Data (numbers, letters and string of
characters) is encoded as a series of 0s
and 1s and placed in the computer’s
memory
Programming Languages
• Computer programs(software) are instructions
that tell a computer what to do
• Many programming languages
– All programs are converted into instructions that
computer can execute
• Types of Languages
– Machine Language
– Assembly Language
– High-Level Language
To add Two Numbers:
1101101010011010
add 2, 3, result
result = 2 + 3
Example
Lecture-1.pptx . this is about the computer program
Programming Paradigm
• A programming paradigm is a fundamental style
of computer programming
• Imperative in which the programmer instructs
the machine how to change its state.
Examples: C, C++, Java, PHP, Python, Ruby etc.
• Declarative the programmer states only
what the result should look like, not how to
obtain it. Example SQL, HTML , CSS
Programming Paradigm
• Structured Programming
– Kind of imperative programming
– Control flow is defined by nested loops, conditionals,
and subroutines
– Sequence, Selection and Repetition
x= 5;
y = 11;
z = x + y;
System.out.println(z);
if (x % 2 == 0)
{
System.out.println("The
number is even.");
}
while(x < 100)
{
System.out.println(x);
x = x * x
}
Programming Paradigm
• Object Oriented Programming (OOP)
– Object-oriented programming is about creating objects that
contain both data and methods
– Classes and objects are the two main aspects of object-
oriented programming
• Examples: C++, C#, Java, Python.
Class Object
Fruit Apple, Banana, Mango
Car Volvo, Audi, Toyota
Student Ali, Hamza, Ahmad
Programming Paradigm
public class Car {
String carReg;
int carModel;
String carClass;
public Car(String num) {
carReg = num;
}
public String getReg(){
return carReg;
}
public static void main(String[] args) {
Car Audi = new Car("AX-7865");
System.out.println(Audi.getReg());
}
}
Example
Programming Paradigm
• Functional Programming
– Basic method of computation is the application of
functions to arguments
– Supports and encourages the functional style
– Examples of FP languages
• Lisp, Haskell, Python
Program Development
Outline
• Program Development Cycle
• Algorithm
• The First Four Steps
13
Programming: Plan First, Then Code
• A good programmer will plan first and write
second
– Breaking down a large programming task into
several smaller tasks
An Overview of Seven Steps
Algorithm
• Set of well-defined logical steps that must be
taken to perform a task
• For example, suppose you have been asked to write a
program to calculate and display the gross pay for an
hourly paid employee.
Here are the steps that you would take:
1. Get the number of hours worked.
2. Get the hourly pay rate.
3. Multiply the number of hours worked by the hourly pay rate.
4. Display the result of the calculation that was performed in Step 3.
Pseudocode
• Pseudocode: fake code
– Informal language that has no syntax rule
– Not meant to be compiled or executed
– Used to create model program
• No need to worry about syntax errors, can focus on program’s
design
• Can be translated directly into actual code in any programming
language
Flowcharts
• Flowchart: diagram that graphically depicts
the steps in a program
– Ovals are terminal symbols
– Parallelograms are input and output symbols
– Rectangles are processing symbols
– Symbols are connected by arrows that represent
the flow of the program
Flow Chart – Raptor
Example
First Four Steps
Step 1: Work an Example Yourself
Step 2: Write Down What You Just Did
Step 3: Generalize Your Steps
Step 4: Test Your Algorithm
Example-1
Write a program to compute x raised to the y power
(x y)
Step 1: Work an Example Yourself
x = 3 and y = 4, getting an answer of 3^4 = 81.
Example-1
Step 2: Write Down What You Just Did
Example-1
Step 3: Generalize Your Steps
1-Replacing this occurrence of 3 with x
Example-1
Step 3: Generalize Your Steps
2-Find repetition
Example-1
Step 3: Generalize Your Steps
Example-1
• Step 4: Test Your Algorithm
Example-1
• Step 4: Test Your Algorithm

More Related Content

PPTX
Introduction to computer programming
PPTX
MODULE1-INTRODUCTION.pptx-COMPUTER PROGRAMING
PPTX
Computer Programing G10.pptx It refers to the Introduction of Programing
PPTX
Cs1123 2 comp_prog
PDF
Fundamentals of programming with C++
PPTX
Programming Fundamentals With OOPs Concepts (Java Examples Based)
PPTX
grade 10 2023.pptx
PPTX
Introduction.pptx
Introduction to computer programming
MODULE1-INTRODUCTION.pptx-COMPUTER PROGRAMING
Computer Programing G10.pptx It refers to the Introduction of Programing
Cs1123 2 comp_prog
Fundamentals of programming with C++
Programming Fundamentals With OOPs Concepts (Java Examples Based)
grade 10 2023.pptx
Introduction.pptx

Similar to Lecture-1.pptx . this is about the computer program (20)

PPT
Introduction to Programming
PPT
Chapter 1- C++ programming languages +.ppt
PPT
01CHAP_1.PPT
PPTX
Lecture 1.pptx
PPT
programming language(C++) chapter-one contd.ppt
DOCX
programming concept
PPTX
Programming requirements for beginning in software engineering.pptx
PPTX
Introduction to Programming kkkkkkkkkkkkk
PPT
Chapter 5( programming) answer
PDF
L1. Basic Programming Concepts.pdf
PDF
Introduction to computer programming language
PPTX
Lec 1 Introduction to Programming Concepts.pptx
PPTX
02 Algorithms and flowcharts - computers.pptx
PPTX
Basics of Programming.pptx
PPTX
Lesson 1 - Introduction to Computer Programming.pptx
PPTX
ProgrammingPrimerAndOOPS
PDF
01 - Introduction to Computer and Algorithm (1).pdf
PPT
Comp102 lec 1
PPTX
a brief explanation on the topic of Imperative Programming Paradigm.pptx
PPTX
Full Basic Programming in c material ppt
Introduction to Programming
Chapter 1- C++ programming languages +.ppt
01CHAP_1.PPT
Lecture 1.pptx
programming language(C++) chapter-one contd.ppt
programming concept
Programming requirements for beginning in software engineering.pptx
Introduction to Programming kkkkkkkkkkkkk
Chapter 5( programming) answer
L1. Basic Programming Concepts.pdf
Introduction to computer programming language
Lec 1 Introduction to Programming Concepts.pptx
02 Algorithms and flowcharts - computers.pptx
Basics of Programming.pptx
Lesson 1 - Introduction to Computer Programming.pptx
ProgrammingPrimerAndOOPS
01 - Introduction to Computer and Algorithm (1).pdf
Comp102 lec 1
a brief explanation on the topic of Imperative Programming Paradigm.pptx
Full Basic Programming in c material ppt
Ad

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Encapsulation theory and applications.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Review of recent advances in non-invasive hemoglobin estimation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Programs and apps: productivity, graphics, security and other tools
NewMind AI Weekly Chronicles - August'25 Week I
Reach Out and Touch Someone: Haptics and Empathic Computing
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
sap open course for s4hana steps from ECC to s4
Dropbox Q2 2025 Financial Results & Investor Presentation
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
“AI and Expert System Decision Support & Business Intelligence Systems”
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Approach and Philosophy of On baking technology
Advanced methodologies resolving dimensionality complications for autism neur...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Diabetes mellitus diagnosis method based random forest with bat algorithm
MIND Revenue Release Quarter 2 2025 Press Release
Encapsulation theory and applications.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Ad

Lecture-1.pptx . this is about the computer program

  • 2. Computer Basics • Computer systems consist of hardware and software • A set of instructions for the computer to carry out is called a program • All the different kinds of programs used to give instructions to the computer are collectively referred to as software
  • 3. Hardware and Memory • The CPU, or central processing unit, or processor, performs the instructions in a program • Computer’s memory holds data for the computer to process – It holds the result of the computer’s intermediate calculations – A byte is the quantity of memory • 1 gigabyte of RAM is approximately 1 billion bytes of memory
  • 4. Hardware and Memory Main memory consists of a long list of numbered bytes The number of a byte is called its address A byte is the smallest addressable unit of memory Data (numbers, letters and string of characters) is encoded as a series of 0s and 1s and placed in the computer’s memory
  • 5. Programming Languages • Computer programs(software) are instructions that tell a computer what to do • Many programming languages – All programs are converted into instructions that computer can execute • Types of Languages – Machine Language – Assembly Language – High-Level Language To add Two Numbers: 1101101010011010 add 2, 3, result result = 2 + 3 Example
  • 7. Programming Paradigm • A programming paradigm is a fundamental style of computer programming • Imperative in which the programmer instructs the machine how to change its state. Examples: C, C++, Java, PHP, Python, Ruby etc. • Declarative the programmer states only what the result should look like, not how to obtain it. Example SQL, HTML , CSS
  • 8. Programming Paradigm • Structured Programming – Kind of imperative programming – Control flow is defined by nested loops, conditionals, and subroutines – Sequence, Selection and Repetition x= 5; y = 11; z = x + y; System.out.println(z); if (x % 2 == 0) { System.out.println("The number is even."); } while(x < 100) { System.out.println(x); x = x * x }
  • 9. Programming Paradigm • Object Oriented Programming (OOP) – Object-oriented programming is about creating objects that contain both data and methods – Classes and objects are the two main aspects of object- oriented programming • Examples: C++, C#, Java, Python. Class Object Fruit Apple, Banana, Mango Car Volvo, Audi, Toyota Student Ali, Hamza, Ahmad
  • 10. Programming Paradigm public class Car { String carReg; int carModel; String carClass; public Car(String num) { carReg = num; } public String getReg(){ return carReg; } public static void main(String[] args) { Car Audi = new Car("AX-7865"); System.out.println(Audi.getReg()); } } Example
  • 11. Programming Paradigm • Functional Programming – Basic method of computation is the application of functions to arguments – Supports and encourages the functional style – Examples of FP languages • Lisp, Haskell, Python
  • 13. Outline • Program Development Cycle • Algorithm • The First Four Steps 13
  • 14. Programming: Plan First, Then Code • A good programmer will plan first and write second – Breaking down a large programming task into several smaller tasks
  • 15. An Overview of Seven Steps
  • 16. Algorithm • Set of well-defined logical steps that must be taken to perform a task • For example, suppose you have been asked to write a program to calculate and display the gross pay for an hourly paid employee. Here are the steps that you would take: 1. Get the number of hours worked. 2. Get the hourly pay rate. 3. Multiply the number of hours worked by the hourly pay rate. 4. Display the result of the calculation that was performed in Step 3.
  • 17. Pseudocode • Pseudocode: fake code – Informal language that has no syntax rule – Not meant to be compiled or executed – Used to create model program • No need to worry about syntax errors, can focus on program’s design • Can be translated directly into actual code in any programming language
  • 18. Flowcharts • Flowchart: diagram that graphically depicts the steps in a program – Ovals are terminal symbols – Parallelograms are input and output symbols – Rectangles are processing symbols – Symbols are connected by arrows that represent the flow of the program
  • 19. Flow Chart – Raptor Example
  • 20. First Four Steps Step 1: Work an Example Yourself Step 2: Write Down What You Just Did Step 3: Generalize Your Steps Step 4: Test Your Algorithm
  • 21. Example-1 Write a program to compute x raised to the y power (x y) Step 1: Work an Example Yourself x = 3 and y = 4, getting an answer of 3^4 = 81.
  • 22. Example-1 Step 2: Write Down What You Just Did
  • 23. Example-1 Step 3: Generalize Your Steps 1-Replacing this occurrence of 3 with x
  • 24. Example-1 Step 3: Generalize Your Steps 2-Find repetition
  • 26. Example-1 • Step 4: Test Your Algorithm
  • 27. Example-1 • Step 4: Test Your Algorithm

Editor's Notes

  • #8: HOW means describing the Inputs and describing how the Outputs are produced.