1 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Sri Raghavendra Educational Institutions Society (R)

www.skit.org.in

Title: Introduction to computers

CO addressed: CO1

Course: BESCK204E

Presented by: Dr Nirmala S Guptha

Department: CSE

2 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

2

/skit.org.in

Introduction to Computers

3 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

3

/skit.org.in

DEFINITION

  • An electronic device that is designed to accept data, perform the required mathematical and logical operations at high speed, and output the result

4 of 90

3/19/2025

4

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

CHARACTERISTICS OF COMPUTERS

Speed Accuracy Automation

Diligence

Versatile

Memory No I.Q.

Economical

5 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

5

/skit.org.in

STORED PROGRAM CONCEPT

  • Before any data is processed, instructions are read into memory
  • Instructions are stored in the computer’s memory for execution
  • Instructions are stored in binary form (0s &1s)
  • Processing starts with the first instruction in the program, which is copied into a control unit circuit. The control unit executes the instructions
  • Instructions written by the users are performed sequentially until there is a break in the current flow
  • Input/Output and processing operations are performed simultaneously.

While data is being read/written, the central processing unit (CPU) executes another program in the memory that is ready for execution.

6 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

6

/skit.org.in

Types of Stored Program Computers

  • Shared memory for instructions and data

  • Separate memories for instructions and data

Processor

Main Memory

Address Bus - carries addresses

Data Bus - carries data and instructions

Instruction memory

Processor

Data Memory

Data Address

Read/Write Data

Instruction Address

Instructions

7 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

7

/skit.org.in

1822

1890

1936

1941

1943

1944

300BC

Charles Babbage

steam-driven

Difference

Engine

Turing Machine

computing anything

HISTORY OF COMPUTERS

Timeline of Developments

Abacus

for mathematical computations

ENIAC

First digital

computers

8 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

8

/skit.org.in

HISTORY OF COMPUTERS

Timeline of Developments

1947

1953

1954

1958

1969

1946

vacuum tubes replaced

transistor

Formula Translation

FORTRAN

Unix

Operating System

UNIVAC

first

commercial

computer

COBOL

first computer language

Integrated Circuit

Chip

9 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

9

/skit.org.in

HISTORY OF COMPUTERS

Timeline of Developments

  • 1964: prototype of the modern computer, with a mouse and a graphical user interface (GUI)
  • 1970: DRAM chip was introduced by Intel
  • 1971: IBM invented the floppy disk
  • 1973: Ethernet for connecting multiple computers
  • 1974–1977: Personal Computers
  • 1975: BASIC
  • 1976: Steve Jobs and Steve Wozniak started Apple Computers
  • 1977: Apple II
  • 1978: WordStar, a word processor application
  • 1979: VisiCalc, the first computerized spreadsheet
  • 1981: The first IBM personal computer with MS-DOS OS
  • 1983: The first laptop
  • 1985: Microsoft Windows OS
  • 1986: Compaq Deskpro 386, which was a 32-bit architecture
  • 1990: Tim Berners-Lee invented World Wide Web with HTML
  • 1993: The Pentium microprocessor
  • 1994: PC games
  • 1996: Sergey Brin and Larry Page developed the Google
  • 1999: Wi-Fi started connecting to the Internet without wires.

10 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

HISTORY OF COMPUTERS

Generations of Computers(evolution)

First Generation

(1942–

1955)

Used for

Scientific

applications

Examples

ENIAC EDVAC

EDSACUNIVAC I

IBM 701

Highlights

Bulky

Vacuum tubes emitted heat and burned Costly

Difficult to use

Constant maintenance

Hardware Technolog

Vacuum tubes which is made of fragile

glass

Memory

Primary: Electromagnetic relay

Secondary:

punched cards

Software Technolog

1

Programming was done in machine or assembly language.

11 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Second Generation (1955–

1964)

HISTORY OF COMPUTERS

Generations of Computers(evolution)

Used for

Scientific and commercial applications

Examples

Honeywell 400

IBM 7030

CDC 1604 UNIVAC LARC

Highlights

st

Bulky

less heat than 1st Gen

Faster than 1 Gen

Costly

Difficult to use

Consumed 1/10 than

Hardware

Technology

Memory

Transistors: reliable

, powerful,

cheaper, smaller & cooler .

Primary: Magnetic

core

Secondary: Magne tic tapes and disks

Software

Technology

1

Programming was done in High Level programming

languages

12 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Third Generation

(1964–

1975)

Used for

Scientific, Commercial & Interactive

online applications

Examples

IBM 360/370

PDP-8 & PADP-11,

CDC6600

Highlights

Bulky

nd

nd

less heat than 2 Gen

Faster than 2 Gen Costly

Difficult to use

Consumed less

Hardware Technology

Memory

integrated chips (ICs):

SSI and MSI technology

Primary: Large Magnetic core Secondary: Large Magnetic tapes & disks

Software Technology

1

Programming was done in High Level Language

Time sharing OS

13 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Fourth Generation (1975–

1989)

Used for

Scientific, Commercial, Intera ctive online & Network

Highlights

Faster, smaller,

cheaper, powerful, reliable, and easier

Examples

IBM PC, Apple II, TRS-

80, VAX 9000, CRAY- 1, CRAY-2, CRAY-X/MP

Hardware Technology

integrated chips (ICs):

LSI and VLSI

LAN & WAN

Memory

Primary: Semiconductor Secondary:

Large Magnetic tapes,

disks & Floppy

Software Technology

1

Programming was done in High Level Language- 'C'

GUI-OS

14 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Supercomputers

  • Dumb terminals
  • Intelligent terminals

Mainframe computers

