SlideShare a Scribd company logo
CSEG1001 Computer Programming
CSEG 1001
Computer Programming
Instructor
Dhiviya Rose J . Asst. Prof. Senior Scale
School of Computer Science and Engineering | UPES
CSEG1001 Computer Programming
Road Map
• Generations of Computers and Languages
• Organization of Computers-Online Lecture
• Number Systems Conversion
• Logical Analysis and Thinking
Introduction to
Computers
• Structure of C Program & Compilation and Linking Process
• Variables and Datatypes
• Managing Input and Output statements
• Decision and Looping Statements
C Programming
Basics
• Creation and Usages
• 1D and 2 D arrys
• String Functions
• Matrix operations
Arrays and
Strings
• Declaration and Definitions of Functions
• Passing Arguments
• Recursion
• Pointers & Pointer Arithmetic
Functions and
Pointers
• Need of Structure and Unions
• Declaration and Definition
• Storage classes
• Preprocessor Directives
Structures and
Unions
CSEG1001 Computer Programming
LECTURE #1
EVOLUTION & GENERATION OF COMPUTERS &
LANGUAGES
Instructor
Dhiviya Rose J . Asst. Prof. Senior Scale
School of Computer Science and Engineering | UPES
CSEG1001 Computer Programming
History
• Abacus
• Sliding Beads on a rack
• Counting purpose
• Operators on addition and subtraction
• 300 B.C.
• Napier Bones
• Logarithmic value carved on ivory sticks
• Scotsman ->John Napier
• 1617
CSEG1001 Computer Programming
Abacus – Addition and Subtraction
CSEG1001 Computer Programming
Napier’s Bones - Multiplication
CSEG1001 Computer Programming
Steps……..Inventions
• Pascaline Machine
• Functional Automatic Calculator
• French Mathematician
• Blaise Pascal
• 1642
• gear-driven calculating machine
• Eight movable dials
CSEG1001 Computer Programming
Gear Engine
CSEG1001 Computer Programming
CSEG1001 Computer Programming
Steps……..Inventions
• Leibniz's Stepped Reckoner
• 1694
• German Mathemacian
• addition, subtraction, multiplication, and division
• Jacquard Powerloom
• 1801
• weave automatically
• read from punched wooden cards
CSEG1001 Computer Programming
Leibniz's Stepped Reckoned
CSEG1001 Computer Programming
Steps……..Inventions
• Jacquard Powerloom
• 1801
• weave automatically
• Programs punched in cards
• read from punched wooden cards
CSEG1001 Computer Programming
Jacquards Loom
CSEG1001 Computer Programming
Practical Jacquards Loom
CSEG1001 Computer Programming
Sample Punch card
CSEG1001 Computer Programming
• Differential Engine
• Charles Babbage – Father of Computers
• English Mathematician
• 1822
• First Computer
• Basic calc+ Log + Differential equation
• Steam Driven machine
• Single Stored program in Memory
• Memory + Central Processing Unit
• Punch Cards as memory
Steps……..Inventions
CSEG1001 Computer Programming
Steps……..Inventions
• Analytical Engine
• Charles Babbage
• 1833
• Fully functional
• differential engine
• Contains
• Input device as cards
• Control unit
• Output device
CSEG1001 Computer Programming
CSEG1001 Computer Programming
Steps…Inventions
• Hollerith Tabulator
• Herman Hollerith
• 1889
• U.S Census Bureau
• Official Purpose
• Punch cards
• store data
• Used Electricity
• Later IBM
• Mainframe+OS
• OS/2 -> OS with
windows
CSEG1001 Computer Programming
Memory Tapes
CSEG1001 Computer Programming
MainFrame Computers – 1955 - US
CSEG1001 Computer Programming
Steps……..Inventions
• Mark 1
• 1944
• IBM + Harvard Aiken
• Replaces the mechanical component
• Relays
• Electro magnetic component
• ENIAC
• 1946
• John Eckert and John Mauchly
• Electronic Numerical Integrator And Calculator
• Electronic Vaccum Tubes
CSEG1001 Computer Programming
Steps……..Inventions
• EDVAC
• Electronic Discrete Variable Automatic Computer
• John Eckert and John Mauchly
• Capability to stop and resume
• EDSAC
• Electronic Delay Storage Automatic Calculator
• 1949
• Maurice Wilkes
• Mercury delay lines – memory
• Vacuum tubes --- logic
CSEG1001 Computer Programming
Steps……..Inventions
• UNIVAC
• Universal Automatic Compute
• 1951
• Beginning of computer era
• John Eckert and John Mauchly
• 1970
• Integrated Circuits
• Replaces vaccum tubes
• 1980
• Very Large Scale Integration (VLSI)
CSEG1001 Computer Programming
Mini Comp. ---Apple1 -- $600 ---1976
CSEG1001 Computer Programming
IBM PC ---- 1990
CSEG1001 Computer Programming
Apple II
CSEG1001 Computer Programming
GENERATION OF
COMPUTERS
CSEG1001 Computer Programming
CSEG1001 Computer Programming
First Generation
• 1940 – 1956
• Vaccum Tubes
• Machine Language
• Specification
• Vacuum tubes -> circuitry
• Magnetic drums -> memory
• Input ->punched cards and paper tape
• Output ->printouts
• Examples
• UNIVAC -U.S. Census Bureau in 1951
• ENIAC computers
• Disadvantage
• Expensive
• Huge conception of electricity
• Big & Clumsy
• Air conditioning Necessary
• Non portable
CSEG1001 Computer Programming
CSEG1001 Computer Programming
Second Generation
• 1956 - 1963
• Transistor
• used to relay and switch electronic signals
• Assembly language
• Specification
• punched cards for input
• printouts for output
• Transistor for circuits
• magnetic core technology for memory
• Computers smaller, faster, cheaper, portable and
more energy-efficient and need air conditioning.
CSEG1001 Computer Programming
CSEG1001 Computer Programming
Third Generations
• 1964 – 1970
• Integrated Circuits
• Transistors were miniaturized and placed on silicon chips called
semiconductors
• High Level Language
• Specifications
• Keyboard as input
• Monitor as output
• Operating System
• Central program that controls the devices
• Advantages
• Speed
• Efficiency
• Portable
• Cheap
• Less power
CSEG1001 Computer Programming
CSEG1001 Computer Programming
Fourth Generation
• 1970 – Present
• Data Communication
• Microprocessors
• thousands of integrated circuits were built onto a single silicon chip
• Properties
• Instruction set
• Bandwidth
• Clock Speed
• Example
• Intel 4004 chip – minuscule chip(cpu+ memory+ i/p+ o/p unit)
• 1984 Apple introduced the Macintosh
• Specification
• Microprocessor
• Mouse and other handheld devices
• CPU and ALU
• RAID – Redundant array of Independent Disk for memory
CSEG1001 Computer Programming
CSEG1001 Computer Programming
Fifth Generation
• Present and Beyond
• Artificial Intelligence
• Game Playing
• Expert System
• Robotics
• Mega chips
• Parallel processing
• Voice Recognition
• Example
• No fully AI computers
• 1997, an IBM super-computer called Deep Blue defeated world
chess champion Gary Kasparov in a chess
CSEG1001 Computer Programming
CSEG1001 Computer Programming
Classification of Computers
Types of Computers
On the basis of
Purpose
Special
Purpose
General
Purpose
On the basis of Technology
Analog
Digital
Hybrid
On the basis of Size &
Capacity
Super
Main Frame
Mini
Micro
CSEG1001 Computer Programming
Super Computers
CSEG1001 Computer Programming
Main Frame Computer
CSEG1001 Computer Programming
Mini Computers
CSEG1001 Computer Programming
Micro Computers
CSEG1001 Computer Programming
Mini Computers
CSEG1001 Computer Programming
Generation of Programming Languages
CSEG1001 Computer Programming
CSEG1001 Computer Programming
LECTURE #3
ALGORITHM, FLOWCHARTAND PSEUDOCODE
Instructor
Dhiviya Rose J . Asst. Prof. Senior Scale
School of Computer Science and Engineering | UPES
CSEG1001 Computer Programming
Software Development Method
Execute & Test
Finally, the program is tested to verify that it behaves as intended.
Coding -------Write Program with some Programming Language
C C++ Java ….
Modify the solution if necessary
Check it
Analysis & Design Plan It
algorithm flowchart pseudocode
PreProgrammingSteps
Introduction to Algorithms
• The algorithm is the abstract idea of solving a problem.
• The algorithm is written in user language
Algorithms vs. programs
• When an algorithm is coded using any programming
language (e.g. C++), then it is called a program.
• The program is a set of instructions that can run by the
computer.
• The algorithm would consist of at least the
following tasks:
1- Input (Read the data)
2- Processing (Perform the computation)
3- Output (Display the results)
Example 1
• Write a algorithm to find an area of a circle where area = pi
* radius * radius
Data Processing Output
radius area = 3.14 x radius x radius area
CSEG1001 Lecture 1 Introduction to Computers
Flowchart
• It is another way to display the algorithm.
• Diagram representation –
• special geometric symbols connected by lines and contain
the instructions.
Flowchart Symbols
Symbol Function
Show the direction of data flow or logical
solution.
Indicate the beginning and ending of a set of
actions or instructions (logical flow) of a module
or program.
Indicate a process, such as calculations,
opening and closing files.
Indicate input to the program and output from the
program.
Use for making decision. Either True or False based
on certain condition.
Use for doing a repetition or looping of certain steps.
Connection of flowchart on the same page.
Connection of flowchart from page to page.
CSEG1001 Lecture 1 Introduction to Computers
Pseudocode
• Writing the Pseudocode
• Pseudocode means an imitation computer code.
• It is used in place of symbols or a flowchart to describe
the logic of a program. Thus, it is a set of instructions
(descriptive form) to describe the logic of a program.
• Pseudocode is close to the actual programming
language.
• Using the Pseudocode, the programmer can start to
write the actual code.
Structuring a Program
• Develop efficient computer solution to problems:
1. Use Modules
2. Use four logic structures
a. Sequential structure
• Executes instructions one after another in a sequence.
b. Decision structure
• Branches to execute one of two possible sets of instructions.
c. Loop structure
• Executes set of instruction many times.
d. Case structure
• Executes one set of instructions out of several sets.
3. Eliminate rewriting of identical process by using modules.
4. Use techniques to improve readability including four logic
structure, proper naming of variables, internal documentation
and proper indentation.
Sequential Logic Structure
The Decision Logic Structure
• Implements using the IF/THEN/ELSE instruction.
• Tells the computer that IF a condition is true, THEN
execute a set of instructions, or ELSE execute another set
of instructions
• ELSE part is optional, as there is not always a set of
instructions if the conditions are false.
• Algorithm:
IF <condition(s)> THEN
<TRUE instruction(s)>
ELSE
<FALSE instruction(s)
Decision Logic Structure
Example:1
CSEG1001 Computer Programming
The Loop Logic Structure
• Repeat structure
• To solve the problem that doing the same task over and
over for different sets of data
• Types of loop:
• WHILE loop
• Do..WHILE loop
• Automatic-Counter Loop
Loop Logic Structure
Examples
CSEG1001 Computer Programming
The Case Logic Structure
• Made up of several or many sets of instructions, only one
of which will be selected by the user and executed by the
computer
• Algorithm:
CASE OF VARIABLE
= constant1:
actions for VARIABLE = constant1
= constants2:
actions for VARIABLE = constant2
…
OTHERWISE:
Actions for VARIABLE = anything else
END-OF-CASE
Case Logic Structure
Actual Implementation
CSEG1001 Computer Programming
Example: Biggest of 3 numbers
CSEG1001 Computer Programming
Example for case structure
CSEG1001 Computer Programming
Example for Loop
CSEG1001 Computer Programming
CSEG1001 Computer Programming

