Professional Documents
Culture Documents
Unit I - Introduction
Unit I - Introduction
UNIT I - INTRODUCTION
Generation and Classification of Computers- Basic Organization of a Computer –Number
System – Binary – Decimal – Conversion – Problems. Need for logical analysis and thinking –
Algorithm – Pseudo code – Flow Chart.
1.1 INTRODUCTION:
Computer - word derived from Computare – Means to compute or to calculate.
1.1.1 DEFINITION:
It is an electronic machine, devised for performing calculations and controlling
operations that can be expressed either in logical or numerical terms.
It is a fast electronic device which automatically accepts and stores input data, process
them and produce results under the directions of a detailed step by step program.
output
Computer
input
system
process
1.1.2 BASIC FIVE OPERATIONS OF A COMPUTER:
1. Input
Process of capturing the information
By using input components can do any process
2. Process - Transformation process to convert from input to output.
3. Output - Result which is the outcome of transformation process.
4. Storing - Process of saving or retaining the data for future use
5. Controlling - Process of directing the sequence in which all operations to be performed.
1.1.3 KEYWORDS:
Data - Fact about anything - raw material of information.
Information - Processed data.
Computer is made up of 2 components. They are
Hardware
Software
Hardware - physical equipment. (Ex) All devices
Software - set of instructions that direct the hardware how to perform task fro any
operation.
(Ex) Car - Hardware
How to drive - Instructions - Software.
Pascaline (1642) -After many years, Blaise Pascal invented the 1st mechanical adding machine
(i.e) automatic calculator called pascaline.It is a brass rectangular box that have 8 movable dials
to add sums eight figures long.
Stepped Reckoner:(1694)
German Mathematician, Gottfried extends the pascal design to perform multiplication, division
and to find square root called as stepped reckoner (1st calculator for multiplication- Performs by
repeated addition.
Disadvantage:
Not reliable because of lacking of mechanical precision in construction.
Difference and analytical Engine(1822 and 1842)
Real development of computer was done by English mathematician, Charles
Babbage(Father of Computer).
Proposed a machine - To perform differential equation called difference Engine which
produce reliable tables.
In 1842, idea about Analytical engine which is completely automatic It performs basic
arithmetic operation (Average speed of 60 additions/sec)
Basic design includes input device in the form of cords containing operating instructions
and a store for memory of 1000 numbers up to 50 decimal digits.
It has control unit which process instructions in any sequence. Output device to produce
printed results. (It was not constructed but gives basic elements of modern computer).
Punched cards:(1889)
Herman Hollerith - use cards to store data, which fed into machine that compile results
mechanically.
Mark I computer (1937-44):
Automatic sequence controlled calculator - 1st fully automatic calculating machine by Howard in
collaboration with IBM.
Based on Punched card machine technique. It is a electro mechanical device (i.e) both
electrical and mechanical
Reliable but complex in design and huge in size, slow
used over 3000 electrically actuated switches to control its operations
perform 5 arithmetic operations: +,-,*,/,table reference.
1980
VLSI - 1000 of transistor on single chip
ROM Used.
Late 1980
PC with Microprocessor handling 32 bits of data at a time
4,000,000 instructions/sec
1990
PC become part of life.
IC replaces several Individual wired transistors. So size - small, reliable and efficient.
Use keyboard, monitors instead of punched cards and monitor.
Computation time- Calculated in nano seconds
Production and maintenance cost is low
Portable,reliable.
Manual assembly of individual component is not required
Since OS used, the device can run many different applications at one time.
o (Ex) NCR 395 and B6500
4G(EARLY 1970'S - TILL DATE):
Use Microprocessor - circuit contains millions of transistors.
Built on single piece of silicon called chip, which is about 0.5cm along one side and not
more than 0.05cm thick.
It lead to LSI era
o LSI- 1000 of transistors in small silicon material.
o VLSI - hundreds of thousands of transistors in single chip.
o Ultra VLSI - millions. so they become smaller, cheaper than before.
Magnetic memories are replaced by semiconductor memories. So random access
becomes more faster. Moreover semiconductor memories become economical and
smaller.
Hardware failure is negligible.
Additional significant - Computers linked together to form networks which leads to the
development of Internet.
Development of GUI, mouse, and handheld devices takes place.
(Ex) Apple II, CRAY 1, Altair 8800.
FIFTH GENERATION (PRESENT & BEYOND) – AI:
Dream of creating human like computer that capable of reasoning and reaching a decision
through series of what-if-then analysis. Such computers learn from its mistakes.
Process of developing 5th generation computer is still in development stage. However
expert system already in use.
Expert system - computer information system that attempts to mimic thought process and
reasoning of experts in specific areas.
Characteristics:
Mega chips:
5G computers use super LSI chip that contain microprocessor-having millions of electronic
components on a single chip.Mega chip approximately enable the computer memory capacity
to human mind.
Parallel Processing:
Most computers today access and execute only one instruction at a time - serial processing
Parallel processing - accesses several instructions at once and works on them at same time
through use of multiple central processing unit.
Artificial Intelligence:
series of related technologies that tries to simulate and reproduce human behavior, including
thinking, speaking and reasoning.AI comprise group of components of related technologies.
They are
1. Expert System
2. Natural Language Processing
3. Speech Recognition
4. Vision Recognition and Robotics.
a) Micro Computer:
Small, low cost digital computer
Consist of microprocessor, storage unit, input and output channel-all may be in
one chip inserted into one or several pc boards.
Addition of power supply, connecting cables, peripherals (keyboard, printer,
monitor, etc), an os and other software program –provide complete
microcomputer system.
Developed for individual user between networked together and can serve more
than one user.
Ex: IBM pc, Pentium 100, IBM pc Pentium 200, Apple Macintosh.
1. Desktop computer (personal computer):
Standalone for individual use
Consist of input, output, etc
Pros: not very expensive for individuals or small business.
Pc manufacturer are: Apple, IBM, DELL, Hewlett Packard (hp)
2. Laptop (note book):
Portable computer-user can carry it.
Enclose all basic features of desktop
Pros: can use at anywhere, anytime,-mainly during travel.
No external power supply needed. It has rechargeable battery which is self
contained in it.
Expensive when compare to desktop
3. Handheld Computer (palmtop):
Can conveniently store in pocket
Smaller than laptop and larger than calculator.
Use pen or electronic stylus instead of keyboard as input.
No disk drive-So use Memory cards to store programs and data. However can
connect with printer or disk drive to generate output or store data.
Has limited memory and less powerful than desktop.
Ex: Apple Newton, Casio cassiopiea, Franklin eBook man
b) Minicomputer:
Developed by digital equipment corporation.
Small digital computer whose process, storage capacity, speed of processing data is
lesser than that of mainframe but greater than microcomputer.
Used as desktop device often connected to mainframe to perform auxiliary operation.
Mainly designed to meet computing needs for several people simultaneously in a
small to medium size business environment – capable of supporting 200 users
simultaneously.
Serve as centralized storehouse for cluster of workstation or as network server.
Is a multi user system- so used in interactive application in industries, research
organization, college, university, real time controls and engineering design works.
Ex: PDP11, IBM (8000 series) and VAX 7500
c) Mainframe computer:
Ultra high performance computer made for high volume, processor intensive
computing
Consist of high-end computer processor, peripheral devices.
Capable of performing online transactions processing system, extensive data storage,
retrieval and supporting large volumes of data processing.
Process, speed, storage –
Greater than mini
More greater than micro.
Second largest in computer family (first – super computer)
Execute many programs simultaneously at a high speed where as super computer
designed for single process.
Allows users to maintain large information storage at centralized location and able to
access and process the data from different computer located at different location.
Used in large business and scientific work.
Ex-IBM’S ES000, VAX 8000, CDC 6600.
d) Super computer:
Special purpose machine designed for single process (i.e.) to maximize the number of
FLOPS (floating point operation per second)
Computer less than giga flop per second –not considered as super computer.
Contains no. Of CPU that operate in parallel to make it faster speed range-400-10000
MFLOPS (Million FLOPS)
Fastest, costliest, powerful computer among all.
Solves complex mathematical equation in few hours, which have taken a scientist
with paper for years.
Used to solve multivariate mathematical problem of existent physical process such as
aerodynamics, metrology and plasma physics.
Used in
o Military –to simulate defense scenario.
o Cinema- to produce sophisticated animation.
o Scientist-to build complex models.
o Entertainment (advertising industry)
Cons: More expensive.
Ex: CRAY -3, CYBEP 205 and PARAM.
1.INPUT DEVICES
Anything that feeds the data into the computer. This data can be inalpha-numeric form
which needs to be keyed-in orinits very basic natural form i.e.
hear,smell,touch,see;taste&thesixth sense…feel?
Typicalinputdevicesare:
Keyboard
Mouse
Joy Stick
Light pen
Track Ball
Scanner
Graphic Tablet
Microphone
Magnetic Ink Card Reader(MICR)
Optical Character Reader(OCR)
Bar Code Reader
Optical Mark Reader(OMR)
KEYBOARD
Keyboard is the most common and very popular input device which helps in inputting data
to the computer.
The layout of the keyboard is like that of traditional typewriter, although there are some
additional keys provided for performing additional functions.
Keyboards are of two sizes 84 keys or 101/102 keys, but now keyboards with 104 keys or
108 keys are also available for Windows and Internet.
The keys on the keyboard are as follows:
1 Typing Keys These keys include the letter keys (A-Z) and digit keys
(0-9) which generally give same layout as that of
typewriters.
3 Function Keys The twelve function keys are present on the keyboard
which are arranged in a row at the top of the keyboard.
Each function key has unique meaning and is used for
some specific purpose.
5 Special Purpose Keys Keyboard also contains some special purpose keys
such as Enter, Shift, Caps Lock, Num Lock, Space bar,
Tab, and Print Screen.
MOUSE
Mouse is most popular pointing device. It is a very famous cursor-control device having a
small palm size box with a round ball at its base which senses the movement of mouse and
sends corresponding signals to CPU when the mouse buttons are pressed.
Generally it has two buttons called left and right button and a wheel is present between the
buttons. Mouse can be used to control the position of cursor on screen, but it cannot be used
to enter text into the computer.
Advantages
Easy to use
Not very expensive
Moves the cursor faster than the arrow keys of keyboard.
JOYSTICK
Joystick is also a pointing device which is used to move cursor position on a monitor screen.
It is a stick having a spherical ball at its both lower and upper ends. The lower spherical ball
moves in a socket. The joystick can be moved in all four directions.
The function of joystick is similar to that of a mouse. It is mainly used in Computer Aided
Designing(CAD) and playing computer games.
Light Pen
Light pen is a pointing device which is similar to a pen. It is used to select a displayed menu
item or draw pictures on the monitor screen.
It consists of a photocell and an optical system placed in a small tube. When the tip of a light
pen is moved over the monitor screen and pen button is pressed, its photocell sensing
element detects the screen location and sends the corresponding signal to the CPU.
Track Ball
Track ball is an input device that is mostly used in notebook or laptop computer, instead of a
mouse. This is a ball which is half inserted and by moving fingers on ball, pointer can be
moved.
Since the whole device is not moved, a track ball requires less space than a mouse. A track
ball comes in various shapes like a ball, a button and a square.
Scanner
Scanner is an input device which works more like a photocopy machine.
It is used when some information is available on a paper and it is to be transferred to the hard
disc of the computer for further manipulation.
Scanner captures images from the source which are then converted into the digital form that
can be stored on the disc. These images can be edited before they are printed.
Digitizer
Digitizer is an input device which converts analog information into digital form.
Digitizer can convert a signal from the television or camera into a series of numbers that
could be stored in a computer.
They can be used by the computer to create a picture of whatever the camera had been
pointed at. Digitizer is also known as Tablet or Graphics Tablet because it converts graphics
and pictorial data into binary inputs.
A graphic tablet as digitizer is used for doing fine works of drawing and image manipulation
applications.
Microphone
Microphone is an input device to input sound that is then stored in digital form. The
microphone is used for various applications like adding sound to a multimedia presentation
or for mixing music.
2. OUTPUTDEVICES
Output devices display information in awaythat you can understand. The most common
output device is a monitor.It looks a lot alike a TV and houses the computer screen.
The monitor allows you tosee what you and the computer are doing together Output
devices are pieces of equipment that are used to get information or any other response
out from computer.
These devices display information thathasbeenheldorgeneratedwithina
computer.Outputdevicesdisplay informationinaway that you canunderstand.Themost
commonoutputdeviceisamonitor.
TypesofOutputDevice
Printing: Plotter,Printer
Sound:Speakers
Visual:Monitor
PRINTERS
Printer is an output device, which is used to print information on paper.
There are two types of printers:
Impact Printers
Non-Impact Printers
Impact Printers
The impact printers print the characters by striking them on the ribbon which is then pressed on
the paper.
Example:
Dot Matrix Printer(DMP)
Daisy Wheel
Characteristics of Impact Printers are the following:
Very low consumable costs
Very noisy
Useful for bulk printing due to low cost
There is physical contact with the paper to produce an image
Non-impact Printers
Non-impact printers print the characters without using ribbon. These printers print a complete
page at a time so they are also called as Page Printers.
These printers are of two types
Laser Printers
Inkjet Printers
Characteristics of Non-impact Printers
Faster than impact printers.
They are not noisy.
High quality.
Support many fonts and different character size.
SPEAKERS
Speakersareoutputdevicesthatallow youtohearsoundfromyourcomputer.Computer
speakersarejustlikestereospeakers.Thereareusuallytwoofthemandtheycomeinvarious sizes
MONITORS
Monitors, commonly called as Visual Display Unit (VDU), are the main output device of a
computer. It forms images from tiny dots, called pixels that are arranged in a rectangular form.
The sharpness of the image depends upon the number of pixels.
There are two kinds of viewing screen used for monitors.
Cathode-Ray Tube (CRT)
Flat- Panel Display
3. MEMORYOR PRIMARYSTORAGE
Purpose of Storage
Thefundamentalcomponents ofageneral-purposecomputerare arithmetic and logicunit,
controlcircuitry,storagespace, andinput/outputdevices.
Ifstoragewasremoved,thedevice we hadwouldbea
simplecalculatorinsteadofacomputer.Theabilitytostoreinstructionsthat
formacomputerprogram, andtheinformationthattheinstructionsmanipulateiswhatmakes
storedprogramarchitecturecomputersversatile.
Primarystorage,orinternalmemory,iscomputer
memorythatisaccessibletothecentralProcessingunitofacomputerwithouttheuseofcomputer'sinput/
outputchannelsPrimarystorage,alsoknownasmainstorageormemory,isthemainareainacomputerin
whichdataisstoredforquickaccessbythecomputer'sprocessor.
PrimaryStorage
Primarystorageisdirectlyconnectedtothecentralprocessingunitofthecomputer.
Itmustbe presentforthe
CPUtofunctioncorrectly,justasinabiologicalanalogythelungsmustbe
present(foroxygenstorage) forthehearttofunction.
As showninthediagram,primarystoragetypicallyconsistsofthreekindsofstorage:
Mainmemory
It containstheprogramsthatarecurrentlybeingrunandthedatatheprogramsareoperatingon.
The
arithmeticandlogicunitcanveryquicklytransferinformationbetweenaprocessorregisterandlocat
ions in mainstorage, also knownasa "memoryaddresses".
In moderncomputers, electronicsolid-
staterandomaccessmemoryisusedformainstorage,andisdirectlyconnectedtotheCPUviaa"mem
orybus"anda"databus".
Cache memory
It is a special type of internal memory used by many central processing units to increase
their performanceor"throughput".
Someoftheinformationinthemainmemoryisduplicatedin thecache memory,whichisslightly
slowerbutofmuchgreatercapacity thantheprocessorregisters,andfasterbut much smaller
thanmain memory.
RAM(Random Access Memory) is the internal memory of the CPU for storing data,
program and program result. It is read/write memory which stores data until the machine is
working. As soon as the machine is switched off, data is erased.
Access time in RAM is independent of the address that is, each storage location inside the
memory is as easy to reach as other locations and takes the same amount of time. Data in the
RAM can be accessed randomly but it is very expensive.
RAM is volatile, i.e. data stored in it is lost when we switch off the computer or if there is a
power failure. Hence a backup uninterruptible power system(UPS) is often used with
computers. RAM is small, both in terms of its physical size and in the amount of data it can
hold.
RAM is of two types
Static RAM (SRAM)
Dynamic RAM (DRAM)
Non-volatile in nature
These cannot be accidentally changed
Cheaper than RAMs
Easy to test
More reliable than RAMs
These are static and do not require refreshing
Hard Disks
Inside the hard disk drive case you will find circular disks that are made from polished steel.
On the disks, there are many tracks or cylinders.
Within the hard drive, an electronic reading/writing device called the head passes back and
forth over the cylinders, reading information from the disk or writing information to it.
Hard drives spin at 3600 or more rpm (Revolutions Per Minute) - that means that in one
minute, the hard drive spins around over 7200 times!
Optical Storage
A. ALU:
Contains electronic circuitry – executes all arithmetic and logical operation on data made
available to it-has 2 units.
Arithmetic unit - responsible for performing actual computing and carry out arithmetic
calculations at a very high speed.
Logic unit - perform logical operations based on instruction provided on it.
Operation - logical comparison between data item.
Can compare no’s, letters or special character and can then take action
based on compared result.
Logical operation- check equal to condition, greater than condition, less
than condition
B. Control unit
This unit controls the operations of all parts of computer but does not carry out any
actual data processing operations.
Functions of this unit are:
It is responsible for controlling the transfer of data and instructions among other units of
a computer.
It manages and coordinates all the units of the computer.
It obtains the instructions from the memory, interprets them, and directs the operation of
the computer.
It communicates with Input/Output devices for transfer of data or results from storage.
It does not process or store data.
CONTROL UNIT
C. Memory Unit (registers):
Registers are special purpose; high speed temporary memory unit holds various types
of information like data, instruction, address and intermediate results of calculation.
It holds information that CPU is currently working on.
Last position in a octal number represents a x power of the base (8). Example, 8x where x
represents the last position - 1.
Example
Octal Number: 125708
2510=110012
12510=1758
2. Conversion of 84.25010 to Oct
Converting the decimal part as
124.28=25.25010
5.Decimal to Hexadecimal conversion
Conversion of 45010 to Hexadecimal
45010=1C216
6.Hexadecimal to Decimal conversion
Conversion of19FDE16 to Decimal
Step Binary Number Decimal Number
Step 1 19FDE16 ((1 x 164) + (9 x 163) + (F x 162) + (D x 161) + (E x 160))10
Step 2 19FDE16 ((1 x 164) + (9 x 163) + (15 x 162) + (13 x 161) + (14 x 160))10
Step 3 19FDE16 (65536+ 36864 + 3840 + 208 + 14)10
Step 4 19FDE16 10646210
Note: 19FDE16 is normally written as 19FDE.
3 1
110012=318
Example 2 : 11100112 OCTAL
1110011
001 110011
1 6 3
11100112=1638
A, B C=A+B C
After selecting the appropriate solution the algorithm is developed. Algorithms may be
represented as flowcharts.This algorithm will depict the logic.
Testing the algorithm for accuracy:
The Purpose of testing
1) To identify the logical errors because the logical errors are more difficult
to correct at the later stages.
2) To check whether the algorithm is true one.
3) To check whether the algorithm works for the normal data and the unusual
data.
Coding:
Programming languages are used to do coding.
Test and debug the program:
A compiler and the programmer designed test data machine test the code to find the syntax
errors. The results obtained can be compared with the manually calculated results. Depending on
the complexity several rounds of testing may be required.
Program development cycle
Analyze problem Documentation
&Implementation
Algorithm testing
If you know steps to be followed for solving the problem, but while solving the
problem you forget to apply some of the steps, or you apply the calculation steps in
the wrong sequence, you will get the wrong answer.
Similarly while writing the computer program, if the programmer leaves out some of
the instructions for the computer or writes the instructions in a wrong sequence the
computer will calculate the wrong answer.
Hence to produce the effective computer program it is necessary that the programmer
writes every instruction in the proper sequence.
However the logic of the program may be complex.
Hence in order to ensure that the program instructions are appropriate for the
problem, and are in the correct sequence, programs must be planned, before they are
written.
1.8.3 ALGORITHMS
DEFINITION:
A finite sequence of instructions thet,when provided with the set of inputs produces an output
and then terminates.Algorithm can have steps to repeat or require decisions until the task is
completed.For the same task different algorithms(different time,space,efforts) are
possible.Performing an algorithm does not guarantee a solution.
Example:
Algorithm to find the largest among three numbers.
Step 1: Start
Step 2: read three numbers say A,B,C
Step 3: Find the larger number between Anad B and store it in MAX_AB
Step 4: Find the larger between MAX_AB and C and store it in MAX_AB.
Step 5: Display MAX
Step 6: Stop
KEY FEATURES OF AN ALGORITHM
1) Algorithm Properties or characteristics:
2. There must be no ambiguity in any instruction.
3. There should not be any uncertainity about which instruction is to be executed
next.
Decision Table
It helps a lot in designing a specific segment of a design. It provides another way to look at a
complex, nested selection to help clarify the conditions to be tested and how those conditions
should be nested to arrive at the proper actions.
Program:
The algorithm can be represented as a program using any high level language, which becomes a
program.
Flowcharts – Standards for flowcharts, Guidelines for drawing flowcharts.
1.8.4 FLOWCHART
The flowchart is a means of visually presenting the flow of data through an information
processing systems, the operations performed within the system and the sequence in which
they are performed.
The program flowchart can be likened to the blueprint of a building. As we know a designer
draws a blueprint before starting construction on a building. Similarly, a programmer prefers
to draw a flowchart prior to writing a computer program.
As in the case of the drawing of a blueprint, the flowchart is drawn according to defined rules
and using standard flowchart symbols prescribed by the American National Standard
Institute, Inc.
MEANING OF A FLOWCHART
or
5. Only one flow line should enter a decision symbol, but two or three flow lines, one for each
possible answer, should leave the decision symbol.
7. Write within standard symbols briefly. As necessary, you can use the annotation symbol to
describe data or computational steps more clearly.
8. If the flowchart becomes complex, it is better to use connector symbols to reduce the number
of flow lines. Avoid the intersection of flow lines if you want to make it more effective and
better way of communication.
9. Ensure that the flowchart has a logical start and finish.
It is useful to test the validity of the flowchart by passing through it with a simple test data.
Advantages and Limitations of using flowcharts, Pseudocode
ADVANTAGES OF USING FLOWCHARTS
The benefits of flowcharts are as follows:
1. Communication: Flowcharts are better way of communicating the logic of a system to all
concerned.
2. Effective analysis: With the help of flowchart, problem can be analyzed in more effective
way.
Step 2: Round off the value of i to the next largest multiple of j and store the value in integer
variable k using the formula
k= i+j – i(mod)j
Step 4:Stop.
Step 1: Start
Step 2: Read three numbers say A,B
Step 3: Find the larger number between Anad B and store it in MAX
Step 4: Display MAX
Step 5: Stop.
Example 2
Draw a flowchart to find the largest of three numbers A,B, and C.
Example 3
Draw a flowchart for computing factorial N (N!) Where N! = 1 ´ 2 ´ 3 ´ …… N .
1.8.5 PSEUDOCODE
Meaning of pseudocode:
a) Pseudo: Imitation .
b) Code :Instructions.
Pseudocode uses English statements rather than symbols to represent the processes.
Program design language :It is nothing but the other name given to the pseudocode.
Goal: To provide a high level description of an algorithm but suppresses many of the details that
are insignificant.
Example: Pseudocode to calculate the area of the rectangle.
PROMPT the user to enter the height and width of the rectangle.
COMPUTE the area by multiplying the height with width.
DISPLAY the area.
STOP.
5) Keywords:
Input:READ,OBTAIN,GET ,PROMPT.
Output:PRINT,DISPLAY,SHOW
Compute:COMPUTE ,CALCULATE,DETERMINE
Initialise:SET,INITIALISE.
Add One:INCREMENT
Logic Structures in pseudocode:
The steps are normally "sequence," "selection, " "iteration," and a case-type statement. The
"selection" is the "if then else" statement, and the iteration is satisfied by a number of statements,
such as the "while," " do," and the "for," while the case-type statement is satisfied by the
"switch" statement.
Sequence:Information flows in straight line.
First instruction.
Second instruction
Third instruction
…..
…..
Selection:Decisions are made according to the predefined condition
Pseudocode for IF:
IF Condition THEN
Actions
ELSE
Actions
ENDIF.
Pseudocode for SWITCH:
SWITCH choice
CASE 1:
Action
CASE 2:
Action
END CASE
Repetition:Where the logic is repeated in a loop.
Pseudocode for Do…While.
REPEAT
Actions
UNTIL condition
Example 2:
To print the average marks of ten students.
1. SET total to zero
2. DO
3. SET grade counter to one
4. WHILE grade counter is less than or equal to ten
5. INPUT the next grade
6. COMPUTE the Addition of grade and save the result in total
7. SET the class average to the total divided by ten
8. PRINT the class average.
9. ENDWHILE.
Example 3:
To find the average of the grades.
1. INITIALIZE total to zero
2. INITIALIZE counter to zero
3. INPUT the first grade
4. WHILE the user has not as yet entered the sentinel
5. DO
PRACTICE QUESTIONS
1. Draw a flowchart and pseudocode to read a number N and print all its divisors.
2. Draw a flowchart and pseudocode for computing the sum of the digits of any given
number
3. Draw a flowchart and pseudocode to find the sum of given N numbers.
4. Draw a flowchart and pseudocode to computer the sum of squares of integers from 1 to
50
5. Draw a flowchart and pseudocode to arrange the given data in an ascending order.
PRACTICE QUESTIONS
1. Draw an algorithm to read a number N and print all its divisors.
2. Draw an algorithm for computing the sum of the digits of any given number
3. Draw an algorithm to find the sum of given N numbers.
4. Draw an algorithm to computer the sum of squares of integers from 1 to 50
5. Draw an algorithm to arrange the given data in an ascending order.