Minicomputers

  • Desktop PCs
  • Workstations
  • Laptops
  • N/W Computers
  • Handheld devices

Microcomputers

1

CLASSIFICATION OF COMPUTERS

  • Four categories

(speed, amount of data processing & price)

15 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

CLASSIFICATION OF COMPUTERS

  • Supercomputers
    • Fastest(one trillion calculations/s), most powerful, and most expensive, parallel processing(thousands of concurrent users) , weather forecasting, nuclear energy research, aircraft design, CRAY-1, CRAY-2, Control Data CYBER 205, and ETA A-10.
  • Mainframe computers: large-scale computers, very expensive, servers(www), banks, airline companies & universities
    • Dumb terminals: a monitor and a keyboard, No CPU and memory
    • Intelligent terminals: Own processor, No Memory, PCs are used to data access & services
  • Minicomputers: smaller, cheaper, slower, business, as servers in a network, education, hospitals, single/multiple users, DEC, IBM(AS/400)
  • Microcomputers: IBM-PC in 1981, Apple, DOS, Windows, Mac OS, Linux,
    • Desktop PCs: homes and offices
    • Workstations: processing speed matches with minicomputer, Scientist, engineers, architects
    • Laptops: Similar to Desktop PCs with Mobility
    • N/W Computers: as terminals in a network, to access data, NetPCs
    • Handheld devices: Smartphones, Tablet PCs, iOS, Android,

1

16 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

APPLICATIONS OF COMPUTERS

1

  • Word processing
  • Internet
  • Digital audio & video composition
  • Desktop publishing
  • Multimedia and Animation
  • Legal System
  • Retail Business
  • Sports
  • Travel and Tourism
  • Simulation
  • Astronomy
  • Education
  • Industry and Engineering
  • Robotics
  • Decision Support Systems
  • Expert Systems
  • e-Business
    • Business-to-consumer or B2C
    • Business-to-business or B2B
    • Consumer-to-consumer or C2C
    • Electronic banking
  • Bioinformatics
    • biological and genetic information
    • gene-based drug discovery

and development

  • Health care
    • Storing records
    • Surgical procedures
    • Diagnosis and Treatment
  • Geographic Information System and Remote Sensing
    • Monitoring deforestation
    • Study features of glaciers
    • Analysing the depth of coastal and ocean
  • Meteorology
    • Weather forecasting
    • Aviation meteorology
    • Agricultural meteorology
    • Nuclear meteorology
    • Maritime meteorology

17 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

BASIC ORGANIZATION OF A COMPUTER

1

18 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Input:

  • Accepting data or instructions : keyboard, mouse, scanner, and trackball

Strorage:

  • Primary storage: very expensive and limited capacity
  • Secondary storage: cheaper and non-volatile

Processing (ALU):

  • Performing operations on the data as per the instructions(by ALU)

Output :

  • Displaying result of data processing to the outside world

Control (CU):

  • Controlling and coordinating all operations and Components of a computer(Control Unit)

1

BASIC ORGANIZATION OF A COMPUTER

A computer performs five major operations:

19 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

INSIDE THE COMPUTER

1

20 of 90

3/19/2025

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

CPU

RAM

HDD

Video card

Sound card

Modem

Network card

Fans

Cables

2

INSIDE THE COMPUTER

21 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

MOTHERBOARD

2

22 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

MOTHERBOARD

2

I/O connectors

23 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Processor socket

  • Processor inserted very gently and easily

in Zero Insertion Force (ZIF) sockets

RAM connectors

  • RAM modules are plugged into motherboard connectors

Expansion slots

  • Expansion cards can be inserted, Example AGP (Accelerated Graphic Port)

I/O connectors

  • Serial port, Parallel port, USB ports, RJ45(LAN or Ethernet por), VGA, Audio plugs

MOTHERBOARD

Characteristics of a Motherboard

Form factor

  • Geometry, dimensions, arrangement and electrical requirements

Integrated components

  • Chipset, CMOS clock and battery, BIOS, System bus, Expansion

bus, processor, cache memory, RAM

Chipset

  • Coordinates data transfers between the different components

CMOS clock and battery

  • Real-Time Clock (RTC) circuit synchronize the computer’s signals, CMOS chip is powered by a battery

Basic Input/Output System (BIOS)

  • Interface between the OS & Motherboard, stored in the read-only

memory (ROM)

2

24 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

2

25 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Input Devices

Keyboard

Pointing devices

Mouse Trackball

Trackpad

Handheld devices

Pen Touchscreen

Joystick

Optical devices

Barcode reader Scanners

OCR

OMR

MICR

Audio/Visual devices

2

INPUT DEVICES

To feed data and instructions into a computer

26 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

INPUT DEVICES

2

1.1 Keyboard

27 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

  • Typing keys
  • The letters of the alphabet and the layout of the keyboard is known as QWERTY

Numeric keys

  • Num Lock key is set to ON to type numbers, dot, or input the symbols /, *,

- and +.

Function keys

  • Used by applications and OS to input specific commands.

Control keys

  • To handle control of the cursor and the screen, Arrow (←,↑,→,↓) keys, Home, End, Page Up, Page Down, Insert, Delete, Control (Ctrl), Alternate (Alt), Escape (Esc), Print Screen, Pause, Windows or Start

Inside the Keyboard

  • It has its own processor and circuitry to carry information to and from that processor

Advantage

  • The keyboard is easy to use and inexpensive.

Disadvantages

  • The keyboard cannot be used to draw figures.
  • The process of moving the cursor to another position is very slow.

2

INPUT DEVICES

  • Main input device for computers

1.1 Keyboard

28 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

INPUT DEVICES

2

1.2 Pointing Devices

  • Enables the users to easily control the movement of the pointer to select items on a screen, commands from commands menu, to draw graphics, etc