More Related Content

PDF
CSEG1001Unit 2 C Programming Fundamentals
PPT
Program Logic Formulation - Ohio State University
PPTX
STRUCTURED PROGRAMMING Chap2
PDF
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE 2015)
PDF
Problem Solving Techniques and Introduction to C
PPTX
Unit 1. Problem Solving with Computer
PPT
Introduction to Programming
PDF
Decision Making Statements, Arrays, Strings
CSEG1001Unit 2 C Programming Fundamentals
Program Logic Formulation - Ohio State University
STRUCTURED PROGRAMMING Chap2
Efficient and Advanced Omniscient Debugging for xDSMLs (SLE 2015)
Problem Solving Techniques and Introduction to C
Unit 1. Problem Solving with Computer
Introduction to Programming
Decision Making Statements, Arrays, Strings

What's hot (19)

PPT
Chapter 1 - An Overview of Computers and Programming Languages
PDF
Algorithm Pseudo
PPT
Logic Formulation 1
PDF
Programming Fundamentals and basic knowledge
PPT
Logic Formulation 2
PPTX
System Programming Overview
PPT
2.2 Demonstrate the understanding of Programming Life Cycle
PDF
Principles Of Programing Languages
PDF
Graphical programming
PPTX
Mcs lec2
PDF
Problem solving (C++ Programming)
PPTX
Cs1123 2 comp_prog
PPTX
Algorithms - Introduction to computer programming
PPT
Chapter 02 - Problem Solving
PPT
Introduction to programming principles languages
PDF
Algorithmic problem sloving
PPT
COMPUTER PROGRAMMING
PPTX
Guerrero rullan ppt
Chapter 1 - An Overview of Computers and Programming Languages
Algorithm Pseudo
Logic Formulation 1
Programming Fundamentals and basic knowledge
Logic Formulation 2
System Programming Overview
2.2 Demonstrate the understanding of Programming Life Cycle
Principles Of Programing Languages
Graphical programming
Mcs lec2
Problem solving (C++ Programming)
Cs1123 2 comp_prog
Algorithms - Introduction to computer programming
Chapter 02 - Problem Solving
Introduction to programming principles languages
Algorithmic problem sloving
COMPUTER PROGRAMMING
Guerrero rullan ppt
Ad

