This document outlines the course CSEG1001 Computer Programming. It covers several topics that will be taught over the course including the evolution of computers from the abacus to modern devices, generations of computers, programming languages, and basic programming concepts like algorithms, flowcharts, and pseudocode. The course roadmap shows it will cover introduction to computers, C programming basics, arrays and strings, functions and pointers, structures and unions.
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
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
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
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
55.
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.
59.
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