Mouse

  • The mouse was invented by Douglas Engelbart in 1963, used in a graphical user interface (GUI)
  • Point: Placing the pointer over the word or the object is termed as pointing
  • Click: Pressing the left or the right button
  • Drag: Pointing to a desired location while pressing the left button
  • Scroll: The scroll wheel is used to vertically scroll.
  • Mechanical mouse: This type of mouse has a rubber or metal ball at its bottom
  • Optical mouse: The movement is detected using laser technology using optical sensors.
  • Cordless mouse: A cordless or wireless mouse is connected using radio waves or infrared light waves.
  • Advantages
    • The mouse is easy to use and quickly place the cursor anywhere on the screen.
    • It also helps to quickly and easily draw figures.
    • It is inexpensive.
    • Disadvantages
    • Its point-and-click capabilities make it unnecessary to remember and type in commands.
    • The mouse needs extra desk space to be placed and moved easily.
    • The ball in the mechanical mouse must be cleaned to remove dust from it.

29 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Trackball

  • Used to control the position of the cursor on the screen.
  • Used in notebook and laptop computers where it is placed on the keyboard
  • An upside-down mouse that rotates in place within a socket.
  • The user rolls the ball to position the cursor at an appropriate position on the screen and then clicks

one of the buttons to select objects or position the cursor for text entry

Advantages

  • Trackball provides better resolution
  • Occupies less space
  • Easier to use as compared to mouse

Disadvantages

  • The trackball chamber is often covered with dust, so it must be cleaned regularly

INPUT DEVICES

2

1.2 Pointing Devices

Trackball used like a mouse

Trackball on keyboard

30 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Touchpad

  • A small, flat, rectangular stationary pointing device with a sensitive surface of 1.5-2 square inches
  • Slide fingertips across the surface of the pad to point to a specific object on

the screen.

  • Buttons around the edge of the pad that work like mouse buttons

Advantages

  • Easier to use as compared to mouse as its use involves less hands and arms

movements

  • It is built-in the keyboard, so no need to carry an extra device separately
  • Occupies less space

INPUT DEVICES

3

1.2 Pointing Devices

31 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Joystick

  • Cursor control device widely used in computer games and CAD/CAM applications
  • Consists of a hand-held lever that pivots on one end and transmits its coordinates to a computer
  • Has one or more push-buttons, called switches, whose position can also be read by the computer

Stylus

  • Pen-shaped input device used to enter information or write on the touch screen of a phone.
  • Used to draw lines on a surface as input to a computer, choose an option from a menu, move the cursor to another location on the screen, take notes and create short messages.
  • The stylus usually slides into a slot built into the smart phone for that purpose.

Touch screen

  • Display screen which can identify the occurrence and position of a touch inside the display region
  • The user can touch the screen either by his finger or by using a stylus
  • These displays can be connected to computers, laptops, PDAs, cell phones

3

INPUT DEVICES

1.3 Handheld Devices

32 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Barcode Reader

  • To capture and read information stored in a barcode
  • A barcode reader works by directing a beam of light across the barcode
  • Used in: supermarkets, retail stores, library, manufacturing and shipping,

Advantages

  • Barcode readers are inexpensive.
  • They are portable.
  • They are handy and easy to use

Disadvantages

  • To be handled with care
  • can interpret information using a limited series of thin and wide bars

3

INPUT DEVICES

1.4 Optical Devices

33 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Image Scanner

  • Captures images, printed text, handwriting from different sources and converts it into a

digital image for computer editing and display

  • Types: hand-held, feed-in, and flatbed
  • Scanning either colour images, black-and-white images, or both

Advantages

  • Any printed or handwritten document can be scanned and stored in a computer
  • The scanned and stored document will never deteriorate in quality with time.
  • There is no fear of loss of documents.

Disadvantages

  • Costlier than other input devices
  • Scanned and stored as images have a higher size

3

INPUT DEVICES

1.4 Optical Devices

34 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Optical Character Recognition (OCR) Device

  • Converting printed materials into text or word processing files that can be easily edited and stored
  • Scanning the text character by character
  • Analysing the scanned image to translate the character images into character code

Advantages

  • Printed documents can be converted into text files.
  • Advanced OCR can recognize handwritten text and convert it into computer-readable texts.

Disadvantages

  • OCR cannot recognize all types of fonts.
  • Documents that are poorly typed or have strikeover cannot be recognized.
  • Very old documents when passed through OCR may not convert into the text file

INPUT DEVICES

1.4 Optical Devices

Uses:

  • Digitize and preserve documents in libraries
  • Process checks and credit card slips
  • Sort letters for speeding up mail delivery

Printed

Documents

OCR Technology

Computer readable Text files of size 2- 3KB per page

Scans the documents and makes a bitmap of size 50-150KB per page

3

35 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Optical Mark Recognition (OMR) Device

  • Electronically extracting data from marked fields, such as checkboxes and fill-in fields, on printed forms
  • Pen or pencil marks in pre-defined positions to indicate each selected response
  • Detect the presence of a mark by measuring the reflected light levels

Advantages

  • Optical mark readers work at very high speeds. They can read up to 9000 forms per hour.

Disadvantages

  • It is difficult to gather large amounts of information using an OMR.
  • Some data may be missing in the scanned document.
  • It is a sensitive device that rejects the OMR sheet if it is folded. torn or crushed.

INPUT DEVICES

3

1.4 Optical Devices

36 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Magnetic Ink Character Reader

  • To verify the legitimacy of paper documents, especially bank checks.
  • MICR characters are usually printed in E-13B or CMC-7 fonts.
  • MICR consists of magnetic ink printed characters which can be recognized by high speed magnetic recognition devices