Similar to CSEG1001 Lecture 1 Introduction to Computers (20)

PDF
Programming for Problem Solving Unit 1
PDF
Computer Programming_Unit 1
PPTX
UNIT-1.pptx
PPTX
PPTX
PPT
PCT Slide1
PPTX
History of computer
PPTX
PROGRAM LOGIC AND FORMULATION
PDF
Module 1 intro to computng science
PDF
Computer programming for ECE Chapter 01.pdf
PPTX
CSC 101 2016_2017.pptx
PPTX
Computer Programming Grade 9 for Students
PPTX
Computer Programming Grade 9
PPTX
PPTX
PPS
Cs101lec01 100130102405-phpapp02
PPTX
Lecture 1-2.pptx
PDF
Introduction to computer
PPT
Hardware and Software
Programming for Problem Solving Unit 1
Computer Programming_Unit 1
UNIT-1.pptx
PCT Slide1
History of computer
PROGRAM LOGIC AND FORMULATION
Module 1 intro to computng science
Computer programming for ECE Chapter 01.pdf
CSC 101 2016_2017.pptx
Computer Programming Grade 9 for Students
Computer Programming Grade 9
Cs101lec01 100130102405-phpapp02
Lecture 1-2.pptx
Introduction to computer
Hardware and Software
Ad

