Com-311 BMS
Com-311 BMS
Basic anatomy of the computer system: Input devices, CPU, Output Devices,
Memory: Primary and secondary.
Introduction
Computers have now become an integral part of our daily life. People use computers for a
variety of reasons and purposes. Be it education, business, entertainment, communication,
government service or transportation, computers are inevitable today. As far as students are
concerned, computers are used for learning different subjects effectively and for carrying out
learning activities apart from their primary function of computing. Try to recollect the
situations where we used computers and identify the benefits from it. Therefore, it is essential
to know more about computers and its applications. This chapter presents the concepts
computer characteristics, classification, functional units of computer, computer components,
types of memory, Input and Output Device used in computers are also discussed in this chapter.
Computer
A computer is an electronic device that receives input, stores or processes the input
as per user instructions and provides output in desired format.
Evolution of Computers
The need for device to do calculations along with the growth in commerce and other
human activities explains the evolution of computers. Having the right tool to perform these
tasks has always been important for human beings. In their quest to develop efficient computing
devices, humankind developed many apparatuses. However, many centuries elapsed before
technology was adequately advanced to develop computers.
Abacus
In the beginning people used either their fingers or pebbles along lines in the sand to
count or add. For the sake convenience people in Asia Minor built a counting device
called abacus through which calculations where performed using a system of sliding
beads arranged on a rack.
Napier’s Bones
In 1617 an eccentric Scotsman named John Napier invented logarithms, that allows
multiplication to be performed via addition.
Slide Rule
Napier’s invention led directly to the slide rule.
Pascaline
In 1642, a French mathematician, Blaise Pascal invented the first functional automatic
calculator. This brass rectangular box is also called as Pascalaine,used eight movable dials to
add numbers up to eight figures long.
Leibniz Machine
In 1964, a German mathematician, Gottfried Wilhem von Leibniz made a machine that
could perform multiplication, division and square root. This machine is known as the Stepped
Recknoer. It was the first mass producing calculating device which was designed to perform
multiplication by repeated additions. It worked by a system of gears and tiles. But it lacked
mechanical precision in its construction and was not reliable.
Harvard Aiken and IBM in 1944 built mark 1 using relays and electromagnetic
components to replace mechanical components. In 1946, John Eckert and John Mauchly of the
Moore School of Engineering at the University of Pennsylvania developed the Electronic
Numerical Integrator and Calculator (ENIAC).
The computer used electronic vacuum tubes John Eckert and John Mauchly also
proposed the development of Electronic Discrete Variable Automatic Computer (EDVAC)
which was the first electronic to use the stored program concept introduced by John van
Neumann. This computer could stop any time and then resume operations.
Generations of Computers
Growth in the computer industry is determined by the development in technology. Based on various
stages of development, computers can be categroized into different generations.
Main Component
SNo. Generation Period Merits/Demerits
used
1 First 1942- Vacuum tubes Big in size
Generation 1955 Consumed more power
Malfunction due to
overheat
Machine Language was
used
Characteristic of Computers
Speed
Speed is the most important characteristic of a computer. Computers have more
speed to perform jobs simultaneously. It can perform and complete the task in a few
seconds, whereas the amount of work that a human being can o in an entire year.
Accuracy
The accuracy of the computer is consistently high. The computers are perfect,
accurate and precise. It never makes any mistake. Accuracy signifies the reliability of
the hardware components of a computer.
Automatic
The computer works automatically, once programs are stored and data given to it.
Storage
The computer processes limitless quantities of data and information. Storage of this
data poses another problem. But the storage system of a computer solves this by means
of various memories such as Hard disk, Floppy, Magnetic tapes a Drives etc.,
Classification of Computer
Computers were classified according to processor types because development in
processor and processing speeds were the developmental benchmarks. Earliest computers
used vacuum tubes for processing, were huge and broke down frequently. However, as
vacuum tubes were replaced by transistors and then chips, their size decreased and processing
speeds increased manifold.
All modern computers and computing devices use microprocessors whose speeds and
storage capacities are skyrocketing day by day. The developmental benchmark for computers
is now their size. Computers are now classified on the basis of their use or size.
Desktop
Laptop
Tablet
Server
Mainframe
Supercomputer
Desktop
Desktop computers are personal computers (PCs) designed for use by an individual at
a fixed location. IBM was the first computer to introduce and popularize use of desktops. A
desktop unit typically has a CPU (Central Processing Unit), monitor, keyboard and mouse.
Introduction of desktops popularized use of computers among common people as it was
compact and affordable.
Riding on the wave of desktop’s popularity many software and hardware devices were
developed specially for the home or office user. The foremost design consideration here was
user friendliness.
Laptop
Despite its huge popularity, desktops gave way to a more compact and portable
personal computer called laptop in 2000s. Laptops are also called notebook computers or
simply notebooks. Laptops run using batteries and connect to networks using Wi-Fi (Wireless
Fidelity) chips. They also have chips for energy efficiency so that they can conserve power
whenever possible and have a longer life.
Modern laptops have enough processing power and storage capacity to be used for all office
Tablet
After laptops computers were further miniaturized to develop machines that have
processing power of a desktop but are small enough to be held in one’s palm. Tablets have
touch sensitive screen of typically 5 to 10 inches where one finger is used to touch icons and
invoke applications.
Keyboard is also displayed virtually whenever required and used with touch strokes.
Applications that run on tablets are called apps. They use operating systems by Microsoft
(Windows 8 and later versions) or Google (Android). Apple computers have developed their
own tablet called iPad which uses a proprietary OS called iOS.
Server
Servers are computers with high processing speeds that provide one or more services
to other systems on the network. They may or may not have screens attached to them. A group
of computers or digital devices connected together to share resources is called a network.
Servers have high processing powers and can handle multiple requests
simultaneously. Most commonly found servers on networks include –
File or storage server
Game server
Application server
Database server
Mail server
Print server
Mainframe
Mainframes are computers used by organizations like banks, airlines and railways to
handle millions and trillions of online transactions per second. Important features of
mainframes are
Big in size
Hundreds of times Faster than servers, typically hundred megabytes per second
Very expensive
Use proprietary OS provided by the manufacturers
In-built hardware, software and firmware security features
Supercomputer
Supercomputers are the fastest computers on Earth. They are used for carrying out
complex, fast and time intensive calculations for scientific and engineering applications.
Supercomputer speed or performance is measured in teraflops, i.e. 1012 floating point
operations per second.
Chinese supercomputer Sunway TaihuLight is the world’s fastest supercomputer with a rating
of 93 petaflops per second, i.e. 93 quadrillion floating-point operations per second.
Most common uses of supercomputers include −
Molecular mapping and research
Weather forecasting
Environmental research
Oil and gas exploration
1. Input unit
The collected data and the instructions for their processing are entered into the
computer through the input unit. They are stored in the memory (storage unit). The data may
be in different forms like number, text, image, audio, video, etc. A variety of devices are
available to input the data depending on its nature. Keyboard, mouse, scanner, mic, digital
camera, etc. are some commonly used input devices. In short, the functions performed by
input unit are as follows:
a. Accepts instructions and data from the outside world.
b. Converts these instructions and data to a form acceptable to the
computer.
c. Supplies the converted instructions and data to the computer for
processing.
2. Central Processing Unit (CPU)
The CPU is the brain of the computer. In a human body, all major decisions are taken by the
brain and other parts of the body function as directed by the brain. Similarly, in a computer
system, all major computations and comparisons are made inside the CPU.
It is also responsible for activating and controlling the operations of other units of the computer.
The functions of CPU are performed by three components – Arithmetic Logic Unit (ALU),
Control Unit (CU) and registers.
a. Arithmetic Logic Unit (ALU)
The actual operations specified in the instructions are carried out in the Arithmetic
Logic Unit (ALU). It performs calculations and logical operations such as comparisons and
decision making. The data and instructions stored in the storage unit are transferred to the ALU
and the processing takes place in it. Intermediate results produced by the ALU are temporarily
transferred back to the storage and are retrieved later when needed for further processing. Thus,
there is a data flow between the storage and the ALU many times before the entire processing
is completed.
b. Control Unit (CU)
Each of the functional units has its own function, but none of these will perform the
function until it is asked to. This task is assigned to the control unit. It invokes the other units
to take charge of the operation they are associated with. It is the central nervous system that
manages and co-ordinates all other units of the computer. It obtains instructions from the
program stored in the memory, interprets the operation, and issues signals to the unit concerned
in the system to execute them.
c. Registers
These are temporary storage elements that facilitate the functions of CPU. There are a
variety of registers; each is designated to store unique items like data, instruction, memory
address, results, etc.
3. Memory unit
The data and instructions entered in the computer through input unit are stored inside
the computer before actual processing starts. Similarly, the information or results produced
after processing are also stored inside the computer, before transferring to the output unit.
Moreover, the intermediate results, if any, must also be stored for further processing. The
storage unit of a computer serves all these purposes. The specific functions of storage unit are
to hold or store:
d. data and instructions required for processing.
e. intermediate results for ongoing processing.
f. final results of processing, before releasing to the output unit. The
storage unit comprises of two types as detailed below:
a. Primary Storage:
It is also known as main memory. It is again divided into two - Random Access Memory
(RAM) and Read Only Memory (ROM). RAM holds instructions, data and intermediate results
of processing. It also holds the recently produced results of the job done by the computer. ROM
contains instructions for the startup procedure of the computer. The Central Processing Unit
can directly access the main memory at a very high speed. But it is costly and has limited
storage capacity.
b. Secondary Storage:
It is also known as auxiliary storage and it takes care of the limitations of primary
storage. It has a huge storage capacity and the storage is permanent. Usually we store data,
programs and information in the secondary storage, but we have to give instruction explicitly
for this. Hard disk, CDs, DVDs, memory sticks, etc. are some examples.
4. Output unit
The information obtained after data processing is supplied to the outside world through
the output unit in a human-readable form. Monitor and printer are the commonly used output
devices. The functions performed by output unit can be concluded as follows:
a. Receives the results produced by the CPU in coded form.
b. Converts these coded results to human-readable form.
c. Supplies the results to the outside world.
Hardware
Peripherals
CPU
Processors
Central Processing Unit (CPU) / processor is responsible for all computing and decision-
making operations and coordinates the working of a computer. The performance of a CPU
determines the overall performance of the computer.
Since CPU is an Integrated Circuit (IC) package which contains millions of transistors and
other components fabricated into a single silicon chip, it is also referred as microprocessor. A
CPU is usually plugged into a large socket on the main circuit board (the motherboard) of the
computer. Since heat is generated when the CPU works, a proper cooling system is provided
with a heat sink and fan. Intel core i3, core i5, core i7, AMD Quadcore, etc. are some examples
of processors.
Registers
Registers are storage locations inside CPU, whose contents can be accessed more
quickly by the CPU than other memory. They are temporary storage areas for instructions or
data. They are not a part of memory; rather they are special additional storage locations that
offer computers the advantage of speed. Registers work under the direction of the control unit
to accept, hold, and transfer instructions or data and perform arithmetic or logical operations at
high speed. It speeds up the execution of programs. Important registers inside a CPU are:
a) Accumulator: The accumulator is a part of the Arithmetic Logic Unit (ALU). This
register is used to store data to perform arithmetic and logical operation. The result of
an operation is stored in the accumulator.
b) Memory Address Register (MAR): It stores the address of a memory location to
which data is either to be read or written by the processor.
c) Memory Buffer Register (MBR): It holds the data, either to be written to or read
from the memory by the processor.
d) Instruction Register (IR): The instructions to be executed by the processorare stored
in the instruction register.
e) Program Counter (PC): It holds the address of the next instruction to be
executed by the processor.
Motherboard
A motherboard is a large Printed Circuit Board (PCB) to which all the major components
including the processor are integrated.
The figure shows the motherboard and its components. It also provides expansion slots for
adding additional circuit boards like memory, graphics card, sound card, etc. The motherboard
must be compatible with the processor chosen.
Peripherals and Ports
Peripherals are devices that are attached to a computer system to enhance its capabilities.
Ports on the motherboard are used to connect external devices. Figure shows the various ports
in a computer system.
Peripherals include input devices, output devices, external storage and communication
devices. Peripheral devices communicate with the motherboard, through the ports available on
the motherboard like Video Graphics Array (VGA), IBM Personal System/2 (PS/2), Universal
Serial Bus (USB), Ethernet, High Definition Multimedia Interface (HDMI), etc.
Scroll wheel is used for scrolling the screen vertically or horizontally. The
different types of mouse are ball, optical and laser mouse. Ball mouse
works on the principle of the movement of the ball, whereas optical
mouse uses LED and laser mouses use laser beams for sensing the
movement. Laser mouse has more precise movements when compared to
other types of mouse.
Wired mouse, uses serial, PS/2 and USB ports to communicate, where
as a wireless mouse communicates with the computer via
radio waves.
Light pen A light pen is a pointing device shaped like a pen. The tip of the light
pen contains a light-sensitive element which when placed against the
screen, detects the light from the screen enabling the computer to
identify the location of the pen on the screen.
Light pens have the advantage of 'drawing' directly onto the screen.
They are used by engineers, artists, fashion designers for
Computer Aided Designing (CAD) and drawing purposes.
Touch screen It is an input device that allows the user to operate by simply
touching on the display screen. Some computers, tablets, smart
phones, etc. have touch sensitive display screens. It can also be
operated using a stylus which gives more precision.
Information kiosks at railway stations and bank ATMs also use touch
screens as input device.
Graphic tablet A graphics tablet consists of an electronic writing area and a special
"pen" that works with it. Graphic tablet allows artists to create
graphical images with motions and actions similar to traditional
drawing tools.
Joystick Joystick is an input device used for playing video games, controlling
training simulators and robots. Joysticks and other game controllers can
also be used as pointing device.
The joystick has a vertical stick which can move in any direction. It can
be used to control objects in a video game or to make menu selections by
the movement of a cursor displayed on the screen. It has a button on the
top that is used to select the option pointed by the cursor.
Microphone A microphone can be attached to a computer to input sound. It accepts
sound which is analogue in nature as input and converts it to digital
format. The digitized sound can be stored in the computer for processing
or playback.
Scanner Scanners can capture information, like pictures or text, and convert it
into a digital format that can be edited using a computer. The quality of
the image depends on the resolution of the scanner. The resolution of
the image scanned is expressed in Dots Per Inch (DPI). The higher the
DPI, the better the resolution.
The different variants of scanners are flat bed, sheet feed and hand held
scanner. A sheet feed scanner can scan a single sheet, whereas flatbed
can scan even from a book, but they are not portable. A hand held
scanner is portable but the scanning action is not smooth as the scanner
is moved manually.
Barcode/Quick A barcode is a set of vertical lines of different thickness and spacing that
Response (QR) represent a number. Barcode readers are devices that are used to input
code reader data from such set of barcodes (refer Figure). Hand-held scanners are
commonly seen in shops to scan codes and price information for each of
the items so that billing will be easier. Mobile phones with camera and
special software can also be used as a barcode reader, A QR code is
similar to barcodes. Barcodes are single dimensional whereas QR codes
are two dimensional as shown in Figure.
Smart card readers are used to access data in a smart card. It can be contact
type or contactless.
A contact type of reader requires physical contact with the cards, which is
made by inserting the card into the reader.
A contactless type of reader works with a radio frequency that
communicates when the card comes close to the reader. Many
contactless readers are designed specifically for toll gate payment in
transportation applications and person identity
applications.
Digital camera A digital camera can take pictures and videos and convert them
into digital format.
Pictures or videos taken using a digital camera are stored inside
its memory and can be transferred to a computer by connecting
the camera to it.
b. Output devices
Output devices are devices that print/display output from a computer. Outputs
generated by the output devices may be hardcopy output or softcopy output. Hardcopy outputs
are permanent outputs which can be used at a later date or when required. They produce a
permanent record on paper. The common output devices that produce hardcopy outputs are
printers and plotters. Softcopy outputs are electronic and are available on the screen in a digital
form. They do not produce a permanent record. A common softcopy output device is the
Visual Display Unit (VDU).
Flat panel monitor Flat panel displays are thinner, lighter in weight, consume
less power and emit less heat compared to CRT monitors.
Flat panel monitors are most commonly used in
computers, especially in laptops. Different types of flat
panel monitors are LCD Monitors, LED Monitors, Plasma
Monitors and OLED Monitors.
ii. Printer
Printers are used to produce hardcopy output. Based on the technology used, they can
be classified as impact or non-impact printers. Impact printers use the typewriting or printing
mechanism where a hammer strikes the paper through a ribbon in order to produce output. Dot-
matrix printers fall under this category. Non- impact printers do not touch the paper while
printing. They use different technologies to print characters on paper. Inkjet, Laser and Thermal
printers fall under this category of printers.
Two factors that determine the quality of a printer are its resolution and speed.
Resolution is measured in terms of DPI. Speed is measured in terms of number of characters
printed in a unit of time and is represented as characters per second (cps), lines per minute
(lpm), or pages per minute (ppm).
Dot Matrix Dot matrix printers use small electromagnetically activated pins in
Printer (DMP) the print head and an inked ribbon, to produce images by impact.
The most commonly used printer heads consist of 9 pins. Certain
printers use 24 pins for better print quality.
These printers are slow and noisy, and are not commonly used for
personal use. The Dot Matrix Printers are widely used at cash
counters in shops due to their low printing cost and for the reason
that we get carbon copies from them.
Inkjet printer Inkjet printers form the image on the page by spraying tiny droplets
of ink from the print head. The printer needs several colours of ink
(cyan, yellow, magenta and black) to make colour images. Some
photo-quality ink jet printers have more colours of ink. Ink jet
printers are inexpensive, but the cost of ink cartridges makes it a
costly affair in the long run.
laser printer A laser printer produces good quality output. The image to be
printed is transferred to a drum using a laser beam. The toner
powder from the toner cartridge is then sprayed on the drum. The
toner powder sticks onto the portions traced on the drum by the
laser beam. It is transferred to a paper by rolling the paper over the
drum. Through heating the owder is fused on to the paper.
Monochrome and colour laser printers are available. Colour laser
printers use multiple colour toner cartridges to produce colour
output and are expensive. Laser printers are faster and their speed
is rated in pages per minute (ppm).
Thermal Thermal printing produces a printed image by selectively heating
printer heat-sensitive thermal paper when it passes over the thermal print
head. The coating turns black in the areas where it is heated,
producing an image. Thermal printers print quiet and faster than dot
matrix printers. They are also smaller, lighter and consume less
power, making them ideal as portable printers. Thermal printers are
popular as printers at Point-of-Sale terminals
iii. Plotter
A plotter is an output device used to produce hardcopies of graphs and designs on the
paper. A plotter is typically used to print large-format graphs or maps such as construction
maps, engineering drawings and big posters. It is used in the design of cars, ships, aircrafts,
buildings, highways etc. Plotters are of two types: Drum plotters and Flatbed plotters.
Drum plotter A drum plotter is also known as roller plotter. It consists of a drum
or roller on which a paper is placed and the drum rotates back and
forth to produce the graph on the paper. It also consists of a
drawing arm that holds a set of coloured ink pens or pencils. The
drawing arm moves side to side as the paper is rolled back and
forth through the roller. In this way, a perfect graph or map is
created on the
paper.
Flatbed plotter A flatbed plotter is also known as table plotter. It plots on paper that is
spread and fixed over a rectangular flatbed table. The flatbed plotter uses
two drawing arms, each of which holds a set of coloured ink pens or
pencils. The drawing arms move over the stationary paper and draw the
graph on the paper. Flatbed plotter is very slow in drawing or printing
graphs. The large and complicated drawing can take several hours to print.
For high quality sound reproduction computers use 2.1 (3 speakers), 5.1 (5speakers)
and 7.1 (7 speakers) speaker systems.
Memory
Memory is a place where we can store data, instructions and results temporarily or
permanently. Memory can be classified into two: primary memory and secondary memory.
Primary memory holds data, intermediate results and results of ongoing jobs temporarily.
Secondary memory on the other hand holds data and information permanently. Before
learning more about memory, let us discuss the different memory measuring units.
a. Primary storage
Primary memory is a semiconductor memory that is accessed directly by the CPU. It is
capable of sending and receiving data at high speed. This includes mainly three types of
memory such as RAM, ROM and Cache memory.
i. Random Access Memory (RAM)
RAM refers to the main memory that microprocessor can read from and write to. Data can
be stored and retrieved at random from anywhere within the RAM, no matter where the data
is. Data or instructions to be processed by the CPU must be placed in the RAM. The contents
of RAM are lost when power is switched off. Therefore, RAM is a volatile memory. Storage
capacity of RAM is 2 GB and above
The speed of a RAM refers to how fast the data in memory is accessed. It is measured in Mega
Hertz (MHz). When a computer is in use, its RAM contains the following:
1. The operating system software.
2. The application software currently being used
3. Any data that is being processes.
ii. Read Only Memory
ROM is a permanent memory that can perform only read operations and its contents
cannot be easily altered. ROM is non-volatile; the contents are retained even after the power
is switched off. ROM is used in most computers to hold a small, special piece of 'boot up'
program known as Basic Input Output System (BIOS).
This software runs when the computer is switched on or 'boots up'. It checks the computer's
hardware and then loads the operating system. It is slower than RAM. Figure shows a typical
ROM chip.
There are some modified types of ROM that include:
1. PROM - Programmable ROM which can be programmed only once. PROM's are
programmed at the time of manufacture.
2. EPROM - Erasable Programmable ROM that can be erased using ultra violet
radiation and can be programmed using special electronic circuits.
3. EEPROM - Electrically Erasable Programmable ROM which can be erased and
rewritten electrically.
Table shows the comparison between RAM and ROM.
Hard disk
The hard disk consists of metal disks coated with magnetic material concealed in dust
free containers. Hard disks have very high storage capacity, high data transfer rates and low
access time. It is more durable and less error prone. It is the most common secondary storage
device used in computers.
A hard disk may contain one or more platters. Each platter requires two read/write
heads, one for each surface. A tiny electromagnetic read/write head attached to an access arm
magnetizes tiny spots on the disk to store data as shown in Figure.
The same electromagnetic head can later sense the magnetic fields of the spots, allowing
the data to be read back from the disk.
Data is stored on the surface of a platter in sectors and tracks. Tracks are concentric circles
on a platter and a sector is a pie-sliced part of a disk platter as shown in Figure. Formatting is
the activity of creating sectors and tracks on the disk. Only then can read/write operation be
performed on the disk. If a disk having data is formatted, then all data will be lost.
Large disks can be partitioned logically into distinct sections or volumes.
These volumes are independent of each other and can be formatted independently.
The laser beam reads this pits and lands as 0s and 1s. It is very cheap to manufacture optical
disks in large quantities and are a popular secondary storage medium. The main types of
optical disks are CD, DVD and Blu-Ray.
Blu-ray DVD
Blu-ray is an optical disk format developed to enable recording, rewriting and
playback of High Definition (HD) video as well as storing huge amounts of data. CD
and DVD technologies use red laser to read and write data while Blu-ray format uses
a blue-violet laser. Hence it has the name Blu-ray. The benefit of using a blue-violet
laser is that it has a shorter wavelength than a red laser, which makes it possible to
focus the laser spot with greater precision. This allows data to be packed more tightly.
Therefore, it is possible to store more data on the disk even though it is of the same
size of a CD/DVD. The format offers more than five times the storage capacity of
traditional DVDs and can hold up to 25 GB on a single-layer disc and 50 GB on a dual-
layer disc.
A flash drive is a small external storage device, which consists of flash memory
typically the size of a human thumb. USB flash drives are portable and rewritable. The
storage capacity of a USB drive currently varies from 2 GB to 32 GB.
35
Flash memory cards
Memory card is another type of flash memory. They are flat and
have a size of about 1 inch × 0.75 inch with a thickness of about 2 mm.
Memory cards currently have storage capacities in the range of 1 GB - 32
GB. Flash memory cards also have a smaller version which is used within
cell phones, tablets, etc. (refer Figure). These smaller cards are about 6
mm × 3mm in size and are less than 1 mm thick.
Learning outcomes
After the completion of this chapter the learner will be able to
To know about Computers
To learn about various generations of computer
To understand the basic operations of computers
To know the components and their functions.
To know about booting of a computer
To know the concept of Memory and its types
Use of different types of input and output devices.
36
37
Lecture 2
Introduction
A computer system consists of hardware, the electronic devices that are capable of
computing and manipulating information, and software (set of instructions) that carries out
predefined tasks to complete a given job. As we know, a computer cannot think or perform on its
own. It performs operations like addition, subtraction, multiplication, and division only when the
user instructs it to do so. The user issues instructions and the CPU acts in accordance with the
instructions. The sets of instructions, which control the sequence of operations, are known as
programs, and collectively programs are called software. This chapter deals with software and its
types in detail.
Software
Software is a general term used to denote a set of programs that help us to use
computer system and other electronic devices efficiently and effectively. If hardware is
said to form the body of a computer system.
The software can be categorized as:
1. System software
2. Application software
3. Utility Software
1. System software
It is a set of one or more programs designed to control the operations of a computer. They
are general programs designed to assist humans in the use of computer system by performing
tasks such as controlling the operations, move data into and out of a computer system and to do
all the steps in executing application programs. In short, system software supports the running of
other software, its communication with other peripheral devices. It helps the users to use computer
in an effective manner. It implies that system software helps to manage resources of the computer.
Figure depicts how system software interfaces with user and hardware.
System software is a set of system programs which aids in the execution of a general
user's computational requirements on a computer system. The following are the components of
system software.
a. Operating system
b. Language processors
c. Utility software
a. Operating system
Operating system is a set of programs that acts as an interface between the user and
computer hardware. The primary objective of an operating system is to make the computer system
convenient to use. Operating system provides an environment for user to execute programs. It
also helps to use the computer hardware in an efficient manner.
Operating system controls and co-ordinates the operations of a computer. It acts as the
resource manager of the computer system. Operating system is the most important system
software. It is the first program to be loaded from hard disk in the computer and it resides in the
memory till the system is shut down. It tries to prevent errors and the improper use of computer.
2
Major functions of an operating system
The major functions of an Operating System are process management, memory
management, file management, security management and command interpretation
i. Process management
By the term process we mean a program in execution. The process management
module of an operating system takes care of the allocation and de allocation of processes
and scheduling of various system resources to the different requesting processes.
ii. Memory management
Memory management is the functionality of an operating systemwhich handles
or manages primary memory. It keeps track of each and every memory location to ensure
whether it is allocated to some process or free. It calculates how much memory is to be
allocated to each process and allocates it. It de- allocates memory if it is not needed
further.
iii. File management
The file management module of an operating system takes care of file related
activities such as organizing, naming, storing, retrieving, sharing, protection and
recovery
iv. Device management
Device management module of an operating system performs the management
of devices attached to the computer. It handles the devices by combining both hardware
and software techniques. The OS communicates with the hardware device via the
device driver software.
Examples of various operating systems are DOS, Windows, Unix, Linux, Mac OS X, etc.
3
b. Language processors
We know that natural languages are the medium of communication among human beings.
Similarly, in order to communicate with the computer, the user also needs to have a language
that should be understood by the computer. Computer languages may be broadly classified into
low level languages and high-level languages.
Low-level languages are described as machine-oriented languages. In these languages,
programs are written using the memory and registers available on the computer. Since the
architecture of computer differs from one machine to another, there is separate low-level
programming language for each type of computer. Machine language and assembly language are
the different low-level languages.
Machine language
We know that a computer can understand only special signals, which are represented by
1s and 0s. These two digits are called binary digits. The language, which uses binary digits, is
called machine language. Writing a program in machine language is definitely very difficult. It
is not possible to memories a long string of 0s and 1s for every instruction.
Assembly language
Assembly language is an intermediate-level programming language. Assembly languages
use mnemonics. Mnemonic is a symbolic name given to an operation.
For example, ADD for addition operation, SUB for subtraction operation, etc. It is easier
to write computer programs in assembly language as compared to machine language. It is
machine dependent and programmer requires knowledge of computer architecture.
4
Compiler:
Compiler is also a language processor that translates a program written in high level
language into machine language. It scans the entire program in a single run. If there is any error
in the program, the compiler provides a list of error messages along with the line number at the
end of the compilation. If there are no syntax errors, the compiler will generate an object file.
Translation using compiler is called compilation. After translation compilers are not required in
memory to run the program. The programming languages that have a compiler are C, C++,
Pascal, etc.
Figure shows process involved in the translation of assembly language and high-level
language programs into machine language programs
2. Application software
Software developed for specific application is called application software. It includes
general purpose software packages and specific purpose software. GIMP, Payroll System, Airline
Reservation System, Tally, etc. are examples of application software.
5
Spreadsheet software:
Spreadsheet software allows users to perform calculations using spreadsheets. They
simulate paper worksheets by displaying multiple cells that make up a grid. It also allows us to
insert drawing objects in the worksheet and create different types of charts for graphical
representation of numerical data. Microsoft Excel, Open Office Calc, Lotus 1-2-3 and Apple
Numbers are some examples of spreadsheet software.
Presentation software:
The software that is used to display information in the form of a slide show is known as
presentation software. Presentation software allows preparing slides containing pictures, text,
animation, video and sound effects. Microsoft PowerPoint and Open Office Impress are
examples for presentation software.
Database software:
Database is an organized collection of data arranged in tabular form. Database
Management System (DBMS) consists of a collection of interrelated data and a set of programs
to access those data. The primary goal of a DBMS is to provide an environment that is both
convenient and efficient to use in retrieving and storing database information. They provide
privacy and security to data and enforce standards for data. Examples of DBMS software are
Microsoft Access, Oracle, PostgreSQL, My SQL, etc.
Multimedia software:
Multimedia is the integration of multiple forms of media. This includes text, graphics,
audio, video, etc. Multimedia software can process information in a number of media formats. It
is capable of playing media files. Some multimedia software allows users to create and edit audio
and video files. Audio converters, audio players, and video editing software are some forms of
multimedia software. Examples are VLC Player, Adobe Flash, Real Player, Media Player, etc.
6
3. Utility software
Utility software is a set of programs which help users in system maintenance tasks and in
performing tasks of routine nature. Some of the utility programs with their functions are listed
below:
Compression tools:
Large files can be compressed so that they take less storage area. These compressed files
can be decompressed into its original form when needed. Compression of files is known as
zipping and decompression is called unzipping. WinZip, WinRAR, etc. are examples of
compression tools.
Disk defragmenter:
Disk defragmenter is a program that rearranges files on a computer hard disk. The files are
arranged in such a way that they are no longer fragmented. This enables the computer to work
faster and more efficiently.
Backup software:
Backup means duplicating the disk information so that in an event of disk failure or in an
event of accidental deletion, this backup may be used. Backup utility programs facilitates the
backing up of disk.
Antivirus software:
A computer virus is a program that causes abnormality in the functioning of a computer.
Antivirus software is a utility program that scans the computer system for viruses and removes
them. As new viruses are released frequently, we have to make sure that latest antivirus versions
are installed on the computer. Most of the antivirus
programs provide an auto-update feature which enables the user to download profiles of
new viruses so as to identify and inactivate them. Norton Antivirus, Kaspersky, etc. are examples
of antivirus software.
Software terminologies:
a) Firmware,
b) Liveware,
c) Freeware and Shareware,
d) Commercial software,
e) Proprietary software,
f) Semi-free software.
7
a) Firmware
Firmware had read-only memory (ROM) and programmable read-only memory (PROM).
It was designed to be permanent. Eventually PROM chips could be updated and were called
erasable programmable read-only memory (EPROM). But EPROM was expensive, time
consuming to update and challenging to use. Firmware eventually evolved from ROM to flash
memory firmware; thus, it became easier to update and user friendly.
There are levels of firmware:
Subsystems:
These have their own fixed microcode embedded in flash chips, CPUs and LCD units. A
subsystem is usually considered part of the hardware device as well as high level firmware.
BIOS, modems and video cards are usually easy to update. But firmware in storage
devices usually gets overlooked; there are no standardized systems for updating firmware.
Fortunately, storage devices do not need to be updated often.
8
c) Freeware and shareware
Freeware refers to copyrighted computer software which is made available for use free of
charge for an unlimited period. The term shareware refers to commercial software that is
distributed on a trial basis. It is distributed without payment and with limited functionality.
Shareware is commonly offered in a downloadable format on the Internet. The distribution of this
kind of software aims at giving the users a chance to analyses the software before purchasing it.
Some shareware works for a limited period of time only.
Table highlights a comparison between freeware and shareware:
d) Commercial Software
Commercial software is any software or program that is designed and developed for
licensing or sale to end users or that serves a commercial purpose. Commercial software was
once considered to be proprietary software, but now a number of free and open-source software
applications are licensed or sold to end users. Off-the-shelf software programs, such as games or
those sold in computer specialty stores or even music stores and grocery stores, are some
examples of commercial software.
Example:
Microsoft products such as the Windows Operating System and MS Office are some of
the most well-known examples of commercial software.
Commercial software is normally licensed, not sold. It was once the domain of proprietary
software, developed from scratch by a specific company to solve a specific problem or fill a
specific niche and then licensed or sold to the people or organizations that needed them. This type
of software includes financial, marketing and accounting software. During the last decades,
however, some open-source applications have also become commercial software, licensed to
customers as is or as part of a service.
Contrary to popular belief, open-source software does not necessarily mean free software.
Depending on the distribution license, the former can be considered commercial software but
comes with the source code to allow customization. Some commercial software applications may
also be used freely for non-commercial use.
9
e) Proprietary software
Proprietary software is a computer program that is an exclusive property of its developer
or publisher and cannot be copied or distributed without licensing agreements. It is sold
without any access to source code and is therefore not possible to change or improve by the
user. Some examples of proprietary software are Microsoft Windows Operating System, MS
Office, Mac OS, etc.
Free and open source software Free and open source software gives the user the
freedom to use, copy, distribute, examine, change and improve the software. Nowadays free
and open source software is widely used throughout the world because of adaptable
functionality, less overall costs, vendor independency, adherence to open standards,
interoperability and security.
The Free Software Foundation (FSF) defines the four freedoms for free and open
source software:
Freedom 0 - The freedom to run program for any purpose.
Freedom 1 - The freedom to study how the program works and adapt it to your
needs. Access to source code should be provided.
Freedom 2 - The freedom to distribute copies of the software.
Freedom 3 - The freedom to improve the program and release your
improvements to the public, so that the whole community benefits.
The following are some of the examples of free and open source software:
GNU/Linux: GNU/Linux is a computer operating system assembled under the model
of free and open source software development and distribution. It was organized in
the
GNU project introduced in 1983 by Richard Stallman in the FSF.
GIMP: It stands for GNU Image Manipulation Program. It is an image editing
software. It can be used for retouching photographs, creating and editing images. It
supports graphic files of different formats and allows converting from one format to
another.
Mozilla Firefox: It is one of the most popular web browsers created by the Mozilla
Corporation. It provides added security features for safe browsing.
OpenOffice.org: It is a complete office suite that contains word processor (Writer) to
prepare and format documents, spreadsheets (Calc) and presentations (Impress). It
works on both Linux and Windows platforms.
f) semi-free software
It refers to any software that is not free but gives permission to individuals to use,
copy, distribute, and modify the software for non-profit purposes only. The Free
Software Foundation (FSF) also includes the ability to distribute modified versions
in its definition of semi-free software.
Learning outcomes
After the completion of this chapter, the learner will be able to
To know software and types of software.
To understand the function of operating system.
To learn about software terminologies
10
11
Lecture 3
Internet - World Wide Web – URL – Domain names - Protocols: HTTP, HTTPS
Internet Applications: Email, File sharing web apps, Social Networks, Online
shopping, Video Conferencing
HTML: Introduction, Editor, HTML Documents – Tags: <head>, <body>, <title>,
<heading>, <paragraph>, </br>, <table>, <li>, <ul>, <href>, <img>, <hr> and
<marquee>.
Computer Network
• A computer network, often simply referred to as a network.
• It is a collection of computers and devices interconnected by communications channels
that facilitate communications and allows sharing of resources and information among
interconnected devices.
• Networks may be classified according to a wide variety of characteristics
• Communication medium used to transport the data (Wired, wireless)
• Communications protocol (TCP, IP...)
• Scale (LAN, PAN, and MAN, WAN.)
• Topology (Bus, Ring, Star) - system arrangement
Types of Network
Local Area Network (LAN)
A computer network that spans a relatively small area.
Most LANs are confined to a single building or group of buildings. However, one LAN
can be connected to other LANs over any distance via telephone lines and radio waves.
Most LANs connect workstations and personal computers. Each node (individual
computer ) in a LAN has its own CPU with which it executes programs, but it also is able
to access data and devices anywhere on the LAN. This means that many users can share
expensive devices, such as laser printers, as well as data.
Users can also use the LAN to communicate with each other, by sending e-mail or
engaging in chat sessions.
There are many different types of LANs Ethernets being the most common for PCs.
The following characteristics differentiate one LAN from another:
Topology : The geometric arrangement of devices on the network. For example, devices
can be arranged in a ring or in a straight line.
Protocols: The rules and encoding specifications for sending data. The protocols also
determine whether the network uses a peer-to-peer or client/server architecture.
Media: Devices can be connected by twisted-pair wire, coaxial cables, or fiber optic
cables. Some networks do without connecting media altogether, communicating instead
via radio waves.
Advantages
LANs are capable of transmitting data at very fast rates, much faster than data can be
transmitted over a telephone line; but the distances are limited, and there is also a
limit on the number of computers that can be attached to a single LAN.
WAN technologies generally function at the lower three layers of the OSI reference model: the
physical layer, the data link layer, and the network layer.
• A WAN typically consists of two or more LANs.
• The computers are farther apart and are linked by telephone lines, dedicated telephone
lines, or radio waves.
Network adapter
Hub
A hub joins multiple computers (or other network devices) together to form a single network
segment. On this network segment, all computers can communicate directly with each other.
A hub includes a series of ports that each accept a network cable. Small hubs network four
computers. They contain four or sometimes five ports, the fifth port being reserved for "uplink"
connections to another hub or similar device. Larger hubs contain eight, 12, 16, and even 24 ports.
A sending computer transmits its signal to a hub, the hub then retransmits the signal to all
other computers.
Bandwidth can be shared by all connected computer.
• When A sends to C, the Hub receives signal from A and retransmits it to both B and C.
• Only C then processes the signal.
Switch
A network switch is a small hardware device that joins multiple computers together within one
local area network (LAN).
Network switches appear nearly identical to network hubs, but a switch generally contains more
intelligence (and a slightly higher price tag) than a hub.
Unlike hubs, network switches are capable of inspecting data packets as they are received,
determining the source and destination device of each packet, and forwarding them appropriately.
By delivering messages only to the connected device intended, a network switch conserves
network bandwidth and offers generally better performance than a hub.
Router
Routers are physical devices that join multiple wired or wireless networks together.
• A router is a device that forwards data packets between telecommunications
networks.
• A router is connected to two or more data lines from different networks. When data
comes in on one of the lines, the router reads the address information in the packet to
determine its ultimate destination. Then, using information in its routing table, it
directs the packet to the next network on its journey or drops the packet.
• A data packet is typically forwarded from one router to another through networks that
constitute the internetwork until it gets to its destination node.
• The most familiar type of routers are home and small office routers that simplypass
data, such as web pages and email, between the home computers and the owner's
cable or DSL modem, which connects to the Internet (ISP).
Wi-Fi Hotspot
• Access point in wireless LAN (Wi-Fi) functions like a hub or a switch in wired
network.
• It connects computers or devices together to create a wireless network.
• Some access points come as a multi-function device that incorporates the functions of
switch, bridge, router, or broadband modem.
• An area that is within a Wi-Fi network coverage is popularly known as hotspot.
• Many public places such as airports, hotels, and cafes provide public Wi-Fi hotspots that
have broadband connection to the Internet. Such hotspots can be accessed by the public for
free or with a fee.
A hotspot is a site that offers Internet access over a wireless local area network through the use
of a router connected to a link to an Internet service provider. Hotspots typically use Wi-Fi
technology.
IP Address
An Internet Protocol address (IP address) is a numerical label assigned to each device
(e.g., computer, printer) participating in a computer network that uses the Internet Protocol for
communication.
IP address as a 32-bit number[1] and this system, known as Internet Protocol Version 4 (IPv4),
is still in use today.
However, due to the enormous growth of the Internet and the predicted depletion of available addresses,
a new addressing system (IPv6), using 128 bits for the address, was developed in 1995.
IP addresses are binary numbers, but they are usually stored in text files and displayed in human-
readable notations, such as 172.16.254.1 (for IPv4).
IP version 4 addresses
In IPv4 an address consists of 32 bits which limits the address space to 4294967296 (232) possible
unique addresses. IPv4 reserves some addresses for special purposes such as private networks.
The first three bits of the most significant octet of an IP address were defined as the class of the
address. Three classes (A, B, and C) were defined for universal unicast addressing. Depending
on the class derived, the network identification was based on octet boundary segments of the
entire address. Each class used successively additional octets in the network identifier, thus
reducing the possible number of hosts in the higher order classes (B and C). The following table
gives an overview of this now obsolete system.
The IPv4 address space can be subdivided into 5 classes - Class A, B, C, D and E. Each class
consists of a contiguous subset of the overall IPv4 address range.
the values of the leftmost four bits of an IPv4 address determine its class as follows:
Class Leftmost bits Start address Finish address
A 0xxx 0.0.0.0 127.255.255.255
B 10xx 128.0.0.0 191.255.255.255
C 110x 192.0.0.0 223.255.255.255
D 1110 224.0.0.0 239.255.255.255
E 1111 240.0.0.0 255.255.255.255
All Class C addresses, for example, have the leftmost three bits set to '110', but each of the
remaining 29 bits may be set to either '0' or '1' independently (as represented by an x in these bit
positions):
The IPv4 networking standard defines Class D addresses as reserved for multicast. Multicast is
a mechanism for defining groups of nodes and sending IP messages to that group rather than to
every node on the LAN (broadcast) or just one other node (unicast).
Internet
The Internet started as a small network through a project by the United States Department
of Defense by the name ARPANET (Advanced Research Projects Agency Network).
During 1970s this military network was connected to the computers of Universities and
companies that worked for the Department of Defense. In 1984 the military network split
from ARPANET to form MILNET to be used by the American military only.
ARPANET which used TCP/IP protocol for communication was thereafter used for
scientific research and information sharing. Later, several other networks merged with
ARPANET to form a large network. ARPANET is considered as the first wide area network
(WAN).
Vinton Gray Cerf who was instrumental in the development of Internet and TCP/IP
protocol, is considered as the father of Internet.
In 1989, Tim Berners Lee, a researcher, proposed the idea of World Wide Web
(WWW).
Tim Berners Lee and his team are credited with inventing Hyper Text Transfer Protocol
(HTTP), HTML and the technology for a web server and a web browser. Using hyperlinks
embedded in hypertext the web developers were able to connect web pages. They could
design attractive webpages containing text, sound and graphics. This change witnessed a
massive expansion of the Internet in the 1990s.
Various types of computers loaded with diverse operating systems in different
organizations at geographically distant locations joined this network making it a global
phenomenon.
TCP/IP protocol is used as the communication protocol for Internet. Any computer that
joins Internet should follow the TCP/IP protocol.
In 1998, Internet Corporation for Assigned Names and Numbers (ICANN) was
established.
ICANN does not control the Internet content; rather it develops policies on the Internet’s
Uniform Resource Locators (URL).
Today, Internet is the largest public network that connects billions of computers all over
the world and provides several services like searching, e-mail, file transfer, social
networking, etc.
• Data transfer rate is the average number of bits transferred between devices inunit
time.
1 kbps = 1000 bits per second 1
Mbps = 1000 kbps
1 Gbps = 1000 Mbps
• The main factor that decides Internet access speed is the type of connectivity we choose
to link to the Internet. Internet connectivity is classified based on the speed of the
connection and the technology used. They can be broadly classified as dial- up
connectivity, wired broadband connectivity and wireless broadband connectivity.
• The data transfer rates of each type of connectivity may vary as technology
advances.
Services on Internet
• The internet offers a variety of services. Services like WWW, e-mail, search engines,
social media, etc. are widely used throughout the globe. In this section we shall discuss
some of the services of Internet.
• The World Wide Web (WWW) is a system of interlinked hypertext documents accessed
via the Internet. It is a service on the Internet that uses Internet infrastructure. WWW is a
huge client-server system consisting of millions of clients and servers connected together.
• Each server maintains a collection of documents and they can be accessed using a
reference called Uniform Resource Locator (URL).
• These documents may contain, text, images, videos and other multimedia content. It may
also contain hyperlinks to documents on different servers.
• Selecting a hyperlink results in a request to fetch that document/web page from the server
and display it.
• The WWW works by establishing hypertext links between documents anywhere on the
network. Clients can access the documents on the servers using software called browser.
A browser is responsible for properly displaying the documents.
a. Browser
• A web browser is a software that we use to retrieve or present information and to navigate
through web pages in the World Wide Web. The document to be displayed is identified
using a URL.
• A URL consists of its DNS name and the file name to be retrieved. It also specifies the
protocol for transferring the document across the network. A browser is capable of
displaying text, images, hypertext links, videos, sounds, scripts (program code inside a
web page), etc. in a web document/page. Most of WWW documents are created using Hyper Text
Markup Language (HTML) tags and are called web pages.
• The web browser interprets these tags and displays a formatted page. It allows us to
navigate through web pages using the hyperlinks available in web pages.
• Some common browsers are Google Chrome, Internet Explorer, Mozilla Firefox, Opera,
and Safari. Icons of some popular browsers are shown in Figure. Some of these browsers
have a mobile version that can be used in mobile operating systems.
Some of the most popular web search engine sites are Google, Bing, Yahoo Search, Ask, etc.
Figure shows the search results of different search engines.
URL
(Uniform Resource Locator)
URL stands for Uniform Resource Locator. URL is a formatted text string used by web
browsers, email clients and other software to identify a network resource on the Internet.
Every resource on the Internet has a unique URL. Network resources are files that can
be plain web pages, other text documents, graphics, programs, etc.
URL consists of letters, numbers and punctuations. URL string can be divided into
three parts.
a) Network protocol - used to access the file resource
b) Domain name (Host name or address) - identifies a specific computer on the
Internet
c) File name- hierarchical description that specifies the location of a file in that
computer
For example, the URL http://www.tnau.ac.in/index.html has three parts as shown in Figure The
detailed description of these three parts are given below:
The protocol enables the browser to know what protocol is used to accessthe
information specified in the domain.
b. Domain name
Domain name is the name assigned to a server through the Domain Name System
(DNS). Domain names are used in URLs to identify the particular web server.
Domain names provide Internet users with a short name that is easy to remember.
Whenever we have to communicate with a computer on Internet, we can do so by
using its IP address. But it is practically impossible for a person to remember the IP
addresses of all the computers, one may have to communicate with. Therefore, a
system has been developed which assigns names to computers (web servers) and
maintains a database of these names and their corresponding IP addresses. These
names are called domain names. Examples of some domain names are
dhsekerala.gov.in, keralaresults.nic.in, google.com, gmail.com, etc.
A domain name usually has more than one part: top level domain name or primary
domain name and sub-domain name(s). For example, in the domain name above, ‘in’
is the primary domain name; ‘gov’ is the sub-domain of in and ‘dhsekerala’ is the
subdomain of ‘gov’. There are only a limited number of top-level domains and these
are divided into two categories: Generic Domain Names and Country-Specific
Domain
Names. Examples of generic and country specific domain names are given in Table
c. File name
It is the file to be opened. In the example given in Figure 'index.html' is the file that
is to be accessed from the web server specified by the domain name.
Domain Name System (DNS)
DNS stands for Domain Name System.
DNS returns the IP address of the domain name, that we type in our web browser’s
address bar. (like mobile phone automatically dialing the phone number when we select
a name from contact list).
The DNS system has its own network. DNS implements a database to store domain
names and IP address information of all web sites on the Internet. DNS assumes that
IP addresses do not change (statically assigned). If one DNS server does not know
how to translate a particular domain name, it asks another one, and so on, until the
correct IP address is returned.
Network protocols
A network protocol is the special set of rules to be followed in a network when devices
in the network exchange data with each other. Each protocol specifies its own rules for
formatting data, compressing data, error checking, identifying and making connections
and making sure that data packets reach its destination.
Several computer networks protocols have been developed for specific purposes and
environments. Some commonly used protocols are TCP/IP, SPx/IPx etc.
TCP/IP
TCP/IP, Transmission Control Protocol/Internet Protocol, is a suite of communications
protocols used to interconnect network devices on the local networks and the Internet.
TCP/IP defines rules for how electronic devices (like computers) should be connected to
the Internet and how data should be transmitted between them.
When data is to be sent from one computer to another over Internet, it is first broken into
smaller packets by TCP and then sent. When these packets are received by the receiving
computer, TCP checks packets for errors. If errors are found, TCP submits requests for
retransmission; else packets are assembled into the original message according to the
rules specified in TCP protocol. Figure shows the steps involved
in the working of TCP/IP protocol. Delivery of each of these packets to the right destinations is
done by Internet protocol (IP). Even though different packets of the same message may be routed
differently, they will reach the same destination and get reassembled there. HTTP, FTP and DNS
are three sub protocols of TCP/IP protocol suite.
HTTP
HTTP stands for Hypertext Transfer Protocol. It is a standard protocol for transferring
requests from client-side and to receive responses from the server-side. The HTTP client
(browser) sends a HTTP request to the HTTP server (web server) and server responds with
a HTTP response. This pair of request and response is called an HTTP session (refer Figure
8.35). The response from the server can be static such as a file already stored on the server,
or dynamic, such as, the result of executing a piece of code by the server as per the request
from the client.
The two important characteristics of HTTP are
HTTP is transmission medium independent.
HTTP is stateless (The server and client are aware of each other only during a request or
response. Afterwards, each forgets the other).
HTTPS
Hypertext transfer protocol secure (HTTPS) is the secure version of HTTP, which is the
primary protocol used to send data between a web browser and a website. HTTPS is
encrypted in order to increase security of data transfer. This is particularly important
when users transmit sensitive data, such as by logging into a bank account, email service,
or health insurance provider.
Any website, especially those that require login credentials, should use HTTPS
Before encryption:
This is a string of text that is completely readable
After encryption:
ITM0IRyiEhVpa6VnKyExMiEgNveroyWBPlgGyfkflYjDaaFf/Kn3bo3OfghBPDWo6
AfSHlNtL8N7ITEwIXc1gU5X73xMsJormzzXlwOyrCs+9XCPk63Y+z0=
In websites without HTTPS, it is possible for Internet service providers (ISPs) or other
intermediaries to inject content into webpages without the approval of the website owner.
HTTPS eliminates the ability of unmoderated third parties to inject advertising into web
content.
FTP
FTP stands for File Transfer Protocol.
It is a standard for exchanging of data and program files across a network. FTP is the
easiest way to transfer files between computers via the Internet. It uses TCP and IP to
perform uploading and downloading.
An FTP client program installed in the computer can help in the uploading (sending files
to another computer) and downloading (receiving files from another computer) of files.
FTP uses client-server architecture in servers with security features, username and
password protection for file transfer. An FTP client program (Filezilla, Cute FTP, etc)
installed in the computer can help in the easy uploading and downloading of files.
Internet Applications: Email, File sharing web apps, Social Networks, Online
shopping, Video Conferencing
a. E-mail
• E-mail enables us to contact any person in the world in a matter ofseconds. Billions
of e-mail messages are sent over the Internet every day.
• Electronic mail or e-mail is a method of exchanging digital messages between
computers over Internet.
• E-mail has become an extremely popular communication tool.
• The e-mail will be delivered almost instantly in the recipient’s mail box (Inbox). Apart
from text matter, we can send files, documents, pictures, etc. as attachment along with e-
mail.
• The same email can be sent to any number of people simultaneously. Figure shows
a sample e-mail message.
Sections of an e-mail
• A client software gives provisions to enter the following sections.
To (Recepient Address) A box to provide the e-mail addresses of the primary
recipients to whom the e-mail has to be sent.
Working of e-mail
• When an e-mail is sent from your computer using web mail or e-mail client
software, it reaches the e-mail server of our e-mail service provider.
• From there the message is routed from sender’s e-mail server all the way to the
recipient’s email server.
• The recipient’s e-mail server then delivers the e-mail to the recipient’s mail box
(inbox), which stores the e-mail and waits for the user to read it. Simple Mail
Transfer Protocol (SMTP) is used for e-mail transmission across Internet.
• Figure shows the working of e-mail.
Fig.: Working of e-mail
• Speed: An e-mail is delivered instantly to any location across the globe. We can
send the same e-mail to multiple users simultaneously.
• Easy to use: We can send and receive e-mails, organize our daily conversations and
save them easily on our computer.
• Provision of attachments: The attachment feature allows to send pictures, files,
documents, etc. along with e-mail.
• Environment friendly: E-mails do not use paper and save a lot of trees from being
cut down.
• Reply to an e-mail: When we need to reply to an e-mail, we can use the provision of
attaching previous e-mails as reference. It helps to refresh the recipient about the
subject.
• Cost-effective: When compared to fax or conventional mail, e-mail is less
expensive.
• Available anywhere anytime: Messages can be read at user’s convenience. Access
to mail box is available anytime. The e-mail service, though beneficial in our daily
life, can be misused in different ways as listed below.
• E-mails may carry viruses: Viruses send along with e-mail can harm our computer
system. Viruses can also illegally access our e-mail address book and spread virus
infected messages to all email addresses in it.
• Junk mails: Checking and deleting unwanted mails consume a lot of time.
Google Drive
Google Drive is a file storage and synchronization service developed by Google.
Launched on April 24, 2012, Google Drive allows users to store files on their servers,
synchronize files across devices, and share files.
In addition to a website, Google Drive offers apps with offline capabilities for
Windows and macOS computers, and Android and iOS smartphones and tablets.
Google Drive encompasses Google Docs, Google Sheets, and Google Slides, which are
a part of an office suite that permits collaborative editing of documents, spreadsheets,
presentations, drawings, forms, and more.
Files created and edited through the office suite are saved in Google Drive. Google
Drive offers users 15 gigabytes of free storage through Google One. Google One also
offers 100 gigabytes, 200 gigabytes, 2 terabytes, 10 terabytes, 20 terabytes, and 30
terabytes offered through optional paid plans.
Files uploaded can be up to 5 terabytes in size. Users can change privacy settings for
individual files and folders, including enabling sharing with other users or making
content public. On the website
iCloud
The best place for all your photos, files, and more.
iCloud was launched in 2011 as the successor to MobileMe and is Apple’s current
cloud service that allows iOS and Mac users to save and synchronize information.
Apple includes 5GB of iCloud storage for free.
FileDrop
It's a small and simple file sharing tools available from Sandstorm's app
marketplace.
FileDrop is easy to use. Install it, then create a new instance of the application (called
a drop). After that, upload some files to the drop. With a click or two, send an email
to the person you want to share the drop with. They get a link and access to whatever
you put in the drop.
FileDrop is quick, it's basic, and it's simple. But it does the job.
Dropbox
Dropbox is a file hosting service operated by the American company Dropbox, Inc.,
headquartered in San Francisco, California, that offers cloud storage, file
synchronization, personal cloud, and client software.
Dropbox was founded in 2007 by MIT students Drew Houston and Arash Ferdowsi as
a startup company, with initial funding from seed accelerator Y Combinator.
Dropbox has been praised, receiving the Crunchie Award in 2010 for Best Internet
Application, and Macworld's 2009 Editor's Choice Award for Software.
Dropbox brings files together in one central place by creating a special folder on the
user's computer. The contents of these folders are synchronized to Dropbox's servers
and to other computers and devices where the user has installed Dropbox, keeping the
same files up-to-date on all devices.
Dropbox uses a freemium business model, where users are offered a free account
with a set storage size, with paid subscriptions available that offer more capacity and
additional features.
Dropbox Basic users are given two gigabytes of free storage space.
Dropbox Plus users are given two terabytes of storage space, as well as additional
features, including advanced sharing controls, remote wipe, and an optional Extended
Version History add-on.
Dropbox offers computer apps for Microsoft Windows, Apple macOS, and Linux
computers, and mobile apps for iOS, Android, and Windows Phone smartphones and
tablets.
The various types of social media that exist on the Internet are: Internet forums, social
blogs, microblogs, wikis, social networks, content communities and a lot more. Figure
displays logos of popular social media websites. Here we discuss the most popular
classifications of social media.
1. Internet forums
• An Internet forum is an online discussion website where people can engage in
conversations in the form of posted messages. Each Internet forum will have sub forums
which may have several topics. Each discussion on a topic is called a thread. People can
login and start a thread or respond to discussion in a thread. Some forums allow
anonymous login also. Discussions can be about programming, social/political issues,
fashion, etc. These discussions help us to learn and find solutions to problems.
Ubuntu Forum – a community that provides help on Ubuntu is a popular forum.
2. Social blogs
• A blog (web log) is a discussion or informational website consisting of entries or posts
displayed in the reverse chronological order i.e., the most recent post appears first. Some
blogs provide comments on a particular subject; others function as personal online
diaries and some others as online brand advertising for a particular individual or
company. Initially blogs were created by a single user only. But now there are
multiauthor blogs that are professionally edited. Blogger.com and Wordpress.com are
popular sites that offer blogging facility.
3. Microblogs
• Microblogs allow users to exchange short sentences, individual images or video links.
People use microblogs to share what they observe in their surroundings – information
about events and opinions about topics from a wide range of fields. Microblogging
offers a communication mode that is spontaneous and caninfluence public opinion.
Twitter.com is a popular microblogging site.
4. Wikis
• Wikis allow people to add content or edit existing information in a web page, to
form a community document. Wiki is a type of content management system.
Editing done by users is very closely monitored by other editors and therefore
incorrect information, advertising, etc. are removed immediately. wikipedia.org –
the free online encyclopedia is the most popular wiki on web.
5. Social networks
• Social networking sites allow people to build personal web pages and then connect
with friends to communicate and share content. We can share text, pictures, videos,
etc. and comment to the posts. A social networking site can be for general topics or for
a specific area like professional networking. Public opinion is greatly influenced by
the discussions and posts in these websites. Popular social networking sites are
facebook.com and linkedin.com.
6. Content communities
• Content communities are websites that organize and share contents like photos,
videos, etc. Youtube.com is a popular video sharing site and flickr.com shares
pictures.
• Most of today’s social media websites offer more than one type of service, i.e.,
social networking and microblogging; blogging and internet forum; etc. Studies
have revealed that social media is now recognized as a social influencer.
Online shopping
Online shopping is a form of electronic commerce, which allows consumers to
directly buy goods or services from a seller over the Internet using a web browser.
Consumers find a product of interest by visiting the website of the retailer directly or
by searching among alternative vendors using a shopping search engine, which
displays the same product's availability and pricing at different e-retailers.
As of 2020, customers can shop online using a range of different computers and
devices, including desktop computers, laptops, tablet computers, smartphones, and
smart speakers.
An online shop evokes the physical analogy of buying products or services at a
regular "bricks-and-mortar" retailer or shopping center; the process is called
business-to-consumer (B2C) online shopping. When an online store is set up to
enable businesses to buy from another businesses, the process is called business-to-
business (B2B) online shopping. A typical online store enables the customer to
browse the firm's range of products and services, view photos or images of the
products, along with information about the product specifications, features and
prices.
Online stores usually enable shoppers to use "search" features to find specific models,
brands or items. Online customers must have access to the Internet and a valid
method of payment in order to complete a transaction, such as a credit card, an
Interac-enabled debit card, or a service such as PayPal. For physical products (e.g.,
paperback books or clothes), the e-tailer ships the products to the customer; for
digital products, such as digital audio files of songs or software, the e-tailer usually
sends the file to the customer over the Internet. The largest of these online retailing
corporations are Alibaba, Amazon.com, and eBay.
Video conferencing
• Video conferencing is a type of teleconferencing wherein we can include the video of
the parties involved in the conference. Videoconference allows people at remote
locations join in a conference and share information. A video camera and a
speakerphone are connected to a computer and the computers are connected to the
network or Internet.
• Video conferencing is a facility which enables participants in distant locations to
take part in a conference by means of audio and video communication.
Types of Video Conferencing
In point-to-point (two-person) video conferencing system works much like a video
telephone. Each participant has a video camera, microphone, and speakers mounted
on his or her computer. As the two participants speak to one another, their voices are
carried over the network and delivered to the other's speakers, and whatever images
appear in front of the video camera appear in a window on the other participant's
monitor.
Multipoint videoconferencing allows three or more participants to sit in
a virtual conference room and communicate as if they were sitting right next to each
other. Until the mid-90s, the hardware costs made videoconferencing prohibitively
expensive for most organizations, but that situation is changing rapidly. Many
analysts believe that videoconferencing will be one of the fastest-growing segments
of the computer industry in the latter half of the decade.
Zoom
Zoom unifies cloud video conferencing, simple online meetings, and group messaging into
one easy-to-use platform. Our solution offers the best video, audio, and screen-sharing experience
across Windows, Mac, iOS, Android, Blackberry, Zoom Rooms, and H.323/SIP room systems.
Zoom was founded in 2011 by experienced leaders and engineers from Cisco and WebEx
GotoMeeting
An industry leader in online video conferencing for companies around the world,
GoToMeeting is trusted by millions of people every day for real time virtual communication and
collaboration. GoToMeeting provides a fast, easy and reliable professional online meeting solution
that enables customers to meet face to face, share presentations and chat with colleagues, all with
the click of a button. Nothing can match the momentum of your team or business when it’s fueled
by an award- winning collaboration solution, GoToMeeting pairs productivity with flexibility to
let employees work effectively anytime, anywhere on any device.
Today’s economy forces many companies to trim their travel budgets. For these organizations,
video conferencing is the most sensible collaboration substitute to face-to- face meetings. If your
company is thinking of implementing enterprise-level video conferencing, read this quick guide
to the basic components necessary for the setup.
1. Camera
Companies need more than just the usual USB camera commonly used in web conferencing
systems; they need high-definition primary conferencing cameras with advanced features
such as (a) remote control pan and (b) zoom and tilt features. Secondary, specialized, and
document cameras may also be used in conjunction with video conferencing to convey
information whose clarity needs to be preserved, such as in the case of education sectors and
in medical applications. High-definition (HD) cameras are usually preferred, as they offer
the highest resolutions and the largest images.
2. Video Display
Video conferencing systems may use more than one display option. Fact, many enterprise-
level collaboration systems and large-venue video conferencing systems have several display tools
that present different endpoints and data all together. The most preferred video displays are high-
definition displays between 720p and 1080i / 1080p, as they provide the best resolution and allow
about 20 percent more viewing area than standard / traditional definition display devices.
Often called the “heart and the brain” of the video conferencing system, the CODEC (also
called the coder-decoder) takes the audio and video from the microphone and the camera
and then compresses it, transmits it via an IP network, and decompresses (expands) the
incoming audio and video signal or viewing on the video display device.
4. Microphone / Audio Sub-System
Basic enterprise-level video conferencing and collaboration systems use analog microphone
pods, which are optimal for the use of a small group.
In intermediate video collaboration systems, there is usually a conference phone – gated
“array” of digital microphones – which are designed to run on integrated software.
This software enhances the system’s audio capabilities. If the video conferencing is applied
to larger rooms / venues, there needs to be an independent cancellation system for audio
echo, and many microphones are usually connected to the integrated collaboration system to
help facilitate large group interaction.
5. Other Equipment
Video input – 2 or more video cameras or web cams; possibly digital projectors /
whiteboards.
Audio input – microphones either centrally located or on individuals.
Video output – monitor, computer screen, television and/or projector.
Audio output – professional speakers, headphones or laptop computer speakers.
Codec – hardware or software-based coder-decoder technology that compresses
analog video and audio data into digital packets and decompresses the data on the
receiving end.
Echo cancellation software – diminishes audio delays to enable real-time
conversation.
Network for data transfer – today most video conferencing is transmitted over a high-
speed broadband Internet connection, using similar technology as VoIP (Voice over
Internet Protocol) but LAN and occasionally ISDN connections are used.
Signaling
Protocols
RTMPS
o RTMPS is a secure form of RTMP — with the 'S' standing for 'secure'.
By streaming encrypted data via a secure
connection, RTMPS prevents third parties from intercepting your live
streams while end route to Facebook's servers.
HTML:
1. Introduction
HTML is the most widely used language to write web pages. Every web page is
actually an HTML file.
Each HTML file is a plain text that defines a set of commands for creating hypertext
documents.
These commands are known as HTML tags. While using these tags, some
keywords may be attached to them, which make the instruction more specific. These
words are known as attributes.
An HTML document is made up of tags and attributes which work together to decide
how the contents of the web page have to be displayed on thebrowser.
Study of HTML means the study of tags and their attributes.
2. Editor
An HTML editor is a program for editing HTML, the markup of a web page.
Although the HTML markup in a web page can be controlled with any text editor,
specialized HTML editors can offer convenience and added functionality. For
example, many HTML editors handle not only HTML, but also related technologies
such as CSS, XML and JavaScript.
Types of editors
There are two main varieties of HTML editors: text and WYSIWYG (what you see is what you
get) editors.
Text editors
Text editors intended for use with HTML usually provide at least syntax highlighting.
Some editors additionally feature templates, toolbars and keyboard shortcuts to
quickly insert common HTML elements and structures. Wizards, tooltip
prompts and autocompletion may help with common tasks.
Text editors commonly used for HTML typically include either built-in functions or
integration with external tools for such tasks as version control, link-checking and
validation, code cleanup and formatting, spell-checking,
WYSIWYG HTML editors
WYSIWYG HTML editors provide an editing interface which resembles how the
page will be displayed in a web browser. Because using a WYSIWYG editor may not
require any HTML knowledge, they are often easier for an inexperienced computer user to
get started with.
The WYSIWYG view is achieved by embedding a layout engine. This may be
custom-written or based upon one used in a web browser. The goal is that, at all times
during editing, the rendered result should represent what will be seen later in a typical
web browser.
WYSIWYM (what you see is what you mean) is an alternative paradigm to
WYSIWYG editors. Instead of focusing on the format or presentation of the
document, it preserves the intended meaning of each element. For example, page
headers, sections, paragraphs, etc. are labeled as such in the editing program, and
displayed appropriately in the browser.
3. HTML document
Basic structure of an HTML document
Some of the words in the upper case within a pair of angle brackets < and >. These
are HTML tags.
It is not necessary that tags be written in the upper case.
HTML is not case sensitive. We can use either the upper or lower case or even a mix
of the two.
In this chapter we follow the style of using the upper case for HTML tags and sentence
case (i.e., the first letter is capital) for attributes to distinguish them from other words
or text.
As shown in Example 1, all HTML pages begin with the tag <HTML> and end with tag </HTML>.
There are mainly two sections in an HTML document namely head section and body section.
<HEAD> tag - to define the head section. The head section contains the information
about the document, including the title of the web page.
<TITLE> tag - to define the title of the page, which will be displayed on the title bar
of the browser window.
<BODY> tag - to define the body section. The body section contains the contents to
be displayed in the web page.
Tag Description
The entire HTML document is bounded by a pair of <HTML> and </HTML> tags. The
<HTML> tag identifies the document as an HTML document. In general, <HTML> is always the
first tag in an HTML page and the </HTML> is the last tag. Everything else in the web page is
in between these two tags. That is, the Head section and the Body section lie inside the
<HTML> and </HTML> tags.
Deprecated attributes
Attributes are made up of a name and value pair; all tags support standard attributes.
Every attribute unique to the <body> tag is deprecated, meaning that it may function currently.
Attribute Description
Background
This attribute sets an image as background for the documents body. This attribute of
<BODY> tag makes the page more attractive. The general format is:
<BODY Background = "URL of the picture">
The HTML code given in Example shows the sky as the background image of a web page.
Example: To set an image as background for a web page
<HTML>
<HEAD>
<TITLE> Background Image </TITLE>
34
</HEAD >
<BODY Background = "Sky.jpg">
Hello, Welcome to the world of Web Pages!...
</BODY>
</HTML>
Here, the HTML code in Example 1 is modified by providing an attribute Background
with the value "Sky.jpg" in the <BODY> tag as <BODY Background = "Sky.jpg">. Before
opening the page, we have to place the image file in the current working directory. The web
page is displayed as shown in Figure
<h1> defines the most important heading. <h6> defines the least important
heading.
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
Search engines use the headings to index the structure and content of your web
pages.
Users often skim a page by its headings. It is important to use headings to show
the document structure.
35
<h1> headings should be used for main headings, followed by <h2> headings,
then the less important <h3>, and so on.
Bigger Headings
Each HTML heading has a default size. However, you can specify the size for
any heading with the style attribute, using the CSS font-size property:
Example
3.5 Paragraphs
The HTML <p> element defines a paragraph:
Output
36
<html>
<body>
<table style="width:100%">
<tr>
<th>Crop</th>
<th>Soil</th>
<th>Yield</th>
</tr>
<tr>
<td>Paddy</td>
<td>Loamy</td>
<td>2tn</td>
</tr>
<tr>
<td>Maize</td>
<td>Sandy Clay</td>
<td>2tn</td>
</tr>
<tr>
<td>Blackgram</td>
<td>Sandy silty loam</td>
<td>200kg</td>
</tr>
</table>
</body>
</html>
37
Output
38
3.7 Unordered HTML List
An unordered list starts with the <ul> tag. Each list item starts with the <li> tag. The list
<!DOCTYPE html>
<html>
<body>
<h2>An unordered HTML list</h2>
<ul>
<li>Paddy</li>
<li>Maize</li>
<li>Cotton</li>
</ul>
</body>
</html>
The type property is used to define the style of the list item marker:
Value Description
39
3.8 Ordered HTML List
An ordered list starts with the <ol> tag. Each list item starts with the <li> tag.
<ol>
<li>Paddy</li>
<li>Maize</li>
<li>Cotton</li>
</ol>
40
3.9 HTML Images
Images can improve the design and the appearance of a web page.
Example
<img src="pic_trulli.jpg" alt="Italian Trulli">
The <img> tag is empty, it contains attributes only, and does not have a closing tag. The src
<img src="url">
The alt Attribute
The alt attribute provides an alternate text for an image, if the user for some reason cannot view it
(because of slow connection, an error in the src attribute, or if the user uses a screen reader).
Example
<img src="img_paddy.jpg" alt="Paddy Varity">
You can use the style attribute to specify the width and height of an image.
41
Example
<img src="img_wheat.png" alt="Wheat Image" style="width:500px; height:600px;">
Example
<img src="img_Cotton.jpg" alt="Cotton Field" width="500" height="600">
The width and height attributes always define the width and height of the image in pixels.
Images in Another Folder
If not specified, the browser expects to find the image in the same folder as the web page.
However, it is common to store images in a sub-folder. You must then include the folder name in
the src attribute:
Example
<img src="/images/html5.gif" alt="TNAUIcon" style=" width:128px; height:128px;">
Animated Images
Example
<img src="programming.gif" alt="Computer" style="width:48px; height:48px;">
Image as a Link
To use an image as a link, put the <img> tag inside the <a> tag:
Example
<a href="htmlimageex.html">
<img src="rice.png" alt="RiceVariety" style="width:42px; height:42px; border:0;">
</a>
Summary
42
3.10 HTML Links <a> tag
HTML Links - Hyperlinks
When you move the mouse over a link, the mouse arrow will turn into a little hand.
Note: A link does not have to be text. It can be an image or any other HTMLelement.
Example
<a href="http://www.tnau.ac.in ">Tamil Nadu Agricultural University </a>
43
3.11 <marquee> tag
The HTML <marquee> tag is used for scrolling piece of text or image displayed either
horizontally across or vertically down your web site page depending on the settings.
Example
Global Attributes
This tag supports all the global attributes described in − HTML Attribute Reference
Specific Attributes
44
The HTML <marquee> tag also supports the following additional attributes −
Attribute Value Description
behavior scroll Defines the type of scrolling.
slide
alternate
bgcolor rgb(x,x,x) Deprecated − Defines the direction of scrolling the content.
#xxxxxx
colorname
direction up Defines the direction of scrolling the content.
down
left
right
height pixels or % Defines the height of marquee.
hspace pixels Specifies horizontal space around the marquee.
loop number Specifies how many times to loop. The default value is
INFINITE, which means that the marquee loops endlessly.
scrolldelay seconds Defines how long to delay between each jump.
scrollamount number Defines how how far to jump.
width pixels or % Defines the width of marquee.
vspace pixels Specifies vertical space around the marquee.
45
3.12 <HR> Horizontal Rules tag Usage
The <hr> tag defines a thematic break in an HTML page, and is most often displayed as a
horizontal rule.
The <hr> element is used to separate content (or define a change) in an HTML page:
Example
<h1>This is heading 1</h1>
<p>This is some text.</p>
<hr>
<h2>This is heading 2</h2>
<p>This is some other text.</p>
<hr>
46
3.13 <br> Tag
The <br> tag is an empty tag which means that it has no end tag.
Example
Answer
<TABLE border="1">
<CAPTION><EM>A test table with merged cells</EM></CAPTION>
<TR><TH rowspan="2"><TH colspan="2">Average
<TH rowspan="2">Red<BR>eyes
<TR><TH>height<TH>weight
<TR><TH>Males<TD>1.9<TD>0.003<TD>40%
<TR><TH>Females<TD>1.7<TD>0.002<TD>43%
</TABLE>
47
2. Practice to design a crop details website using coding or google sites.
48
Lecture 4
Microsoft Excel combines the column-row layout of traditional paper spreadsheets with powerful
tools for data calculation, analysis, and formatting.
Opening Excel
1. To open Excel 2010, from the Start menu, select All Programs » Microsoft Office »
Microsoft Office Excel 2010
Worksheet
Single sheet within the workbook.
A worksheet can contain data, charts, or both.
Instead of compiling all of your information into one worksheet,
youcan create several worksheets within the one workbook file.
Column
A vertical group of cells within a worksheet.
Row
A horizontal group of cells within a worksheet.
Cell
The intersection of a column and row. Information is stored in cells.
Cell Address
Consisting of the column and row IDs, of a specific cell.
The current cell location is displayed in the upper left corner of the worksheet.
Cell Ranges:
A range in Excel is a collection of two or more cells.
2. Creating a Workbook
1. In the top left corner of the Excel window, click FILE menu.
From the File menu, select New… Blank workbook
The New Workbook dialog box appears.
2
First, we will learn how to open a workbook,
how to create a workbook from a template and
how to view multiple workbooks at the same time
Open a Workbook
To open an Excel workbook, you have created in the past, execute the following steps.
1. Click on the green File tab. The File tab in Excel 2010 replaces the Office Button (or File
Menu) in previous versions of Excel.
What you see next is called the backstage view and it contains all the workbook related
commands. Recent shows you a list of your recently used workbooks.
2. You can quickly open a workbook from here or you can click Open to open another
workbook that is not on the list.
3
Create a Workbook from a template
Instead of creating a workbook from scratch, you can create a workbook from a
template. There are many free templates available, waiting to be used!
2. To choose a template from one of the sample templates, click on Sample templates.
Result:
126
View Multiple Workbooks
If you want to view multiple workbooks at the same time, execute the following steps.
Result.
Note: to switch back to normal view, click on Arrange All again and check 'Windows of active
workbook'.
127
Save and Protect a Workbook and worksheet
Save a Workbook
- specify the path of the file and type the name of the workbook
- select the save as type as 97-2003 format or excel workbook option
- click save
You can password protect a workbook when you want to be sure that only people who know the
password can open your Excel file.
128
5. Reenter the password and click on OK.
6. Click on Save.
When you share a file with other users, you may want to protect a worksheet to help prevent
it from being changed.
1. Right click on the worksheet tab of the worksheet you want to protect.
129
2. Click on Protect Sheet...
3. Enter a password.
4. Check the actions you allow the users of your worksheet to perform.
5. Click on OK.
Note: to unprotect a worksheet, right click on the worksheet tab again and click on
Unprotect Sheet.
130
3. Worksheet Manipulation
When you open Excel, Excel automatically selects Sheet1 for you. The name of the
worksheet appears on its sheet tab at the bottom of the document window.
1. To select one of the other two worksheets, simply click on the sheet tab of Sheet2 or
Sheet3.
By default, the worksheets are named Sheet1, Sheet2 and Sheet3. To give a worksheet a more
specific name, execute the following steps.
2. Choose Rename.
131
For example, type Sales 2010.
Result:
You can insert as many worksheets as you want. To quickly insert a new worksheet, click the
Insert Worksheet tab at the bottom of the document window.
Result:
To move a worksheet, click on the sheet tab of the worksheet you want to move and drag it into the
new position.
1. For example, click on the sheet tab of Sheet4 and drag it before Sheet2.
Result:
132
3.5 Delete a Worksheet
Result:
Imagine, you have got the sales for 2010 ready and want to create the exact same sheet for 2011, but
with different data. You can recreate the worksheet, but this is time-consuming. It is a lot easier to
copy the entire worksheet and only change the numbers.
133
Select (move to end) and check Create a copy.
3. Click on OK.
Result:
134
Unhide
4. Cell Manipulation
Data type refers to the characteristics of the information stored in a worksheet cell.
For the purposes of this introductory, the main types of data in Excel:
Text
Numbers
135
Text data
It is most often words that are used for worksheet headings, names, and for
identifying columns of data.
Text data can contain letters numbers, and specialty characters such as ! or &. By
default, text data is left aligned in a cell.
Numbers
Problems can arise if numbers get stored as text data. This can prevent them from being used in
calculations.
Formulas:
136
2. Select the cell where you want the first cell of the range to appear, right click, and click on Paste
under the 'Paste Options:' group.
Note: the other Paste Options are not important at this stage, but you can have a go with it if you
want.
To insert a row between the values 20 and 40 below, execute the following steps.
2. Click on Insert.
137
Result:
The rows below the new row are shifted down. In a similar way, you can insert a column.
Click on the cell, type over the existing entry, and press the ENTER key on the keyboard.
Method 1
Method 2
Home key: moves the active cell highlight to column A without changing rows.
Ctrl + Home keys: moves the active cell highlight to cell A1.
Ctrl + End keys: moves the active cell highlight to the last cell of the spreadsheet
containing data.
Ctrl + Down Arrow keys: moves the active cell highlight to the last row of the
spreadsheet without changing columns.
138
Ctrl + Up Arrow keys: moves the active cell highlight to the first row of the
spreadsheet without changing columns.
Ctrl + Page Down keys: moves the active cell highlight to the next sheet of the
spreadsheet.
Ctrl + Page Up keys: moves the active cell highlight to the previous sheet of the
spreadsheet.
1. Modify Fonts
Modifying fonts in Excel will allow you to emphasize titles and headings. To modify a font:
Select the cell or cells that you would like the font applied
On the Font group on the Home tab, choose the font type, size, bold, italics,
underline, or color
139
Comma Formatting in Excel
140
There are several tabs on this dialog box that allow you to modify properties of the cell or cells.
Number : Allows for the display of different number types and decimal places
Alignment : Allows for the horizontal and vertical alignment of text, wrap text,
shrink text, merge cells and the direction of the text
Font : Allows for control of font, font style, size, color, and additional
features
Border : Border styles and colors
Fill : Cell fill colors and styles
Borders and colors can be added to cells manually or through the use of styles.
To add borders manually:
Click the Borders drop down menu on the Font group of the Home tab
Choose the appropriate border
Click the Fill drop down menu on the Font group of the Home tab
Choose the appropriate color
141
To apply borders and colors using styles:
Click the Format button on the Cells group of the Home tab
Manually adjust the height and width by clicking Row Height or Column Width
To use AutoFit, click AutoFit Row Height or AutoFit Column Width
142
5. Hide or Unhide Rows or Columns
143
6. Merge Cells
To merge cells, select the cells you want to merge and click the Merge & Center
button on the Alignment group of the Home tab. The four choices for merging cells
are:
Combines the cells and centers the contents in the new, larger cell
Merge Across: Combines the cells across columns without centering data
Merge Cells: Combines the cells in a range without centering
Unmerge Cells: Splits the cell that has been merged
To align cell contents, click the cell or cells you want to align and click on the
options within the Alignment group on the Home tab. There are several options for
alignment of cell contents:
144
Date Formatting in Excel
When finished, Click OK at the bottom of the Format Cells dialog box.
9. Percentage Format
2. On the Home tab, in the Number group, click the Percentage symbol.
145
Result:
You can use data validation to make sure that users enter certain values into a cell. Input messages
can be used to tell the user what to enter. If users ignore this message and enter a value that is not
valid, you can show them an error alert.
146
1. Open the Excel file.
Input Message
Input messages appear when the user selects the cell (in this example, selects cell C2)
and tell the user what to enter.
On the Input Message tab:
1. Check 'Show input message when cell is selected'.
147
2. Type a title.
3. Type an Input message.
Error Alert
If users ignore the input message and enter a number that is not valid, you can show
them an error alert.
On the Error Alert tab:
1. Check 'Show input message when cell is selected'.
2. Type a Title
3. Enter an error message.
148
Result when you enter a number that is not valid.
You can create all sorts of other data validation rules for cells.
5. Printing in Excel
To print the entire worksheet or just a selection and how to change some important print
settings, such as fitting a sheet on one page, printing gridlines and headings, adjusting page
margins, and centering a range of cells on a page automatically.
Print a Worksheet
To print a worksheet in Excel 2010 (or Excel 2007), execute the following steps.
1. On the File tab, click Print.
2. To preview the other pages that will be printed, click 'Next Page' or 'Previous Page'
at the bottom of the window.
149
3. To print the worksheet, click the big Print button.
Print Selection
Instead of printing the entire worksheet, you can also only print the current selection.
1. First, select the range of cells you want to print.
2. Next, under Settings, select Print Selection.
150
3. To print the selection, click the big Print button.
151
Print Gridlines & Headings
Printing gridlines (the horizontal and vertical lines you see on your worksheet) and
row/column headers (1, 2, 3 etc and A, B, C etc) makes your copy easier to read. To
print gridlines and headings, execute the following steps,
1. On the Page Layout tab, check Print under Gridlines and check Print under Headings.
Page Margins
To adjust the page margins, execute the following steps.
1. First, click on the 'Show Margins' icon at the bottom right window. 2.
Next, you can drag the lines to change the page margins.
152
Center on Page
To center a range of cells on a page automatically, execute the following steps.
1. Under Settings, select 'Custom Margins' from the Margins drop-down list.
153
2. Next, check horizontally and vertically.
One new feature that comes with Excel 2010, is the ability to save files in PDF format. The PDF
(Portable Document Format) allows others to view your Excel spreadsheets without having Excel
installed on their computer.
You can download the accompanied Excel file if you like. Let's get started!
To save files in PDF format in Excel 2007, you can download the 2007 Microsoft Office Add- in.
To save an Excel file in PDF Format in Excel 2010, execute the following steps.
154
4. Select 'Minimum size' if you want to keep the file size as small as possible.
5. Click on Options.
5. Here you can select which sheets you want to publish. By default, all pages of the Active
sheet will be published.
Excel automatically opens the PDF file for you (unless you deselected the 'Open file after
publishing' checkbox earlier on).
155
7. Charting
Charts are graphic depictions of data in your worksheet. Excel can build a chart
automatically based on existing data, after which the chart can be moved, resized, and deleted
without affecting your worksheet data. Charts do not appear within a specific cell, but rather
appear over other cells. When creating a chart, there are some basic rules to keep in mind to
make the process easier. This document gives an overview of the necessary elements of a chart.
Excel 2007 offers several types of charts, each with its own unique functions. Be sure to choose
the type of chart that best serves your purposes. The following table provides a quick summary
of all the chart types available to you, as well as their functions:
156
Doughnut Proportionally compares the items in two or more data series
In Excel, charts are visual representations of data on a spreadsheet. There are many types of
charts available, so you should find one that is right for your project.
157
The following list describes the various elements in this chart.
Title
Identifies the data being charted on the horizontal x-axis; values in this section will be
used as labels along the x-axis.
EXAMPLE: Cities (Minneapolis, Albuquerque, Tampa)
Identifies the data being charted on the vertical y-axis; values in this section will
determine where points fall in relation to the y-axis.
NOTE: The x-axis can also be used as a value axis.
EXAMPLE: Average temperatures (0–90)
158
Legend
Identifies the information being charted. This is especially important when you have
more than one type of information charted.
Using the example of the above chart, the legend identifies which information relates
to each month.
Ticks
Ticks, indicating measurement increments, appear on both the y-axis and x-axis and can
help improve the readability of a chart. Both y-axis and x-axis ticks are optional.
Origin
The origin is the point where the x-axis and y-axis meet. The origin is generally at zero
(0) but can be modified.
8. Function
Math and trigonometry functions
1. ABS
Returns the absolute value of a number. The absolute value of a number is the number
without its sign.
Syntax
ABS(number)
3. EXP
Returns e raised to the power of number. The constant e equals 2.71828182845904, the
base of the natural logarithm.
Syntax
EXP(number)
159
Formula Description (Result)
=EXP(1) Approximate value of e (2.718282)
=EXP(2) Base of the natural logarithm e raised to the power of 2 (7.389056)
4. FACT
Returns the factorial of a number. The factorial of a number is equal to 1*2*3*...*
number.
Syntax
FACT(number)
Formula Description (Result)
=FACT(5) Factorial of 5, or 1*2*3*4*5 (120)
=FACT(1.9) Factorial of the integer of 1.9 (1)
5. LOG
Returns the logarithm of a number to the base you specify.
Syntax
LOG(number, [base])
6. Mod
Returns the remainder after number is divided by divisor. The result has thesame sign as
divisor.
Syntax
MOD(number, divisor)
7. PI
Returns the number 3.14159265358979, the mathematical constant pi, accurate to 15 digits.
Syntax
PI()
Formula Description (Result)
=PI() Pi (3.14159265358979)
160
=PI()/2 Pi/2 (1.570796327)
8. Power
Returns the result of a number raised to a power.
Syntax
POWER(number, power)
Formula Description (Result)
=POWER(5,2) 5 squared (25)
9. Product
The PRODUCT function multiplies all the numbers given as arguments and returns the
product.
Syntax
PRODUCT(number1, [number2], ...)
Data
5
15
30
Formula Description Result
=PRODUCT(A2:A4) Multiplies the numbers in cells A2 2250
through A4.
10. RAND
Returns an evenly distributed random real number greater than or equal to 0 and less than
1. A new random real number is returned every time the worksheet is calculated.
Syntax
RAND()
Syntax
SIGN(number)
Formula Description (Result)
161
=SIGN(10) Sign of a positive number (1)
=SIGN(4-4) Sign of zero (0)
=SIGN(-0.00001) Sign of a negative number (-1)
12. SQRT
Returns a positive square root.
Syntax
SQRT(numb er)
A B
Data
-16
Formula Description (Result)
=SQRT(16) Square root of 16 (4)
=SQRT(A2) Square root of the number above. Because the number is
negative, an error is returned (#NUM!)
13. SUM
The SUM function adds all the numbers that you specify as arguments. Each argument
can be a range, a cell reference, an array, a constant, a formula, or the result from
another function.
Syntax
SUM(number1,[number2],...])
A B C
Data
-5
15
30
'5
TRUE
Formula Description Result
=SUM(3, 2) Adds 3 and 2. 5
162
MATRIX Operation
14. MMULT
Returns the matrix product of two arrays. The result is an array with the same number
of rows as array1 and the same number of columns as array2.
Syntax
MMULT(array1, array2)
A B
1 Array 1 Array 1
2 1 3
3 7 2
4 Array 2 Array 2
5 2 0
6 0 2
7 Formula Formula
8 =MMULT(A2:B3,A5:B6)
15. MINVERSE
Returns the inverse matrix for the matrix stored in an array.
Syntax
MINVERSE(arra y)
A B
Data Data
4 -1
2 0
Formula Formula
=MINVERSE(A2:B3)
2. Statistical function
1. Average
Returns the average (arithmetic mean) of the arguments
Syntax
163
2. Count
The COUNT function counts the number of cells that contain numbers, and counts
numbers within the list of arguments...
Syntax
COUNT(value1, [v alue2], ...)
A B C
Data
Sales
12/8/2008
19
22.24
TRUE
#DIV/0!
Formula Description Result
=COUNT(A2:A8) Counts the number of cells that 3
contain numbers in cells A2
through A8.
3. Countif
The COUNTIF function counts the number of cells within a range that meet a single
criterion that you specify.
Syntax
COUNTIF(range, criteria)
range Required. One or more cells to count, including numbers or names, arrays, or
references that contain numbers. Blank and text values are ignored.
criteria Required. A number, expression, cell reference, or text string that defines
which cells will be counted. For example, criteria can be expressed as 32, ">32", B4,
"apples", or "32".
A B C
Data Data
apples 32
oranges 54
peaches 75
apples 86
Formula Description Result
164
=COUNTIF(A2:A5,"apples") Number of cells with 2
apples in cells A2
through A5.
4. Large
Returns the k-th largest value in a data set.
Syntax
LARGE(array, k)
The LARGE function syntax has the following arguments:
Array Required. The array or range of data for which you want to determine the k-th
largest value.
K Required. The position (from the largest) in the array or cell range of data to return.
A B
Data Data
3 4
5 2
3 4
5 6
4 7
Formula Description (Result)
=LARGE(A2:B6,3) 3rd largest number in the
numbers above (5)
5. MAX
Returns the largest value in a set of values.
Syntax
6. Min
Returns the smallest number in a set of values.
Syntax
165
7. Median
Returns the median of the given numbers. The median is the number in the middle of
a set of numbers. All the numbers should be arranged in ascending order.
Syntax
8. Small
Returns the k-th smallest value in a data set. Use this function to return values with a
particular relative standing in a data set.
Syntax
SMALL(array, k)
The SMALL function syntax has the following arguments:
Array Required. An array or range of numerical data for which you want to
determine the k-th smallest value.
K Required. The position (from the smallest) in the array or range of data to return.
Formula Description (Result)
=SMALL(A2:A10,4) 4th smallest number
1. Date
The DATE function returns the sequential serial number that represents a
particular date. For example, the formula
=DATE(year,month,day)
Formula Description Result
=DATE(2008,1,1) Serial date for the date derived by using cells A2, B2, and 1/1/2008
C2 as the arguments for the DATE function, and using the
1900 date system.
2. Now
Returns the serial number of the current date and time
Syntax
166
NOW()
3. Day,Month,Year
Returns the day, month and year corresponding to a date.
Syntax
DAY(serial_number)
MONTH(serial_number)
YEAR(serial_number)
A B
Date
15-Apr-2008
Formula Description (Result)
=DAY(A2) 15
=month(A2) 4
=year(A2) 2008
4. Today
Returns the serial number of the current date.
example, if you know that someone was born in 1963, you might use the following formula to find
that person's age as of this year's birthday:
=YEAR(TODAY())-1963
Syntax
TODAY()
A B
Formula Description
=TODAY() Returns the current date.
=TODAY()+5 Returns the current date plus 5
days. For example, if the current
date is 1/1/2008, this formula
returns 1/6/2008.
=DATEVALUE("1/1/2030")- Returns the number of days
TODAY() between the current date and
1/1/2030.
5. Time
Returns the decimal number for a particular time.
Syntax: TIME(hour, minute, second)
Example
=time(12,5,3) returns 12:05 P
167
9. PIVOT Table
A PivotTable is a powerful tool to calculate, summarize, and analyze data that lets you see
comparisons, patterns, and trends in your data.
The user has a lot of data, it can sometimes be difficult to analyze all of the
information in the worksheet.
PivotTables can help make the worksheets more manageable by summarizing data and
allowing you to manipulate it in different ways.
Input Data
Question
What is the amount sold by each salesperson?
Answering this question could be time consuming and difficult—each salesperson appears
on multiple rows, and we would need to total all of their different orders individually.
A PivotTable can instantly calculate and summarize the data in a way that's both easy to
read and manipulate. When we're done, the PivotTable will look something like this:
168
Once you've created a PivotTable, you can use it to answer different questions by
rearranging—or pivoting—the data. ‘
For example, if we wanted to answer the question:
What is the total amount sold in each month? we could modify our PivotTable to look like
this:
To create a PivotTable:
Select the table or cells (including column headers) containing the data you want to use.
169
1. The Create PivotTable dialog box will appear. Choose your settings, then click
OK. In our example, we'll use Table1 as our source data and place the PivotTable
on a new worksheet.
3. Once you create a PivotTable, you'll need to decide which fields to add.
170
Each field is simply a column header from the source data. In
the PivotTable Field List, check the box for each field you want to add.
In our example, we want to know the total amount sold by each salesperson, so we
will check the Salesperson and Order Amount fields.
4. The selected fields will be added to one of the four areas below the Field List. In our
example, the Salesperson field has been added to the Rows area, while the Order
Amount has been added to the Values area. Alternatively, you can click, hold, and drag
a field to the desired area.
171
5. The PivotTable will calculate and summarize the selected fields. In our
example, the PivotTable shows the amount sold by each salesperson.
Just like with normal spreadsheet data, you can sort the data in a PivotTable using the
Sort & Filter command in the Home tab.
You can also apply any type of number formatting you want. For example, you may
want to change the Number Format to Currency. However, be aware that some types
of formatting may disappear when you modify the PivotTable.
If you change any of the data in your source worksheet, the PivotTable will not update
automatically.
To manually update it, select the PivotTable and then go to Analyze > Refresh.
172
Pivoting data
One of the best things about PivotTables is that they can quickly pivot—or
reorganize—data, allowing you to look at your worksheet data in different ways.
Pivoting data can help you answer different questions and even experiment with the
data to discover new trends and patterns.
What is the total amount sold by each salesperson? But now we'd like to answer a
new question:
What is the total amount sold in each month? We can do this by simply changing
the field in the Rows area.
2. Drag a new field from the Field List into the Rows area. In our example, we will use
the Month field.
173
3. The PivotTable will adjust—or pivot—to show the new data. In our example, it now
shows the total order amount for each month.
174
To add columns:
So far, our PivotTable has only shown one column of data at a time. In order to show
multiple columns, you will need to add a field to the Columns area.
1. Drag a field from the Field List into the Columns area. In our example, we will use
the Region field.
2. The PivotTable will include multiple columns. In our example, there is nowa column
for each region.
175
Filters
Sometimes you may want focus on just a certain section of your data.
Filters can be used to narrow down the data in your PivotTable, allowing you to view
only the information you need.
To add a filter:
In our example, we will filter out certain salespeople to determine how they affect the total sales.
1. Drag a field from the Field List to the Filters area. In this example, we will use the
Salesperson field.
2. The filter will appear above the PivotTable. Click the drop-down arrow, and then
check the box next to Select Multiple Items.
176
3. Uncheck the box for any items you do not want to include in the
PivotTable. In our example, we will uncheck the boxes for a few different
salespeople, and then click OK.
177
Slicers
Slicers are just filters, but they are easier and faster to use, allowing you to instantly
pivot your data.
If you frequently filter your PivotTables, you may want to consider using slicers
instead of filters.
To add a slicer:
1. Select any cell in the PivotTable.
2. From the Analyze tab, click the Insert Slicer command.
3. A dialog box will appear. Select the desired field. In our example, we'll select
Salesperson, then click OK.
178
4. The slicer will appear next to the PivotTable. Each selected item will be highlighted in
blue. In the example below, the slicer contains a list of all salespeople, and six of them
are currently selected.
5. Just like filters, only selected items are used in the PivotTable. When
you select or deselect items, the PivotTable will instantly reflect the changes.
179
Try selecting different items to see how they affect the PivotTable. Press and hold
the Ctrl key on your keyboard to select multiple items from a slicer.
You can also click the Filter icon in the top-right corner to select all items from the slicer at
once.
PivotCharts
PivotCharts are like regular charts, except they display data from a PivotTable.
Just like regular charts, you will be able to select a chart type, layout, and style that
will best represent the data.
To create a PivotChart:
In this example, our PivotTable is showing each person's total sales per month. We will use a
PivotChart so we can see the information more clearly.
180
2. From the Insert tab, click the PivotChart command.
3. The Insert Chart dialog box will appear. Select the desired chart
type and layout, and then click OK.
181
Try using slicers or filters to change the data that is displayed. The PivotChart will
automatically adjust to show the new data.
182
Exercise!
1. Open an existing Excel workbook. If you want, you can use our practice workbook.
2. Create a PivotTable using the data in the workbook.
3. Experiment by placing different fields in the rows and columns areas.
4. Filter the report with a slicer.
5. Create a PivotChart.
6. If you are using the example, use the PivotTable to answer the question, which
salesperson sold the lowest amount in January? Hint: First, decide which fields
you need in order to answer the question.
183
Questions
2. Which tool you will use to join some cells and place the content at the
middle of joined cell?
A) From Format Cells dialog box click on Merge Cells check box
B) From Format Cells dialog box select the Centered alignment
C) From Format Cells dialog box choose Merge and Center check box
D) Click on Merge and Center tool on formatting toolbar
4. Each excel file is a workbook that contains different sheets. Which of the
following cannot be a sheet in workbook?
A) work sheet
B) chart sheet
C) module sheet
D) data sheet
5. Which of the following is not the correct method of editing the cell content?
A) Press the Alt key
B) Press the F2 key
C) Click the formula bar
D) Double click the cell
6. What happens when you press Ctrl + X after selecting some cells in Excel?
A) The cell content of selected cells disappears from cell and stored in clipboard
B) The cells selected are marked for cutting
C) The selected cells are deleted and the cells are shifted left
D) The selected cells are deleted and cells are shifted up
184
7. You can auto fit the width of column by
8. Long text can be broken down into many lines within a cell. You can do this through
9. Which of the following you can paste selectively using Paste Special command?
A) Validation
B) Formats
C) Formulas
D) All of above
A) Protect Sheet
B) Protect Workbook
C) Protect Workspace
D) All of above are valid
11. Number of rows and column in excel is and
12. Default number of worksheets in workbook is
13. The extension of excel file is
14. Graphical representation of object in excel is
Write Answer
185
186
Lecture 5
Introduction
Microsoft Access is the relational database management system found in the Microsoft
Office suite. It allows users to create interactive database, where they can manage data such as
inventory, budgets, incoming and outgoing assets, payrolls etc. Once you have prepared the
database, you can add, modify or delete the data into the database, table or even in records. MS-
Access offers wizards to help users to create Tables, Queries, Forms and Reports, along with a
set of predefined table definitions for tracking Assets, Customers, Sales Orders, Invoices and
much more. It gives you more efficient way of handling data than a spreadsheet.
Database
Datatypes:
Data types are the properties of each field. Every field has one data
type like text, number, date, etc.
MS Access Datatypes
Short Text Text, including numbers which does not Up to 255 characters.
need calculation. (e.g., Mobile
numbers).
Long Text This data type is used for lengthy text or Maximum 63, 999
alphanumeric data. characters.
Number Numeric data type used for storing 1, 2, 4, 8, and 16 bytes.
mathematical calculations.
OLE objects OLE objects can store audio, video, Up to 2 GB data can be
other Binary Large Objects. stored.
Calculated Helps you to create an expression that You can create an expression
uses data from one or more fields. which uses data from one or
more fields.
3
How to Start Microsoft Access and open Blank database
4
5. Choose create
There are many situations where we need to start with some readymade
database template for given requirements.
MS Access provides many ready to use templates for such types of databases
requirements where the data structure is already defined.
You can keep customizing the template structure further as perour
requirement.
MS ACCESS Database template example includes Contacts, Student, Time
tracking, etc.
5
We can select any template by clicking on it. Click on Faculty Template for further reference.
File name box will appear with the default file name.
6
MS Access – Objects
MS Access uses “objects" to help the user list and organize information, as well as
prepare specially designed reports.
Databases in Access are composed of many objects but the following are the major
objects −
Tables Tables in the Database
Together, these objects allow you to enter, store, analyze, and compile your data.
MS-Access Ribbon
The Access Ribbon is a Microsoft innovation which has replaced traditional menu bar’s
used in other software applications. It works in a similar way to a menu bar but is designed to
be more intuitive and user friendly by virtue of its visual nature.
7
The Create Ribbon
The following table shows a representative sampling of the tabs and the commands
available on each tab:
8
Datasheet Provides a datasheet, pivot table, pivot chart and design view.
Manages fields and columns of the table.
Set the data type and formatting.
Create table relationships and object dependencies.
A database stores information in an organized way that makes it easy to get information in an
effective way. In MS-Access, you can create various elements for database operations. The
Create command tab on the top of the window screen provides access to these elements in the
database. These elements are as follows:
Tables
Queries
Forms
Reports
Macros
Modules
You can hide or view the objects in the navigation pane, if required.
The tool (𝖴) double down arrow is used to view the objects, whereas the tool (⇑) double
up arrow is used to hide the objects.
Table
In MS-Access, tables are used to store the data. It represents data in tabular format, i.e. in
rows (records) and columns (fields). The table structure depends on the type of
information that you want the table should contain. The structure of a table includes table
components which are as follows:
Field Name
Field Type or Data Type
Field Length or Field Size
Field Properties
Primary key
9
Field Name
It is a label provided for a field that specifies the type of information contained in a
particular field. Two fields should not have the same field name (i.e. field name
should be unique).
e.g. a field name CONTACT_NO, would contain the mobile number or landline
number of the student.
Field Type (Data Type)
It specifies the type of data that is stored in the field. A field can store various types of
data such as textual data and numerical data or combination of both. In MS-Access,
data types can be categorized into the following types:
10
Field Length (Field Size)
It refers to the maximum number of characters that a field can contain. Each character
requires one byte for its storage.
Field length is of two types which are as follows:
Fixed length field It is a type of field length in which the number of characters you
enter in a field is fixed. These are present in Format option in Data Type Formatting
group (in Datasheet tab) such as Currency, Euro, Percent etc.
Variable length field in this type of field length, the number of characters is not fixed.
Actually, the number of characters of the data entered in the field decide the field
length.
The field length or field size of each data type are as follows:
Field length
Data Type Field length or Field size Data Type
or Field size
0-65,536
Text 0-255 characters Memo
characters
Number 1,2, 4, 8 or 16 bytes DateTime 8 bytes
Currency 8 bytes AutoNumber 4 or 16 bytes
Yes/No 1 bit (Oor 1) OLE Object Upto 2 GB
Each part contains upto 2048 Lookup
Hyperlink 4 bytes
characters Wizard…
Field Properties
After you create a field and set its data types, you can also set additional field
properties. Setting field properties can give the database extra flexibility and
functionality. Some important properties of field are as follows:
Primary Key
It is used to uniquely identify the records in a table, e.g. the primary key of a table
Cropdatabase, which stores the data about employees of an organisation, can be
CropID because two crops cannot have the same CropID.
Rule
A condition that must be meet before the data is accepted into the database. Text,
Memo, Number, DateTime, Currency, Yes/No, Hyperlink.
11
It customises the way that text or Text, Memo, Number,
Format
numbers are displayed and printed. DateTime, Curre Auto Number,
Yes/No, Hyperlink.
It sets up the field to receive data in a
Input Mask Text, Number, DateTime,
particular format.
Currency.
1. Step 1 – Select the field that you want to set a primary key.
2. Step 2 – Click the Primary Key button from Tools group (under the Design tab),
or Right click and select Primary Key.
3. Step 3 – A Key icon ) indicates which field contains the primary key.
12
Remove a Primary Key
Steps to remove- a primary key are as follows:
Step 1 – Click the field that has been assigned as a primary key.
Step 2 – Click the Primary Key button from Tools group (under Designtab), or
Right click and select Primary Key.
Create Tables
Table is an object that is used to define and store data. When you create a new table,
Access asks you to define fields which is also known as column headings.
Each field must have a unique name, and data type.
Tables organize data into columns (called fields) and rows (called records)
Tables contain fields or columns that store different kinds of data, such as a name or
an address, and records or rows that collect all the information about a particular
instance of the subject, such as all the information about a crop or employee etc.
You can define a primary key, one or more fields that have a unique value for each
record, and one or more indexes on each table to help retrieve your data more quickly.
Step 3 – After clicking at the Table Design command, a Design tab and a field entry
area at middle with field property area will appear at bottom as shown in the figure:
13
Step 4: Choose design view of Table1
14
Step 6: Create the table that will store the basic crop information concerning the crop shown
in the following table:
15
To Create a Table using Datasheet View
Steps to create a table using the Datasheet View are as follows:
Step 1 – Open the database.
Step 2 – Go to Create tab in the Ribbon and select the Table command.
Step 3 – After clicking at the Table command, a Datasheet tab will appear as shown
below:
Step 4 – In the above figure, the field ID is automatically generated that is of datatype
AutoNumber. Due to which, its values are automatically generated for each record and
field ID uniquely identifies the record in a table.
16
Steps to explicitly assign a data type to a field area are as follows:
Step 1 – Click the Field label for the field which you want to assign a data
type.
Step 2 – Activate the Datasheet tab.
Step 3 – Click drop down arrow next to the Data Type field from Data Type
& Formatting group and then, choose a data type.
Note:
By default, data type consists as a Text.
Insert a Field
Steps to add a field into a table are as follows:
Step 1 – Right click on the table and click Datasheet View.
Step 2 – To insert a new column, click the Insert in Datasheet tab or Right click
the header (Field Name) of the field that follows the new field.
Step 3 – Click at Insert Column from the menu.
17
Delete a Field
Steps to delete a field from a table are as follows:
Rename a Field
Steps to rename a field into a table are as follows:
18
Editing Data into a Table
Steps to edit data into a table are as follows:
Step 1 – Open table in a Datasheet View.
Step 2 – Select the cell containing the data that you want to edit.
Step 3 – Type the new value for the selected cell and save the table.
Hide a Column
You can temporarily hide a column in a Datasheet View such that you can view
other columns in a large datasheet.
Steps to hide a column into a table are as follows:
Step 1 – Right click at the Field Name of the field that you want to hide.
Step 2 – Click Hide Columns from the menu.
Freeze Columns
Freezing a field means that no matter how far you scroll in a datasheet, you will
always see the frozen field on the left side pane.
Steps for freezing column(s) in a table are as follows:
Step 1 – Right click at the Field Name of the field that you want to freeze.
Step 2 – Click Freeze Columns from the menu.
Step 1 – Find a table in the All Access Objects list (the left-hand window).
Step 2 – Right click on a table and select Datasheet View.
Datasheet View represents the data in a table.
Or
Select Home tab and click the View dropdown arrow and select the
Datasheet View.
19
2. In Design View To open a table in a Design View, follow these steps:
Step 1 – Find a table in the All Access Objects list (the left-hand window).
Step 2 – Right click on the table and select Design View. Design View
represents the structure of the table.
Or
Select the Home tab and click the View dropdown arrow and select the
Design View.
Step 1 – Find a table in the All Access Objects list (the left-hand window).
Step 2 – Right click on a table and select Rename.
Note:
If you are working on this table, then it will display a prompt message that you can’t
rename the database object, ‘Tablet while its open. So firstly, close this table.
Step 3 – Now, type a new name for the table.
Step 4 – Press Enter from the keyboard.
20
Navigation in a Table
It is required to move or to navigate any record for the purpose of checking it from
time to time.
You can navigate to any record in the table using the Record Navigation
buttons provided in MS-Access.
The Record Navigation buttons are located at the bottom of the table whenit is
opened in a Datasheet View, as shown in the following figure:
21
Form
Form is an object in a desktop database designed primarily for data input or display or
for control of application execution. You use forms to customize the presentation of
data that your application extracts from queries or tables.
Forms are used for entering, modifying, and viewing records.
The reason forms are used so often is that they are an easy way to guide people toward
entering data correctly.
When you enter information into a form in Access, the data goes exactly where the
database designer wants it to go in one or more related tables.
Inserting Record
Double click the table and enter value for all the fields
22
Step 3: Choose Next Record in the Navigation pane, New empty will be displayed to enter
the data.
23
Query
An object that provides a custom view of data from one or more tables. Queries are a way of
searching for and compiling data from one or more tables.
Running a query is like asking a detailed question of your database.
When you build a query in Access, you are defining specific search conditions to find
exactly the data you want.
In Access, you can use the graphical query by example facility or you can write
Structured Query Language (SQL) statements to create your queries.
You can define queries to Select, Update, Insert, or Delete data.
You can also define queries that create new tables from data in one or more existing
tables.
To Create Query using a Design View
MS-Office Access provides you functionality to create a query by using a Design View. Steps to
create a query through a Design View are as follows:
Step 1 – Open the Create tab from the Ribbon and select the Query Design command from
Another group.
24
Step 2 – Select the Query Type
25
Step 4 : Choose Details Option
Step 5 : Specify the Query Name and modify the Query Design (Insert Heading an
26
Step 6: Click Button to view the output.
Result:
Query Type:
27
Update
Insert
Delete
28
4. Specify the query name and Open the query to view and click Finish
29
Choose Select Query and specify the condition
Update Query
Select Query Wizard from the Create Ribbon
Select Table and Field, Click Next and Finish
Choose Update from the Design Tab.
30
Specify value in the Update to Column Yield of specified or required field.
(Update yield to 7000).
Delete Query
Delete a Record (single or multiple records)
31
Select Query Wizard from the Create Ribbon
Select Table and Field, Click Next and Finish
Input Data
Output
32
Report
Report is an object in desktop databases designed for formatting, calculating, printing, and
summarizing selected data.
You can view a report on your screen before you print it.
If forms are for input purposes, then reports are for output.
Anything you plan to print deserves a report, whether it is a list of names and
addresses, a financial summary for a period, or a set of mailing labels.
Reports are useful because they allow you to present components of your database in
an easy-to-read format.
You can even customize a report's appearance to make it visually appealing.
Access offers you the ability to create a report from any table or query.
33
3. Choose the sorting order and click Next
4. Choose the Layout as Tabular
5. Specify the filename and choose the option as preview to modify the report.
6. Choose Finish
34
7. Change the Report Header ,Page Header and Alignmnet
8. Output
35
36
Lecture 6
Computer programming:
Programming is a way to “instruct the computer to perform various tasks”. It can perform
a variety of tasks like receiving data, processing it, and producing useful results. A computer
needs to be instructed to perform even a simple task like adding two numbers. Computers work
on a set of instructions called computer program, which clearly specify the ways to carry out a
task. Computer programs are developed using computer or programming languages.
Programming involves many stages such as task analysis, flowcharting, coding, program
testing, implementation, documentation and maintenance.
Developing a program:
A program consists of a series of instructions that a computer processes to perform the
required operation. In order to design a program, a programmer must determine three basic
rudiments:
1. The instructions to be performed.
2. The order in which those instructions are to be performed.
3. The data required to perform those instructions.
PROGRAMMING LANGUAGES:
Computers are machines. Unfortunately, they cannot understand natural languages,
such as Hindi, English, Tamil, etc. that human beings speak and understand. Therefore, to give
instructions to computers, different languages have been developed. These languages are
called computer languages. To get a particular work done by computers, programmers write
instructions using these computer languages. Over the last few decades, several computer
languages have developed. Different computer languages are suitable for different applications.
For example, COBOL (Common business-oriented Language) may be more suitable for
business applications, FORTRAN may be more suitable for scientific or engineering
applications. We can classify all computer languages into three categories.
A programming language is a notation for writing programs, which are specifications
of a computation or algorithm. Some, but not all, authors restrict the term "programming
language" to those languages that can express all possible algorithms. Traits often considered
important for what constitutes a programming language include:
A computer programming language is a language used to write computer
programs, which involve a computer performing some kind of computation or algorithm and
possibly control external devices such as printers, disk drives, robots, and so on. For example,
PostScript programs are frequently created by another program to control a computer printer
or display. More generally, a programming language may describe computation on some,
possibly abstract, machine.
It is generally accepted that a complete specification for a programming language
includes a description, possibly idealized, of a machine or processor for that language. In most
practical contexts, a programming language involves a computer; consequently, programming
languages are usually defined and studied this way. Programming languages differ from natural
languages in that natural languages are only used for interaction between people, while
programming languages also allow humans to communicate instructions to machines.
The term computer language is sometimes used interchangeably with programming
language. However, the usage of both terms varies among authors, including the exact scope
of each. We assume you are well aware of English Language, which is a well-known Human
Interface Language. English has a predefined grammar, which needs to be followed to write
English statements in a correct way. Likewise, most of the Human Interface Languages (Hindi,
English, Spanish, French, etc.) are made of several elements like verbs, nouns, adjectives,
adverbs, propositions, and conjunctions, etc.
Similar to Human Interface Languages, Computer Programming Languages are also
made of several elements. These basic elements include
Programming Environment
Basic Syntax
Data Types
Variables
Keywords
Basic Operators
Decision Making
Loops
Numbers
Characters
Arrays
Strings
Functions
File I/O
1. Query Languages:
2. Report Generators:
3. Application Generators:
TRANSLATORS:
A program written in high-level language is called as source code. To convert the source
code into machine code, translators are needed. A translator takes a program written in source
language as input and converts it into a program in target language as output. It also detects
and reports the error during translation.
i. Compiler
ii. Interpreter
Compiler:
We write our computer program using our favorite programming language and save it
in a text file called the program file.
Actually, the computer cannot understand your program directly given in the text
format, so we need to convert this program in a binary format, which can be understood by
the computer.
The conversion from text program to binary file is done by another software called
Compiler and this process of conversion from text formatted program to binary format file is
called program compilation. Finally, you can execute binary file to perform the programmed
task.
The following flow diagram gives an illustration of the process −
Interpreter
Interpreter is a translator which is used to convert programs in high-level language to
low-level language. Interpreter translates line by line and reports the error once it encountered
during the translation process. It directly executes the operations specified in the source
program when the input is given by the user.
It gives better error diagnostics than a compiler.
Step 6: Stop
FLOWCHART
Flowchart is a means of visually presenting the flow of data through an information
processing system, the operations performed within the system and the sequence.
SYMBOL SYMBOL NAME DESCRIPTION
To connect symbols.
Flow Lines These lines indicate the
sequence of steps and
direction of flow.
To represent the beginning
Terminal the termination or halt in
the program logic.
Represents information
Input / Output entering or leaving the
system, such as customer
order and servicing.
Process symbol is used for
Processing representing arithmetic
and data movement
instructions.
Decision symbol denotes a
Decision decision to be made.
This symbol has one entry
and two exit paths.
Connector To join different flow
lines.
To indicate that the
Off-page Connector flowchart continues on
the next page.
To represent a paper
Document document produced
during the flowchart
process.
To provide additional
Annotation information about another
----------------- flowchart symbol.
Represents input to be
Manual Input given by a
developer/programmer.
Shows that the process
Manual Operation has to be done by a
developer/programmer.
Represents the online data
Online Storage storage such as hard disks,
magnetic drums, or
other storage devices.
Represents the offline data
Offline Storage storage such as sales on OCR
and data on
punched cards.
To represent data
Communication Link received or to be
transmitted from an
external system.
To represent is used to
Magnetic Disk represent data input or
output from and to a
magnetic disk.
4. The direction of the flow of a procedure should always be from left to right or top to
bottom.
5. Only one flow line should come out from a process symbol.
or
6. Only one flow line should enter a decision symbol. However, two or three flow lines may
leave the decision symbol.
<0 >0
=0
7. Only one flow line is used with a terminal symbol.
Benefits of Flowcharts:
Makes Logic Clear: To plan a task, it provides a pictorial representation of the task,
which makes the logic easier to follow.
Communication: Being a graphical representation of a problem solving
logic, flowcharts are better way of communicating the logic of a system to all
concerned.
Effective analysis: With the help of a flowchart, the problem can be
analysed in an effective way.
Useful in coding: Once the flowcharts are ready, the programmers can plan the coding
process effectively.
Proper Testing and Debugging: A flowchart helps in detecting the errors in a
program, as the developers know exactly what the logic should do.
Appropriate Documentation: Flowcharts serve as a good program
documentation tool.
Limitations of Flowcharts:
Flowchart can be used for designing the basic concept of the program in pictorial form but
cannot be used for programming purposes. Some of the flowchart limitations are given below:
Complex: The major disadvantage in using flowcharts is that when a program is very
large, the flowcharts may continue for many pages, making them hard to follow.
Costly: If flowcharts are to be drawn for a huge application, the time and
cost factor of program development may get out of proportion, making it a costly
affair.
Difficulty to Modify: Any changes or modification to a flowchart usually
requires redrawing the entire the entire logic again, and redrawing a complex flowchart
is not a simple task.
No update: Usually programs are updated regularly. However, the
corresponding update of flowcharts may not take place, especially in the case of large
programs.
Lecture 7
Introduction to C
C is a procedural programming language. It was initially developed by Dennis Ritchie
at Bell laboratories in the year 1972. It was mainly developed as a system programming language
to write an operating system. The main features of C language include low-level access to
memory, a simple set of keywords, and clean style, these features make C language suitable for
system programming like an operating system or compiler development.
Many later languages have borrowed syntax/features directly or indirectly from C
language. Like syntax of Java, PHP, JavaScript, and many other languages are mainly based
on C language. C++ is nearly a superset of C language
Structure of a C program
By structure, it is meant that any program can be written in this structure only. Writing
a C program in any other structure will hence lead to a Compilation Error.
The structure of a C program is as follows:
Documentations (Documentation Section)
Preprocessor Statements (Link Section)
Global Declarations (Definition Section)
The main() function
Local Declarations
Program Statements & Expressions
User Defined Functions
The components of the above structure are:
Header Files Inclusion:
The first and foremost component is the inclusion of the Header files in a C program.
A header file is a file with extension .h which contains C function declarations and macro
definitions to be shared between several source files.
Some of C Header files:
stddef.h – Defines several useful types and macros. stdint.h –
Defines exact width integer types.
stdio.h – Defines core input and output functions
stdlib.h – Defines numeric conversion functions, pseudo-random network generator,
memory allocation
string.h – Defines string handling functions math.h – Defines
common mathematical functions Syntax to include a header file
in C:
#include
Main Method Declaration: The next part of a C program is to declare the main()
function. The syntax to declare the main function is:
Syntax to Declare main method: int main()
{
}
Variable Declaration:
The next part of any C program is the variable declaration. It refers to the variables that
are to be used in the function. Please note that in the C program, no variable can be used without
being declared. Also, in a C program, the variables are to be declared before any operation in
the function.
Example: int
main()
{
int a;
.
.
Body:
Body of a function in C program, refers to the operations that are performed in the
functions. It can be anything like manipulations, searching, sorting, printing, etc.
Example: int
main()
{
int a;
printf("%d", a);
Return Statement:
The last part in any C program is the return statement. The return statement refers to
the returning of the values from a function. This return statement and return value depend upon
the return type of the function. For example, if the return type is void, then there will be no
return statement. In any other case, there will be a return statement and the return value will be
of the type of the specified return type.
Example: int
main()
{
int a;
printf("%d", a);
return 0;
}
Writing first program:
Following is first program in C
#include <stdio.h> int
main(void)
{
printf("Computer Programming");
return 0;
}
Let us analyze the program line by line.
Line 1: [ #include <stdio.h> ]
In a C program, all lines that start with # are processed by preprocessor which is a
program invoked by the compiler. In a very basic term, preprocessor takes a C program and
produces another C program. The produced program has no lines starting with #, all such lines
are processed by the preprocessor. In the above example, preprocessor copies the preprocessed
code of stdio.h to our file. The .h files are called header files in C. These header files generally
contain declaration of functions. We need stdio.h for the function printf() used in the program.
DATA TYPES:
A data-type in C programming is a set of values and is determined to act on those values.
C provides various types of data-types which allow the programmer to select the appropriate
type for the variable to set its value.
The data-type in a programming language is the collection of data with values having
fixed meaning as well as characteristics. Some of them are an integer, floating point, character,
etc. Usually, programming languages specify the range values for given data-type.
The exact sizes and ranges of values for the fundamental types are
implementation dependent.
VARIABLES:
A variable is nothing but a name given to a storage area that our programs can
manipulate. Each variable in C has a specific type, which determines the size and layout of the
variable's memory; the range of values that can be stored within that memory; and the set of
operations that can be applied to the variable.
The name of a variable can be composed of letters, digits, and the underscore character.
It must begin with either a letter or an underscore. Upper and lowercase letters are distinct
because C is case-sensitive.
A variable definition tells the compiler where and how much storage to create for the
variable. A variable definition specifies a data type and contains a list of one or more variables
of that type as follows −
type variable_list;
Here, type must be a valid C data type including char, int, float, double, bool; and
variable list may consist of one or more identifier names separated by commas. Some valid
declarations are shown here −
int i, j, k;
char c, ch; float f,
salary; double d;
The line int i, j, k; declares and defines the variables i, j, and k; which instruct the
compiler to create variables named i, j and k of type int.
Variables can be initialized (assigned an initial value) in their declaration. The
initializer consists of an equal sign followed by a constant expression as follows −
type variable_name = value;
CONSTANTS:
Constants are like a variable, except that their value never changes during execution
once defined. C Constants is the most fundamental and essential part of the C programming
language. Constants in C are the fixed values that are used in a program, and its value remains
the same during the entire execution of the program.
Constants are also called literals. Constants can be any of the data types. It is
considered best practice to define constants using only upper-case names.
const type constant_name;
const keyword defines a constant in C.
Constants are categorized into two basic types, and each of these types has its
subtypes/categories. These are:
1. Numeric Constants
a. Integer Constants (eg: 15, -265, 0, 99818, +25, 045, 0X6)
b. Real Constants (eg: fractional parts like 99.25)
2. Character Constants
a. Single Character Constants (eg: 'X', '5', ';')
b. String Constants (eg: "Hello!", "2015", "2+1")
c. Backslash Character Constants (eg: \t is used to give a tab,
\n is used to give a new line)
OPERATORS:
C operators are symbols that are used to perform mathematical or logical manipulations.
The C programming language is rich with built-in operators. Operators take part in a program
for manipulating data and variables and form a part of the mathematical or logical expressions.
Generally, there are six type of operators:
i. Arithmetical operators,
ii. Relational operators,
iii. Logical operators,
iv. Assignment operators,
v. Conditional operators,
vi. sizeof operator.
Arithmetical operators
Arithmetic Operators are used to performing mathematical calculations like addition
(+), subtraction (-), multiplication (*), division (/) and modulus (%).
Operator Description
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus
Relational operators
Relational operators are used to comparing two quantities or values.
Operator Description
== Is equal to
!= Is not equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
Logical operators
C provides three logical operators when we test more than one condition to make
decisions. These are: && (meaning logical AND), || (meaning logical OR) and ! (meaning
logical NOT).
Operator Description
&& And operator. It performs logical conjunction of two expressions.
(if both expressions evaluate to True, result is True. If either
expression evaluates to False, the result is False)
|| Or operator. It performs a logical disjunction on two expressions. (if
either or both expressions evaluate to True, the result is True)
! Not operator. It performs logical negation on an expression.
Assignment operators
Assignment operators applied to assign the result of an expression to a variable.
C has a collection of shorthand assignment operators.
Operator Description
= Assign
+= Increments then assign
-= Decrements then assign
*= Multiplies then assign
/= Divides then assign
%= Modulus then assign
Example:
Equivalent of A + = 2 is A = A + 2
Input/Output statements:
When we say Input, it means to feed some data into a program. An input can be given
in the form of a file or from the command line. C programming provides a set of built-in
functions to read the given input and feed it to the program as per requirement.
When we say Output, it means to display some data on screen, printer, or in any file. C
programming provides a set of built-in functions to output the data on the computer screen as
well as to save it in text or binary files. The two
input/output statements in C are:
i. printf() - We can use printf() function to output strings and numbers on screen as we
seen in previous examples.
ii. scanf() - The scanf() function is used to read data from keyboard and store it in
variable.
printf()
printf is a predefined function in "stdio.h" header file, by using this function, we can
print the data or user defined message on console or monitor. While working with printf(), it
can take any number of arguments but first argument must be within the double cotes (" ") and
every argument should separate with comma ( , ) Within the double cotes, whatever we pass,
it prints same, if any format specifies are there, then that copy the type of value. The scientific
name of the monitor is called console.
Syntax
printf("user defined message");
Example of printf function
int a=10; double d=13.4;
printf("%f%d",d,a);
scanf()
scanf() is a predefined function in "stdio.h" header file. It can be used to read the input value
from the keyword.
Syntax
scanf("format specifiers",&value1,&value2, .... );
Example of scanf function
int a; float b;
scanf("%d%f”, &a,&b);
In the above syntax format specifier is a special character in the C language used to specify
the data type of value.
Branching:
Branching is so called because the program chooses to follow one branch or another.
if statement:
It is a powerful decision-making statement and is used to control the flow of execution
of statements. It is basically a two-way decision statement and is used in conjunction with an
expression. It takes the following form:
Syntax:
if (Text expression)
{
block of statements;
};
It allows the computer to evaluate the expression first and then, depending on whether
the value of the expression is ‘true’ (or non-zero) or ‘false’ (zero) , it transfer the control to a
particular statement. The if statement may be implemented in different forms depending on the
complexity of conditions to be tested. The different forms are:
a. Simple if statement
b. if …..else statement
a. if statement:
Example
#include<stdio.h>
#include<conio.h>
void main()
{
int a=10; if(a<=10)
{
printf("a is less than 10");
}
getch();
}
Output
a is less than 10
b. else if statement:
else is a keyword, by using this keyword we can create a alternative block for "if" part.
Using else is always optional i.e, it is recommended to use when we are having alternate block
of condition.
In any program among if and else only one block will be executed. When if condition
is false then else part will be executed, if part is executed then automatically else part will be
ignored.
Syntax
if (expression)
{
Block of statements;
}
else
{
Block of statements;
}
Example
#include<stdio.h>
#include<conio.h> void
main()
{
int time=10; clrscr();
if(time>12)
{
printf("Good morning");
}
else
{
printf("Good after noon");
}
getch();
}
Output
Good morning
Looping Statements
Looping statements are the statements which executes one or more statement
repeatedly several number of times. In C programming language there are three types of
loops; while, for and do-while.
Types of Loops:
There are three types of Loops available in 'C' programming language.
while loop
do..while
for loop
Difference between conditional and looping statement
Conditional statement executes only once in the program where as looping statements
executes repeatedly several number of times.
While loop
In While Loop in C, first check the condition if condition is true then control goes
inside the loop body otherwise goes outside the body. While loop will be repeats in
clockwise direction.
Syntax
while(condition)
{
Statements;
......
Increment/decrements (++ or --);
}
Note: If while loop condition never false then loop becomes infinite loop.
Example:
#include<stdio.h>
#include<conio.h>
void main()
{
int i; clrscr(); i=1;
while(i<5)
{
printf("\n%d",i); i++;
}
getch();
}
Output
1
2
3
4
do-while
A do-while Loop in C is similar to a while loop, except that a do-while loop is execute
at least one time.
A do while loop is a control flow statement that executes a block of code at least once,
and then repeatedly executes the block, or not, depending on a given condition at the end of
the block (in while).
Syntax
do
{
Statements;
........
Increment/decrement (++ or --)
} while ( );
Example:
#include<stdio.h>
#include<conio.h>
void main()
{
int i; clrscr(); i=1;
do
{
printf("\n%d",i); i++;
}
while(i<5); getch();
}
Output
1
2
3
4
for loop
for is a statement which allows code to be repeatedly executed. For loop contains 3
parts Initialization, Condition and Increment or Decrements.
When you need to execute a block of code several number of times then you need to use
looping concept in C language. In C Programming Language for loop is a statement which
allows code to be repeatedly executed. It contains 3 parts. for loop in C language is used to
iterate the statements or a part of the program several times.
i. Initialization
ii. Condition
iii. Increment or Decrements
Syntax
for (initialization; condition; increment)
{
statement(s);
}
Initialization: This step is executed first and only once when we are entering into the loop first
time. This step is allowed to declare and initialize any loop control variables.
Condition: This is next step after initialization step, if it is true, the body of the loop is
executed, if it is false then the body of the loop does not execute and flow of control goes
outside of the for loop.
Increment or Decrements: After completion of Initialization and Condition steps loop body
code is executed and then Increment or Decrements steps is execute. This statement allows to
update any loop control variables.
Example:
#include<stdio.h>
#include<conio.h> void
main()
{
int i; clrscr();
for(i=1;i<5;i++)
{
printf("\n%d",i);
}
getch();
}
Output
1
2
3
4