Advantages

  • Enhances security
  • Speeds up the sorting of document
  • minimize the exposure to check frauds

INPUT DEVICES

3

1.4 Optical Devices

37 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Either capture or create sound

Audio Devices

  • Enable computers to accept music, speech, or sound effects for recording and/or editing
  • A microphone feeds audio input to the computer
  • The sound card is a hardware unit that converts analog signals generated through the microphone into digital data

Video Input Devices Capture video from the outside world into the computer

  • Video cards to convert analog video signals to digital data to store
  • Digital camera and web camera are popular examples of video input devices

Advantages

  • Audio devices can be used by people who are visually impaired.
  • Users want to avoid input through keyboard or mouse.
  • Video input devices are very useful for applications such as videoconferencing.
  • Record memorable moments in one's life.
  • Used for security purposes.

Disadvantages

  • Audio input devices are not effective in noisy places.
  • With audio i/p devices, it is difficult to distinguish between 2 similar sounding words such as 'sea' and 'see'.
  • Videos and images captured using video input devices have very big file sizes, and they must be compressed

3

INPUT DEVICES

1.5 Audio-visual Input Devices

38 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

3

39 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Output Devices

Soft Copy Devices

Monitor

Projector

Speaker

Hard Copy Devices

Printer

Plotter

3

OUTPUT DEVICES

  • Any device that outputs/gives information from a computer is called an output device
  • Electromechanical devices that accept data from the computer and convert them into human understandable form
    1. Soft Copy Devices
      • Produce an electronic version of an output
  • Features
  • The output can be viewed only when the computer is on.
  • The user can easily edit soft copy output
  • Soft copy cannot be used by people who do not have a computer.
  • Searching for data in a soft copy is easy and fast.
  • Electronic distribution of material as soft copy is cheaper and can be done easily and quickly.

40 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

  • Monitors
  • Displays video and graphics information generated by the computer through the

video card.

  • Similar to television screens but they display information at a much higher quality.
  • The monitor is connected to either the VGA or the digital video interface (DVI).

Three variants

  • Cathode Ray Tube (CRT), Liquid Crystal Display (LCD) and Plasma

4

OUTPUT DEVICES

2.1 Soft Copy Devices

41 of 90

3/19/2025

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

CRT Monitor

Work by firing charged electrons at a phosphorus film

When electrons hit the phosphor-coated screen, they glow, thereby enabling the user to see the output.

Advantages

CRT monitors provide images of good quality

CRT monitors are cheapest when compared to LCD and plasma monitors

The images are clear even when you try to view it from an angle.

Disadvantages

CRT monitors occupy a large space on the desk.

They are bigger in size and weight, so difficult to move from one place to another

Power consumption is higher than the other monitors.

OUTPUT DEVICES

4

2.1 Soft Copy Devices

42 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

LCD Monitor

A thin, flat, electronic visual display, uses the light modulating properties of liquid crystals,

which do not emit light directly

LCD screens are more compact, lightweight, portable, more reliable, easier on the eyes, energy efficient and offer safer disposal than CRTs

Most LCD displays use active matrix technology in which a thin film transistor (TFT) arranges tiny transistors and capacitors in a matrix on the glass of the display

Advantages

Very compact and lightweight consume less power.

They do not suffer from geometric distortion and Little or no flicker of images

Made in almost any size or shape and cause less eye fatigue

More reliable than CRTs

Disadvantages

Images are not very clear when tried to view from an angle

Expensive than CRTs.

OUTPUT DEVICES

4

2.1 Soft Copy Devices

43 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Plasma monitor

Advantages

Thin and flat monitors used in TVs and computers and two glass plates that have tiny cells filled

with xenon and neon gas The display electrode is covered by a magnesium oxide protective layer and arranged in

horizontal rows along the screen while the address electrodes are arranged in vertical columns

The electrodes that intersect at that cell are charged, current flow through the gas which creates a

rapid flow of charged particles to stimulate the gas atoms to release Ultra-Violet photons

The technology used in plasma monitors allows producing a very wide screen using extremely

thin materials

Very bright images are formed which look good from almost every angle

These monitors are not heavy and are thus easily portable

Disadvantages

Very expensive and High power consumption.

The images are phosphor-based, at times, they may suffer from flicker

OUTPUT DEVICES

4

2.1 Soft Copy Devices

44 of 90

3/19/2025

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

  • Takes an image from a video source and projects it onto a screen or other surface.
  • Used for many applications varying from home theater systems to organizations for projecting information and presentations onto screens large enough for rooms
  • LCD projector: Use their own light to display the image
  • Digital Light Processing (DLP) projector: Use a number of mirrors to reflect the light.

Projector

  • Different types of speakers to enable users to enjoy music, movie

or a game and the voice will be spread through the entire room

  • A headphone is used to enjoy loud music without disturbing the

people

  • Headsets allow the users to talk and listen at the same time, using the same device

Speakers

4

OUTPUT DEVICES

2.1 Soft Copy Devices

45 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

OUTPUT DEVICES

4

2.2 Hard Copy Devices

  • Hard copy output devices are those that produce a physical form of output.
  • The features of hard copy output
    • A computer is not needed to see the output.
    • Editing and incorporating the edits in the hard copy is difficult.
    • Hard copy output can be easily distributed to people who do not have a computer.
    • Searching for data in a hard copy is a tiring and difficult job.
    • Distribution of hard copy is not only costly but slower as well

Printers

  • Takes the text and graphics information from a computer and prints it on a paper
  • Available in the market in various sizes, speeds, sophistication, and costs
  • The qualities of printers that are of interest to users include: Colour, Resolution, Speed and Memory.