More from Dhiviya Rose (14)

PDF
Programming for Problem Solving Unit 2
PPTX
Module 3 microsoft powerpoint
PPT
Module 3 business computing.pdf
PDF
Module 2 Digital Devices and its Applications
PDF
Software
PDF
Unit 1 Business Computing
PDF
Module 1 - Digital Devices and its Application
PDF
CSEG1001Unit 3 Arrays and Strings
PDF
CSEG1001 Unit 4 Functions and Pointers
PDF
CSEG1001 Unit 5 Structure and Unions
PDF
Lecture 3 internet and web
PPSX
Strings
PPSX
Multidimentional array
PPSX
Searching in Arrays
Programming for Problem Solving Unit 2
Module 3 microsoft powerpoint
Module 3 business computing.pdf
Module 2 Digital Devices and its Applications
Software
Unit 1 Business Computing
Module 1 - Digital Devices and its Application
CSEG1001Unit 3 Arrays and Strings
CSEG1001 Unit 4 Functions and Pointers
CSEG1001 Unit 5 Structure and Unions
Lecture 3 internet and web
Strings
Multidimentional array
Searching in Arrays

Recently uploaded (20)

PPTX
master seminar digital applications in india
PPTX
Pharma ospi slides which help in ospi learning
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Cell Types and Its function , kingdom of life
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Basic Mud Logging Guide for educational purpose
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
master seminar digital applications in india
Pharma ospi slides which help in ospi learning
STATICS OF THE RIGID BODIES Hibbelers.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Supply Chain Operations Speaking Notes -ICLT Program
Complications of Minimal Access Surgery at WLH
Cell Types and Its function , kingdom of life
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
O5-L3 Freight Transport Ops (International) V1.pdf
VCE English Exam - Section C Student Revision Booklet
GDM (1) (1).pptx small presentation for students
Microbial disease of the cardiovascular and lymphatic systems
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Final Presentation General Medicine 03-08-2024.pptx
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Basic Mud Logging Guide for educational purpose
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape

