Unit I LectureNotes
Unit I LectureNotes
Unit IV Modules
An Overview of Modules, Benefits of Modularisation, Modules in Flowchart, Modules in Pseudocode, Arrays, Structures, Introduction to
pointers, Advanced Modularisation: Passing Data to Modules, Module Returning a Value, Variable Types & Scopes, Passing Arrays to
Modules, Module Overloading, In-built or Pre-written Modules, Recursion
Text Books:
1. Brian W. Kernighan, Dennis M. Ritchie, “The C Programming Language”, Prentice Hall, ISBN
0131103628, Second Edition.
2. E. Balguruswamy, “Programming in ANSI C”, Tata Mc-Graw Hill
References:
1. Joyce Farell, “Programming Logic and Design- Comprehensive”, Sixth Edition, Cengage Learning.
2. Tony Gaddis, “Programming Logic & Design”, Third Edition, Pearson Education.
3. Herbert Schildt, “C – The Complete Reference”, Tata McGraw Hill Publishing Company,Fourth Edition,New
Delhi, 2010.
4. Deitel and Deitel, “C How to Program”, Pearson Education, sixth Edition, New Delhi, 2011.
Course Objectives
▶ Students will be able to understand the programming tasks using concepts learned and write pseudo-code.
▶ Students will be able to use pseudo-code and visual modeling to prepare clear and accurate program
▶ Students will be able to identify concepts applicability and apply them to write optimized programs, and hence
▶ Students will be able to use common developer tools effectively and implement best practices to write
professional-quality code.
Prerequisites of the course
Introduction to components of a computer system (disks, memory, processor, where a program is stored and
executed, operating system, compilers etc.). Idea of Algorithm: steps to solve logical and numerical problems.
Representation of Algorithm: Flowchart/Pseudocode with examples. From algorithms to programs; source code,
variables (with data types) variables and memory locations, How a Program Works, Input- Processing –Output.
Contents
▶ Introduction to Components of Computer System
◦ disks, memory, processor, operating system, compiler
▶ Idea of Algorithm
◦ steps to solve logical and numerical problems
◦ Representation of Algorithm: Flowchart/Pseudocode with examples
➢ High-level languages
➢ smaller in size, reliable, and efficient
➢ keyboards and monitors and interfaced with operating system
➢ The dream of creating a human-like computer that would be capable of reasoning and reaching a decision
through a series of “what-if-then” analyses
➢ The starting point for the fifth generation of computers has been set in the early 1990s still in the
development stage
➢ Three characteristics:
○ Mega Chips
○ Parallel Processing
○ Artificial Intelligence
CLASSIFICATION OF COMPUTERS
CLASSIFICATION ACCORDING TO FUNCTIONALITY
1. Micro Computers
➢ a small, low cost digital computer, consists of a microprocessor, a storage unit, an input channel, and
an output channel, all of which may be on one chip inserted into one or several PC boards.
2. Mini Computers
3. Mainframe Computers
4. Super Computers
➢ highest processing speed at a given time for solving scientific and engineering problems
➢ contains a number of CPUs that operate in parallel to make it faster
➢ processing speed lies in the range of 400–10,000 MFLOPS (Millions of Floating Point Operation Per
Second)
➢ fastest, costliest and most powerful computers
➢ Largest commercial uses is in entertainment/advertising industry
SOFTWARE User
Softwar
e
HARDWARE
Hardware
https://www.youtube.com/watch?v=X5wAfklIW24
Computer = Human Body?
▶ 1. Input unit.
▶ 2. Output unit.
▶ 3. Memory unit.
▶ 5. Control Unit.
System and Application Software:
Introduction to System Software
▶ A program, such as the operating system, that control the operation of a computer
and its devices, as well as enable application software to run on the computer.
▶ A type of software that performs a specific task, usually related to managing or
maintaining a computer system.
Basics of Operating System:
▶ Definition
An operating system is a program that acts as an interface between the user and the computer hardware
and controls the execution of all kinds of programs.
-A software.
-It performs all the basic tasks like file management, memory management, process management,
handling input and output, and controlling peripheral devices such as disk drives and printers.
E.g. UNIX, Windows etc
Group Discussion
▶ Windows Vs Linux : Discuss pros and cons of both operating systems.
Q&A
▶ Which software is more closer to hardware and which software is more closer to the user?
▶ Idea of Algorithm
◦ source code, variables (with data types) variables and memory locations
➢ Algorithm
➢ Flow Chart
➢ Pseudo Code
Algorithm
Definition:
An algorithm is a procedure or formula for solving a problem, based
on conducting a sequence of specified actions.
This routine gets the executive to work well prepared to make critical decisions.
Specifying the order in which statements are to be executed in a computer program is
called algorithm.
Algorithm for Weekly Pay
1.Start
2.Declare two variables hourly_rate and no_of_hours.
3.Enter values for hourly_rate and no_of_hours.
4.If no_of_hours is less than or equal to 50 then perform multiplication of two
variables.
Else multiply 50 and hourly_rate.
5. Display result.
6.Stop
Different Ways to Represent an Algorithm
Ø as a flowchart
Ø as a pseudocode
Ø as a program
Flow Chart
Definition:
Flowchart is a graphical tool that diagrammatically depicts the steps
and structure of an algorithm or program.
YES NO
If no_of_hours
<=50
Display Result
End
Question
▶ What is Algorithm?
▶ Which is not symbol of Flow Chart?
Pseudo code
Definition:
Pseudo code is an informal way of describing a program's functions. It
consists of natural language like statements that precisely describe the steps
of an algorithm or program.
OR
Pseudo code simply means “false code” or sentences that appear to have been
written in a computer programming language but do not necessarily follow
all the syntax rules of any specific language.
▶ Idea of Algorithm
◦ source code, variables (with data types) variables and memory locations
Secondary (External)
Primary (Internal) Memory
Memory
Egs.:
PROM SRAM
EPROM DRAM
EEPROM
Memory
Ø Memory measures in Bits i.e. 0 or 1
Ø Computer understands only 0 and 1’s that is binary language
Ø 8 bits = 1 Byte
Ø 16 bits = 1 word = 2 Byte
Ø 32 bits = double word = 4 Byte
Ø 64 bits = Quad word = 8 Byte