46 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

OUTPUT DEVICES

4

2.2 Hard Copy Devices

  • Color: Colored printouts are needed for presentations or maps and other pages where color is part of the information. They are more expensive,
  • Memory: Most printers have a small amount of memory that can be expanded by the user. Having more memory makes enhances the speed of printing
  • Resolution: The resolution of a printer means the sharpness of text and images on paper. It is usually expressed

in dots per inch (dpi). Even the least inexpensive printer provides sufficient resolution for most purposes at 600 dpi.

  • Speed: Speed means number of pages that are printed in one minute. While high speed printers are a little expensive, the inexpensive printers on the other hand can print only about 3 to 6 sheets per minute. Color printing is even slower.
  • Printers can be broadly classified into two groups:
    • Impact printers
    • Non-impact printers

47 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Printers

Impact primers

Dot Matrix

Daisy wheel

Line

Non-Impact printers

Inkjet

Laser

4

OUTPUT DEVICES

2.2 Hard Copy Devices

48 of 90

3/19/2025

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Impact Printer

  • Print characters by striking an inked ribbon against the paper
  • Examples: dot matrix printers, daisy wheel printers and line printers.

Advantages

  • Enables the user to produce carbon copies.
  • They are cheap

Disadvantages

  • Impact printers are slow.

4

  • Poor print quality, especially in the case of graphics
  • Extremely noisy
  • Print only the standard font

OUTPUT DEVICES

2.2 Hard Copy Devices

49 of 90

3/19/2025

/skit.org.in

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Non-impact

printer

  • Less noisy since printing heads do not strike the paper
  • Better print quality, faster printing and sophisticated graphics
  • Use either solid or liquid cartridge-based ink which is

either sprayed, dripped or electro statically drawn

  • Types are: inkjet, printer, laser printer and thermal printer.

Advantages

  • Produce pnnts of good quality and render graphics.
  • Noiseless and fast.
  • Pnnt text in different fonts.

Disadvantages

  • Eexpensive.
  • Ink cartridges used by them are also costly.

4

OUTPUT DEVICES

2.2 Hard Copy Devices

50 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Dot matrix printer

  • A dot matrix printer prints characters and images of all types as a pattern of dots
  • It has a print head (or hammer) that consists of pins representing the character or image
  • The print head runs back and forth/up and down motion, prints by striking an ink-soaked cloth ribbon against the paper.

Advantages

  • Can produce carbon copies and the lowest printing cost per page.
  • used for bulk printing where the quality of he print is not of importance.
  • Inexpensive
  • When the ink is about to be exhausted, the print gradually fades rather than suddenly stopping
  • Can use continuous paper rather than individual sheet, making them useful for data logging.

Disadvantages

  • Creates a lot of noise when head strike the ribbon against the paper.
  • Print lower resolution graphics, with limilud quality.
  • Very slow and
  • Poor print quality.

OUTPUT DEVICES

5

2.2 Hard Copy Devices

51 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Daisy wheel printer

  • The print head is a circular wheel, 3 inches in diameter with arms or spokes, the characters are

embossed at the outer end of the arms

  • The wheel is rotated in such a way that the character to be printed is positioned just in front of the printer ribbon
  • The spoke containing the required character is then hit by a hammer thereby striking the ribbon

to leave an impression on the paper

  • Print quality is high as the exact shape of the character hits the ribbon and 3 times faster Dot matrix printer

3/19/2025

/skit.org.in

OUTPUT DEVICES

5

2.2 Hard Copy Devices

52 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Line printer

  • Line printer is a high speed impact printer in which one typed line is printed at a time
  • The speed of a line printer usually varies from 600 to 1200 lines-per-minute or approximately 10 to 20 pages per minute
  • They are widely used in datacenters and in industrial environments
  • Band printer is a commonly used variant of line printers

OUTPUT DEVICES

5

2.2 Hard Copy Devices

53 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Band Printer

  • The set of characters are permanently embossed on the band and this set cannot be changed unless the band is replaced
  • The band itself revolves around hammers that push the paper against the ribbon, allowing the desired character to be produced on

the paper

  • The advantage is its high speed, can print 2000 lines per minute, perfect for high volume printing in businesses, schools, and other organizations
  • It cannot be used for any graphics printing as the characters are predetermined and cannot be changed unless the band is changed

OUTPUT DEVICES

5

2.2 Hard Copy Devices

54 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

Inkjet printer

  • The print head has several tiny nozzles, also called jets.
  • As the paper moves past the print head, the nozzles spray ink onto it, forming the characters and

images.

  • The dots are extremely small (50 and 60 microns) and are positioned very precisely, with resolutions of up to 1440x720 dots per inch (dpi).
  • One black ink cartridge and color cartridge containing ink in primary pigments (cyan, magenta,

and yellow).

  • Cheaper than laser printers, but expensive to maintain
  • Not well-suited for high-volume print jobs

3/19/2025

/skit.org.in

5

OUTPUT DEVICES

2.2 Hard Copy Devices

55 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Laser printer

  • A laser beam 'draws' the document on a drum (which is coated with a photo-conductive material) using electrical charges.
  • After the drum is charged, it is rolled in a toner (a dry powder type of ink).
  • The toner sticks to the charged image on the drum.
  • The toner is transferred onto a piece of paper and fused to the paper with heat and pressure.
  • After print, the electrical charge is removed from the drum and the excess toner is collected.
  • Works at very high speeds and produces high-quality text and graphics

OUTPUT DEVICES

5

2.2 Hard Copy Devices

56 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Plotters

  • A plotter is a printer that interprets commands from a computer to make line drawings on paper with one or