CSEG1001 Lecture 1 Introduction to Computers

  • 2. CSEG 1001 Computer Programming Instructor Dhiviya Rose J . Asst. Prof. Senior Scale School of Computer Science and Engineering | UPES CSEG1001 Computer Programming
  • 3. Road Map • Generations of Computers and Languages • Organization of Computers-Online Lecture • Number Systems Conversion • Logical Analysis and Thinking Introduction to Computers • Structure of C Program & Compilation and Linking Process • Variables and Datatypes • Managing Input and Output statements • Decision and Looping Statements C Programming Basics • Creation and Usages • 1D and 2 D arrys • String Functions • Matrix operations Arrays and Strings • Declaration and Definitions of Functions • Passing Arguments • Recursion • Pointers & Pointer Arithmetic Functions and Pointers • Need of Structure and Unions • Declaration and Definition • Storage classes • Preprocessor Directives Structures and Unions CSEG1001 Computer Programming
  • 4. LECTURE #1 EVOLUTION & GENERATION OF COMPUTERS & LANGUAGES Instructor Dhiviya Rose J . Asst. Prof. Senior Scale School of Computer Science and Engineering | UPES CSEG1001 Computer Programming
  • 5. History • Abacus • Sliding Beads on a rack • Counting purpose • Operators on addition and subtraction • 300 B.C. • Napier Bones • Logarithmic value carved on ivory sticks • Scotsman ->John Napier • 1617 CSEG1001 Computer Programming
  • 6. Abacus – Addition and Subtraction CSEG1001 Computer Programming
  • 7. Napier’s Bones - Multiplication CSEG1001 Computer Programming
  • 8. Steps……..Inventions • Pascaline Machine • Functional Automatic Calculator • French Mathematician • Blaise Pascal • 1642 • gear-driven calculating machine • Eight movable dials CSEG1001 Computer Programming
  • 11. Steps……..Inventions • Leibniz's Stepped Reckoner • 1694 • German Mathemacian • addition, subtraction, multiplication, and division • Jacquard Powerloom • 1801 • weave automatically • read from punched wooden cards CSEG1001 Computer Programming
  • 12. Leibniz's Stepped Reckoned CSEG1001 Computer Programming
  • 13. Steps……..Inventions • Jacquard Powerloom • 1801 • weave automatically • Programs punched in cards • read from punched wooden cards CSEG1001 Computer Programming
  • 15. Practical Jacquards Loom CSEG1001 Computer Programming
  • 16. Sample Punch card CSEG1001 Computer Programming
  • 17. • Differential Engine • Charles Babbage – Father of Computers • English Mathematician • 1822 • First Computer • Basic calc+ Log + Differential equation • Steam Driven machine • Single Stored program in Memory • Memory + Central Processing Unit • Punch Cards as memory Steps……..Inventions CSEG1001 Computer Programming
  • 18. Steps……..Inventions • Analytical Engine • Charles Babbage • 1833 • Fully functional • differential engine • Contains • Input device as cards • Control unit • Output device CSEG1001 Computer Programming
  • 20. Steps…Inventions • Hollerith Tabulator • Herman Hollerith • 1889 • U.S Census Bureau • Official Purpose • Punch cards • store data • Used Electricity • Later IBM • Mainframe+OS • OS/2 -> OS with windows CSEG1001 Computer Programming
  • 22. MainFrame Computers – 1955 - US CSEG1001 Computer Programming
  • 23. Steps……..Inventions • Mark 1 • 1944 • IBM + Harvard Aiken • Replaces the mechanical component • Relays • Electro magnetic component • ENIAC • 1946 • John Eckert and John Mauchly • Electronic Numerical Integrator And Calculator • Electronic Vaccum Tubes CSEG1001 Computer Programming
  • 24. Steps……..Inventions • EDVAC • Electronic Discrete Variable Automatic Computer • John Eckert and John Mauchly • Capability to stop and resume • EDSAC • Electronic Delay Storage Automatic Calculator • 1949 • Maurice Wilkes • Mercury delay lines – memory • Vacuum tubes --- logic CSEG1001 Computer Programming
  • 25. Steps……..Inventions • UNIVAC • Universal Automatic Compute • 1951 • Beginning of computer era • John Eckert and John Mauchly • 1970 • Integrated Circuits • Replaces vaccum tubes • 1980 • Very Large Scale Integration (VLSI) CSEG1001 Computer Programming
  • 26. Mini Comp. ---Apple1 -- $600 ---1976 CSEG1001 Computer Programming
  • 27. IBM PC ---- 1990 CSEG1001 Computer Programming
  • 31. First Generation • 1940 – 1956 • Vaccum Tubes • Machine Language • Specification • Vacuum tubes -> circuitry • Magnetic drums -> memory • Input ->punched cards and paper tape • Output ->printouts • Examples • UNIVAC -U.S. Census Bureau in 1951 • ENIAC computers • Disadvantage • Expensive • Huge conception of electricity • Big & Clumsy • Air conditioning Necessary • Non portable CSEG1001 Computer Programming
  • 33. Second Generation • 1956 - 1963 • Transistor • used to relay and switch electronic signals • Assembly language • Specification • punched cards for input • printouts for output • Transistor for circuits • magnetic core technology for memory • Computers smaller, faster, cheaper, portable and more energy-efficient and need air conditioning. CSEG1001 Computer Programming
  • 35. Third Generations • 1964 – 1970 • Integrated Circuits • Transistors were miniaturized and placed on silicon chips called semiconductors • High Level Language • Specifications • Keyboard as input • Monitor as output • Operating System • Central program that controls the devices • Advantages • Speed • Efficiency • Portable • Cheap • Less power CSEG1001 Computer Programming
  • 37. Fourth Generation • 1970 – Present • Data Communication • Microprocessors • thousands of integrated circuits were built onto a single silicon chip • Properties • Instruction set • Bandwidth • Clock Speed • Example • Intel 4004 chip – minuscule chip(cpu+ memory+ i/p+ o/p unit) • 1984 Apple introduced the Macintosh • Specification • Microprocessor • Mouse and other handheld devices • CPU and ALU • RAID – Redundant array of Independent Disk for memory CSEG1001 Computer Programming
  • 39. Fifth Generation • Present and Beyond • Artificial Intelligence • Game Playing • Expert System • Robotics • Mega chips • Parallel processing • Voice Recognition • Example • No fully AI computers • 1997, an IBM super-computer called Deep Blue defeated world chess champion Gary Kasparov in a chess CSEG1001 Computer Programming
  • 41. Classification of Computers Types of Computers On the basis of Purpose Special Purpose General Purpose On the basis of Technology Analog Digital Hybrid On the basis of Size & Capacity Super Main Frame Mini Micro CSEG1001 Computer Programming
  • 43. Main Frame Computer CSEG1001 Computer Programming
  • 47. Generation of Programming Languages CSEG1001 Computer Programming
  • 49. LECTURE #3 ALGORITHM, FLOWCHARTAND PSEUDOCODE Instructor Dhiviya Rose J . Asst. Prof. Senior Scale School of Computer Science and Engineering | UPES CSEG1001 Computer Programming
  • 50. Software Development Method Execute & Test Finally, the program is tested to verify that it behaves as intended. Coding -------Write Program with some Programming Language C C++ Java …. Modify the solution if necessary Check it Analysis & Design Plan It algorithm flowchart pseudocode PreProgrammingSteps
  • 51. Introduction to Algorithms • The algorithm is the abstract idea of solving a problem. • The algorithm is written in user language
  • 52. Algorithms vs. programs • When an algorithm is coded using any programming language (e.g. C++), then it is called a program. • The program is a set of instructions that can run by the computer.
  • 53. • The algorithm would consist of at least the following tasks: 1- Input (Read the data) 2- Processing (Perform the computation) 3- Output (Display the results)
  • 54. Example 1 • Write a algorithm to find an area of a circle where area = pi * radius * radius Data Processing Output radius area = 3.14 x radius x radius area
  • 56. Flowchart • It is another way to display the algorithm. • Diagram representation – • special geometric symbols connected by lines and contain the instructions.
  • 57. Flowchart Symbols Symbol Function Show the direction of data flow or logical solution. Indicate the beginning and ending of a set of actions or instructions (logical flow) of a module or program. Indicate a process, such as calculations, opening and closing files.
  • 58. Indicate input to the program and output from the program. Use for making decision. Either True or False based on certain condition. Use for doing a repetition or looping of certain steps. Connection of flowchart on the same page. Connection of flowchart from page to page.
  • 60. Pseudocode • Writing the Pseudocode • Pseudocode means an imitation computer code. • It is used in place of symbols or a flowchart to describe the logic of a program. Thus, it is a set of instructions (descriptive form) to describe the logic of a program. • Pseudocode is close to the actual programming language. • Using the Pseudocode, the programmer can start to write the actual code.
  • 61. Structuring a Program • Develop efficient computer solution to problems: 1. Use Modules 2. Use four logic structures a. Sequential structure • Executes instructions one after another in a sequence. b. Decision structure • Branches to execute one of two possible sets of instructions. c. Loop structure • Executes set of instruction many times. d. Case structure • Executes one set of instructions out of several sets. 3. Eliminate rewriting of identical process by using modules. 4. Use techniques to improve readability including four logic structure, proper naming of variables, internal documentation and proper indentation.
  • 63. The Decision Logic Structure • Implements using the IF/THEN/ELSE instruction. • Tells the computer that IF a condition is true, THEN execute a set of instructions, or ELSE execute another set of instructions • ELSE part is optional, as there is not always a set of instructions if the conditions are false. • Algorithm: IF <condition(s)> THEN <TRUE instruction(s)> ELSE <FALSE instruction(s)
  • 67. The Loop Logic Structure • Repeat structure • To solve the problem that doing the same task over and over for different sets of data • Types of loop: • WHILE loop • Do..WHILE loop • Automatic-Counter Loop
  • 70. The Case Logic Structure • Made up of several or many sets of instructions, only one of which will be selected by the user and executed by the computer • Algorithm: CASE OF VARIABLE = constant1: actions for VARIABLE = constant1 = constants2: actions for VARIABLE = constant2 … OTHERWISE: Actions for VARIABLE = anything else END-OF-CASE
  • 73. Example: Biggest of 3 numbers CSEG1001 Computer Programming
  • 74. Example for case structure CSEG1001 Computer Programming
  • 75. Example for Loop CSEG1001 Computer Programming