more automated pens

  • Plotters are expensive than printers, they are used only for specialized applications like CAD, CAM and CAE
  • A drum plotter is used to draw graphics on a paper that is wrapped around a drum.
  • It works by rotating the drum back and forth to produce vertical motion.
  • The pen which is mounted on a carriage is moved across the width of the paper.
  • The vertical movement of the paper and the horizontal movement of the pen create the required design

under the control of the computer.

OUTPUT DEVICES

5

2.2 Hard Copy Devices

57 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Plotters

  • Flatbed plotter, the paper is spread on the flat rectangular surface of the plotter and the pen is moved over it.
  • Flatbed plotters are less expensive and used in many smaller computing systems.
  • The paper is not moved rather plotting is done by moving an arm that moves a pen over paper.

OUTPUT DEVICES

5

2.2 Hard Copy Devices

58 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

5

  1. Programming Paradigms
    • A fundamental style of programming that defines how the structure and basic elements of a computer program will be built.
    • The paradigms in the sequence of their application, can be classified as follows:
      1. Monolithic programming—emphasizes on finding a solution
      2. Procedural programming—lays stress on algorithms
      3. Structured programming—focuses on modules
      4. Object-oriented programming—emphasizes on classes and objects
      5. Logic-oriented programming—focuses on goals usually expressed in predicate calculus
      6. Rule-oriented programming—makes use of ‘if-then-else’ rules for computation
      7. Constraint-oriented programming—utilizes invariant relationships to solve a problem
      8. These paradigms has its own strengths and weaknesses and no single paradigm can suit all application

59 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

    • Monolithic Programming
      • Programs written using monolithic programming languages such as assembly language and BASIC consist of global data and sequential code
      • The global data can be accessed and modified from any part of the program, leads to a serious threat to

its integrity

      • To change the sequence of instructions, jump statements or 'goto' statements are used
      • All the actions to complete a task in the same

application makes the size of the program large but also makes it difficult to debug and maintain

      • Used only for very small and simple applications where reusability is not a concern

MOV AX, A ADD AX, B MOV SUM, AX JMP STOP

…………….. STOP: EXIT

ADB 10

BDB 20

SUM DB?

Global data

5

Sequential code with

!MP

instruction

Structure of a monolithic program

60 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

1.2 Procedural Programming

  • A program is divided into subroutines to avoid repetition of code which can access global data
  • A subroutine that needs the service provided by another, subroutine can call that subroutine
  • The sequence of execution of instructions is altered by 'jump', 'goto' and 'call' instructions
  • FORTRAN and COBOL are two popular procedural programming

languages

  • Advantages
    • The only goal is to write correct programs
    • Programs are easier to write as compared to monolithic programming
  • Disadvantages
    • No concept of reusability
    • Requires more time and effort to write programs
    • Programs are difficult to maintain
    • Global data is shared and therefore may get altered

Program

Global Data

Subroutine

6

61 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

1.3 Structured Programming

  • also referred to as modular programming, was basically defined to be used in large programs that require large development team to develop different parts of the same program
  • Employs a top-down approach where the overall program structure is broken down into separate modules to allow the code to be
  • loaded into memory more efficiently and also be reused
  • in other programs.
  • Modules are coded separately and once a module is written and tested individually, it is then integrated with other modules to form the overall program structure

Program

Global Data

Modules that have Global data, local data and code

6

62 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

1.3 Structured Programming

  • Advantages
    • Write correct programs that are easy to understand and change.
    • Enhance programmers productivity by allowing them to look at the big picture first and focus on details later.
    • Many programmers can work on a single, large program, with each working on a different module.
    • A structured program takes less time to be written than other programs.
    • Modules or procedures can be reused in other programs.
    • Each module performs a specific task.
    • Each module has its own local data.
    • Easy to debug because each procedure performs one task and can be checked individually for the error.
    • Individual procedures are easy to change as well as understand
    • More emphasis is given on the code then the data
  • Disadvantages
    • Not data-centred
    • Global data is shared and therefore may get inadvertently modified
    • Main focus is on functions

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

6

63 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

1.4 Object-oriented Programming (OOP)

  • To develop maintainable programs OOP was developed, it treats data as a critical element in the program and restricts its flow freely
  • OOP is task-based and data-based, all the relevant data and tasks are grouped together in entities known as objects
  • The features of OOP:
    • Programs are data centred.
    • Programs are divided in terms of objects and not procedures.
    • Functions that operate on data are tied together with

the data.

  • Data is hidden and not accessible by external

functions.

  • New data and functions can be easily added as and when required.
  • Follows a bottom-up approach for problem solving.

Object1

Object 4

Object 2

Object3

Objects of a program interact by sending

messages to each other

6

64 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

  1. Example of a Structured Program
    • To create a program to manage the names and addresses of a list of students, it has to be broken down into the following modules:
      • Enter new names and addresses
      • Modify existing entries
      • Sort entries
      • Print the list
    • Each of these modules can be further broken down into smaller modules:
      • Prompt the user to enter new data
      • Read the existing list from the disk
      • Add the name and address to the existing list
      • Save the updated list to the disk
    • Similarly, 'Modify existing entries' can be divided into modules:
      • Read the existing list from disk
      • Modify one or more entries
      • Save the updated list to disk

6

65 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

2. Example of a Structured Program

6

66 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Requirem ents Analysis

Design

Impleme ntation

Testing

Software Deploym ent, Training & Support

Maintena nce

6

DESIGNING EFFICIENT PROGRAMS

  1. Design and Implementation of Efficient Programs
    • The design and development of correct, efficient, and maintainable programs depend on the approach of the development process.
    • The development process is divided into phases and the output of one phase is the input for next phase.
    • The phases in the software development life cycle (SDLC) process:

67 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Requirements

Analysis

  • The user's expectations and requirements are gathered and analysed to arrive at the scope or the objective of the software product.
  • Every identified requirement is documented to avoid doubts or uncertainty of the functionality.
  • From the requirements document, a plan of actions is made which will be followed in the development process.
  • The core structure of the software/program is broken into modules and the solution is specified in the

form of algorithms or flowcharts.

  • The designed algorithms are converted into program code using high level languages, like C for writing

system programs and Visual Basic for writing an application program.

  • This phase is also called construction or code generation phase.
  • All the modules are tested together to ensure that the overall system works well as a whole product
  • The software is tested using a large number of varied inputs, also known as test data, to ensure that the software is working as expected by the user's requirements.
  • After the software or program has been approved by the users, it is installed or deployed in the

production environment.

  • If nobody in an organization knows how to use the software or fix up certain problems, then no one would like to use it, hence it is very crucial to have training of users.
  • Done to cope with newly discovered problems or new requirements, which may need the addition of new code that does not fit the original design.
  • If the cost of the maintenance exceeds 25% of the prior phase's cost, it is better to re-build the software.

6

Design

Implementation

Testing

Software Deployment, Training& Support

Maintenance

DESIGNING EFFICIENT PROGRAMS

3. Design and Implementation of Efficient Programs

68 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

  1. Program Design Tools: Algorithms, Flowcharts, Pseudocodes
    1. Algorithms
      • Algorithm is a formally defined procedure for performing some calculation.
      • They give the logic of the program, i.e., a blueprint to solve a problem in a finite number of steps.
      • Algorithm is implemented using programming languages like C, C++ & Java and are used to achieve software reuse.
      • The characteristics of an algorithm are:
        • Be precise
        • Be unambiguous
        • Not even a single instruction must be repeated infinitely.
        • After the algorithm gets terminated, the desired result must be obtained.

6

69 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Step 1: Input first number as A Step 2: Input second number as B Step 3: Set Sum = A + B

Step 4: Print Sum Step 5: End

Algorithm to add two numbers

6

DESIGNING EFFICIENT PROGRAMS

    • Algorithms

Control Structures Used In Algorithms

      • Three control structures: sequence, decision and repetition.
      • Sequence: Sequence means that each step of the algorithm is executed in the specified order.
        • This algorithm performs the steps in a purely sequential order.

70 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

    • Algorithms

Control Structures Used In Algorithms

      • Decision: Decision statements are used when the outcome of the process depends on some condition. The general form is: IF <condition> then process
      • A condition is any statement that may evaluate either to a true value or a false value.
      • A decision statement can also be stated in the following manner: IF <condition> then

Step 1:

Step 2:

Step 3:

7

Step 4:

Input first number as A Input second number as B IF A=B

Print “Equal” ELSE

Print “Not Equal” [END OF IF]

End

71 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Step 1:

Step 2:

Step 3:

Step 4:

7

Step 5:

[initialize] Set I = 1, N = 10 Repeat Steps 3 and 4 while I <= N Print I

SET I = I + 1 [END OF LOOP]

End

DESIGNING EFFICIENT PROGRAMS

    • Algorithms

Control Structures Used In Algorithms

      • Repetition: Repetition involves executing one or more steps for a number of times and is implemented using constructs such as the while, do-while and for loops.
      • These loops execute one or more steps until some condition is true.

Algorithm to print the first 10 natural numbers

72 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Example 1

Write an algorithm for interchanging/swapping two values.

Step 1: Input first number as A Step 2: Input second number as B Step 3: Set temp = A

Step 4: Set A = B

Step 5: Set B = temp Step 6: Print A, B Step 7: End

7

DESIGNING EFFICIENT PROGRAMS

4.1 Algorithms

Algorithms Examples:

73 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Example 2

Write an algorithm for interchanging/swapping two values.

  • Step 1: Input first number as A
  • Step 2: Input second number as B
  • Step 3: Set temp = A
  • Step 4: Set A = B
  • Step 5: Set B = temp
  • Step 6: Print A, B
  • Step 7: End

7

DESIGNING EFFICIENT PROGRAMS

4.1 Algorithms

74 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

4.1 Algorithms

Example 3

Write an algorithm to find whether a number is even or odd.

7

  • Step 1:
  • Step 2:

Input number as A

IF A % 2 = 0

Print "Even"

ELSE

Print "Odd"

  • [END OF IF]
  • Step 3: End

75 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Example 4

Write an algorithm to print the grade obtained by a student using the following rules.

  • Step 1: Enter the marks obtained as M
  • Step 2: IF M > 75, Print "0"
  • Step 3: IF M >= 60 and M < 75, Print "A"
  • Step 4: IF M >= 50 and M < 60, Print "B"
  • Step 5: IF M >= 40 and M < 50, Print "C"
  • ELSE Print "D"
  • [END OF IF]
  • Step 6: End

7

DESIGNING EFFICIENT PROGRAMS

4.1 Algorithms

76 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Example 5

Write an algorithm to find the sum of first N natural numbers.

Step 1: Input N

Step 2: Set I = 1, sum = 0

Step 3: Repeat Steps 4 and 5 while I <= N Step 4: Set sum = sum + I

Step 5: Set I = I + 1

[END OF LOOP]

Step 6: Print sum Step 7: End

7

DESIGNING EFFICIENT PROGRAMS

4.1 Algorithms

77 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Start or Stop

Arrows

Processing Step

Input/Output

Decision

Connector

DESIGNING EFFICIENT PROGRAMS

4.2 Flowcharts

  • A flowchart is a graphical or symbolic representation of a process.
  • It is used to design and document virtually complex processes to help the viewers to visualize the logic of the process to gain a better understanding of the process.
  • Each step in the process is depicted by a different symbol and is associated with a short description. The symbols in the flowchart are linked together with arrows to show the flow of logic in the process.

7

78 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

4.2 Flowcharts

  • A flowchart is a graphical or symbolic representation of a process.
  • It is used to design and document virtually complex processes to help the viewers to visualize the logic of the process to gain a better understanding of the process.
  • Each step in the process is depicted by a different symbol and is associated with a short description. The symbols in the flowchart are linked together with arrows to show the flow of

logic in the process.

7

79 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

7

4.2 Flowcharts Significance of Flowcharts

A flowchart is a diagrammatic representation that illustrates the sequence of steps that must be performed to solve a problem.

It facilitates communication between programmers and users.

Flowcharts help the programmers to understand the logic of complicated and lengthy problems and makes it easy to write the program in any high-level language

Flowchart are necessary for better documentation of complex programs and it follows the top-down approach in solving problems.

80 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

8

4.2 Flowcharts Advantages

  • They are very good communication tools to explain the logic of a system and help to analyse the problem in a more effective manner and are also used for program documentation
  • They act as a guide or blueprint to code the solution in any programming language. which results in error-free programs.
  • They can be used to debug programs that have errors as they help to easily detect, locate, and remove mistakes in the program in a systematic manner.

81 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

4.2 Flowcharts Limitations

  • Drawing flowcharts is a laborious and a time-consuming activity.
  • The flowchart of a complex program becomes complex and clumsy.
  • A little bit of alteration in the solution may require complete redrawing of the flowchart.
  • The essentials of what is done may get lost in the technical details of how it is done.

8

82 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

DESIGNING EFFICIENT PROGRAMS

4.3 Pseudocodes

  • Pseudocode is a compact and informal high-level description of an algorithm that uses the structural conventions of a programming language.
  • It focuses on the logic of the algorithm without the details of language syntax.
  • An ideal pseudocode must be complete, describing the entire logic of the algorithm, so that it can be easily converted into programming statements and should not include keywords in any specific computer language.
  • They are commonly used in textbooks and scientific publications for documenting algorithms, and for sketching out the program structure before the actual coding is

done. This helps even non-programmers to understand the logic of the designed solution.

8

83 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Write a pseudocode for calculating the price of a product after adding the sales tax to its original price.

  1. Read the price of the product
  2. Read the sales tax rate
  3. Calculate sales tax = price of the item x sales tax rate
  4. Calculate total price = price of the product + sales tax
  5. Print total price
  6. End

Variables: price of the item, sales tax rate, sales tax, total price

8

DESIGNING EFFICIENT PROGRAMS

4.3 Pseudocodes Pseudocodes Examples:

84 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Write a pseudocode to calculate the weekly wages of an employee The pay depends on wages per hour and the number of hours worked. Moreover, if the employee has worked for more than 30 hours, then he or she gets twice the wages per hour, for every extra hour that he or she has worked

  1. Read hours worked
  2. Read wages per hour
  3. Set overtime charges to 0
  4. Set overtime hrs to 0
  5. IF hours worked > 30 then
    1. Calculate overtime hrs = hours worked -30
    2. Calculate overtime charges = overtime hrs x (2 x wages per hour)
    3. Set hours worked = hours worked-overtime hrs ENDIF
  6. Calculate salary = (hours worked x wages per hour) + overtime charges
  7. Display salary
  8. End

Variables: hours worked, wages per hour,overtime charges, overtime hrs, salary

8

DESIGNING EFFICIENT PROGRAMS

4.3 Pseudocodes

85 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Run-time Errors:

  • Such errors occur when the program is being run executed and may terminate program execution. It occurs when the program performs some illegal operations like

dividing a number by zero

opening a file that already exists lack of free memory space

finding square or logarithm of negative numbers

8

DESIGNING EFFICIENT PROGRAMS

5. Types of Errors

86 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

Compile-time Errors:

  • These occur at the time of compilation of the program and can be further classified as follows:
  • Syntax Errors: Syntax errors are generated when rules of a programming language are violated.
  • Semantic Errors: Semantic errors are those errors which may comply with rules of the

programming language but are not meaningful to the compiler.

8

DESIGNING EFFICIENT PROGRAMS

5. Types of Errors

87 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

  • Logical Errors:
  • Logical errors are errors in the program code due to incorrect statements. that result in incorrect and undesirable output.
  • They are not detected by the compiler; hence programmers must check their code line by line or use a debugger to locate and rectify the errors.

8

DESIGNING EFFICIENT PROGRAMS

5. Types of Errors

88 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

  • Linker Errors:
  • These errors occur when the linker is not able to find the function definition for a given

prototype.

8

DESIGNING EFFICIENT PROGRAMS

5. Types of Errors

89 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

  • Brute-Force

Method:

  • A printout of CPU registers and relevant memory locations is taken,

studied. and documented.

  • It is the least efficient way of debugging and is done when all the other methods fail.

Backtracking

Method:

  • It is a popular technique that is widely used to debug small applications.
  • It works by locating the first symptom of error and then tracing backward

across the entire source code until the real cause of error is detected.

Cause Elimination:

  • A list of all possible causes of an error is developed. Then relevant tests

are carried out to eliminate each of them.

9

DESIGNING EFFICIENT PROGRAMS

6. Testing and Debugging Approaches

Debugging includes execution testing and code correction by locating errors in the program code. Once the errors are located, they are isolated and fixed to produce an error-free code. Different approaches applied for debugging a code includes:

90 of 90

Sri Krishna Institute of Technology

(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)

3/19/2025

/skit.org.in

9