0% found this document useful (0 votes)
23 views

COPA

Uploaded by

Poonam Lathwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

COPA

Uploaded by

Poonam Lathwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 469

Computer Operator and Programming

Assistant Trade Theory


Annual Pattern (As per July 2022 syllabus)

Dr.V.Nagaradjane

October 7, 2022
Syllabus
Safe working practices, Scope of the COPA trade, Safety
rules and safety signs, Types and working of fire
extinguishers, Introduction to Computer components
Safe working practices
1) Do not touch power connections or loose power
cables without permission.
2) Do not eat in the lab space.
3) Keep your water bottles away from computer components
like CPU, monitor, keyboard, mouse, printer, etc.
4) Report any hardware issues immediately to the lab in-
charge.
5) Never open surf the Internet in the absence of your
faculty/ supervisor.
6) Do not play games on computer.
7) Properly shutdown the computer after completing your
works.
8) Do not charge any mobile devices.
9) Keep the lab space clean.
10) Report any abnormal conditions immediately.
Safety
Rules

Figure: Safe working practices[1]


Job Opportunities
1) Data entry job in any commercial organization.
2) One may setup Common Services Centre or browsing
centre.
3) Recruitment in State Government and Central
Government agencies for Data Entry Operator job.
4) One year apprenticeship in any Government or
Private organization.
5) Programming assistant job in software firms.
6) Point of Sale (PoS) Operator job in malls and
other commercial establishments.
Safety
symbols

Figure: Safety symbols)[?]


Components of computer
1) Central Processing Unit (CPU) is the main component of
comptuer.
2) CPU contains motherboard, RAM, Hard Disk, CD/DVD drive,
etc.
3) Motherboard contains a special RAM called CMOS
(Complimentary Metal Oxyde Semiconductor) for
storing date, time and other settings.
4) CMOS is kept in power-on condition using CR20232
battery.
5) Monitor is the display device. It is otherwise called
Visual Display Unit (VDU).
6) Keyboard and mouse are the most common input
devices.
7) Processor cycles are governed by control unit.
8) Calculations and comparisons are carried out at
Arithmetic and Login Unit (ALU).
Block diagram showing components of
computer

Figure: Components of
computer[?]
Concept of hardware and software
Hardware and software are the body and mind of the
computer. The physical hardware runs according to the
directions of the invisible software. The main differences
between hardware and software are presented in Table 1.

Table: Hardware & software

Sl. No. Hardware Software


1 Physically accessible Physically inaccessible
Can be touched, when power Cannot be touched, whether
2
is off power on or power off
Causes other components to
consume power to make
3 Consumes lot of power
them work. It does not
consume any power.
4 Occupies space Does not occupy visible space
Its existence is
5 Directly verifiable inferred
through the working of hard-
ware
Computer hardware
▶ The parts of computer which can be seen and touched are
called hardware. Generally, computer hardware consists of
the following 3 units:
1. Input unit: Input unit helps to send commands and data to
the Central Processing Unit (CPU) and fuels the
processor of the computer. Keyboard, mouse, scanner,
light pen, etc. are some of the common
input units.
2. Output unit: The peripherals like Visual Display Unit
(VDU)/Monitor, Printer, Plotter, etc. are some of
the most common output units.
3. Central Processing Unit (CPU) The Central Processing
Unit (CPU) processes input data and produces results, which
are out output data.
Central Processing Unit
▶ The processing centre of computer where mathematical and
logical operations are carried out by the processor is called
Central Processing Unit. The Central Processing Unit has
the following internal components:
1. Microprocessor.
2. Main Memory or Primary Storage or Random Access Memory.
3. Mother board.
4. Secondary Storage or Auxiliary Storage (Hard disk, optical
(CD/DVD) drive, floppy drive (obsolete).)
5. Switch Mode Power Supply (SMPS).
6. Connectors for storage and power controls.
7. Ports for connecting other devices.
Microprocessor

▶ Microprocessor is the chip that performs arithmetic and


logical operations based on given input data and
instructions and sends out the results of such processing
operation.
▶ Microprocessor contains huge number of electronic devices
like transistors, capacitors, resistors and inductors
embedded in neatly etched circuitry.
▶ Microprocessor is the brain of computer since all other
parts of computer simply coordinate with this one chip.
▶ Processor can complete one operation per clock cycle. The
number of clock cycles per second is called the speed of
the processor, measured in kHz (1 kHz = thousand cycles
per second) or FLOPS (FLoating Point OPerations per
Second).
▶ Control unit of the microprocessor directs the work to be
carried out by other parts of a computer. It coordinates
with the memory registers and Arithmetic and Logic Unit to
complete processing.
▶ Arithmetic and Logic Unit (ALU) is the part of
microprocessor circuitry which does the number crunching
and comparison works.
▶ Parallel processing in microprocessors is made possible
through multiple processor cores cast in a single
chip.
▶ Multi-core processors gain higher speed if proper
multi-processing algorithms are combined with multi-core
processors.
▶ Small memory called cache memory is etched on board
the micro-processor.
(a) Pentium 4 (b) Core (c) Core i3
Processor[47] 2 Duo Processor[49]
Processor[48]

(d) Core i5 (e) Core i7 (f) Athlon


Main Memory or Primary Storage or Random
Access Memory
▶ Main memory is the storage reserved for the data
and instructions moving to and from the processor.
▶ Main memory is very fast.

▶ Main memory does not retain any data. It looses data when
a program exits or when the computer is rebooted. Hence, it
is called Volatile storage - the storage that evaporates.
▶ Main memory is otherwise called primary storage,
volatile storage or the more common name of Random
Access Memory (RAM).

(a) SDRAM[53] (b) DDRSDRAM[54]

Figure: Common types of RAM


▶ Different types of RAM are:
1. SRAM: Static Random Access Memory
2. DRAM: Dynamic Random Access Memory
3. FPM DRAM: Fast Page Mode Dynamic Random Access
Memory
4. EDO DRAM: Extended Data Out Dynamic Random
Access
Memory
5. SDRAM: Synchronous Dynamic Random Access Memory
6. DDR SDRAM: Double Data Rate Synchronous Dynamic
Random Access Memory
7. RDRAM: Rambus Random Access Memory
8. VRAM: Video Random Access Memory
9. MPDRAM: Multi-Port Dynamic Random Access Memory
10. SGRAM: Synchronous Graphics Random Access Memory
Mother board
▶ The board containing the electronic components needed
for supporting the micro-processor (µP), RAM and other
components is called the mother board.
▶ Mother board has slots for connecting secondary storage
units like hard disk, CD drive, DVD drive, floppy disk, etc.
▶ Motherboard contains the Complimentary Metal Oxide
Semiconductor - CMOS, which keeps configuration
data needed at boot time. It is a RAM, but kept
constantly powered on by a special battery called CMOS
battery.
▶ Motherboard supports Basic Input Output System
(BIOS), which helps booting of the computer (power up
process).
▶ The motherboard supports Communication & Network
Riser - (CNR), Accelerated Graphics Port (AGP),
Figure: Motherboard[55]
Secondary Storage or Auxiliary
Storage
▶ Secondary storage or auxiliary storage is very slow
compared to the Random Access Memory, but it provides
permanent storage for data.
▶ Data stored in secondary storage or auxiliary memory will
be available even after the computer reboots.
▶ Hard disk, CD/ DVD drive, floppy drive, etc. are some of
the secondary storage units.
▶ Hard disk uses a magnetic plate mounted on
motorized spindle to store and retrieve data.
▶ Compact Disk (CD) or Digital Versatile Disk (DVD) drive
uses LASER beam of low strength for reading and high
strength for writing data.
▶ Floppy disk is a magnetic film coated plastic plate which
can store very small amount of data. Floppy disk is easily
damaged and is no longer used in computers.
Read Only
Memory
▶ Chip level storage, like the information stored in BIOS,
is called Read Only Memory.
▶ Read only memory is classified as follows:
1. PROM - Programmable Read Only Memory:
Programmable Read Only Memory. It may be reprogrammed
using PROM programmer, but only once.
2. EPROM - Erasable Programmable Read Only Memory:
Contents of EPROM may be erased using Ultra
Violet (UV) rays and reprogrammed using RPROM
programmer.
3. EEPROM - Electronically Erasable Programmable
Read
Only Memory: Contents of EEPROM may be erased in the
circuit where it is located and the same may be
reprogrammed. BIOS chip belongs to EEPROM category.
Common storage sizes are presented in Table
2.
Table: Memory sizes
Sl. No. Storage name Storage size Remarks
1 Bit 1 bit Smallest size memory. Stores 0 or 1
2 Nibble 4 bits
3 Byte 8 bits Smallest allocation unit through programs.
4 kilo Byte (kB) 1024 bytes 210 (1024) bytes
5 Mega Byte (MB) 1024 kilo bytes 220 (1048576) bytes
6 Giga Byte (GB) 1024 mega bytes 230 (1073741824) bytes
7 Tera Byte (TB) 1024 Giga bytes 240 (1099511627776) bytes
8 Peta Byte (PB) 1024 Tera bytes 250 (1125899906842624) bytes
9 Exa Byte (EB) 1024 Peta bytes 260 (1152921504606846976) bytes

Table: Storage capacities for computer media (secondary


storage)
Sl. No. Media Storage capacity
1 CD 700MB
2 DVD 4.7GB
3 SD/ Mini-SD/ Micro-SD card 2GB to 128GB
4 Pen drive 2GB to 128GB
5 Hard disk 250GB to 1TB
(a) Hard (b) CD/DVD (c) Floppy (d) Pen
drive[56] drive[57] drive[58] drive[59]

(e) SD, Mini SD and Micro-SD cards[60]


Switch Mode Power Supply (SMPS)
▶ Switch Mode Power Supply (SMPS) takes 240V input and
converts it to varying levels of output to suit the
requirements of different components of the CPU.
▶ SMPS is very efficient in power conversion and minimizes
wastage of electricity.
▶ SMPS produces radio frequency interference, which affects
communication signals in the radio frequency (mobile
phone, radio receiver, etc.)

Figure: Switch Mode Power Supply (SMPS)


CPU ports
▶ Ports are located at the rear panel of CPU.

▶ Ports help connection of various peripherals (like keyboard,


mouse, printer, scanner, camera, speaker, microphone,
audio-input, monitor, serial modem, broadband line, etc.) to
the computer.
▶ Some of the most common ports are: (i) PS/2 (Personal
System 2) ports for keyboard and mouse; (ii) RS-232
(Recommended Standard 232)/ Serial port for mouse,
modem and other serial devices; (iii) VGA (Video Graphics
Array) port for connecting monitor or projector; (iv)
Ethernet / RJ-45 (Registered Jack 45) for broadband
connection; (v) USB (Universal Serial Bus) port for
connecting printer, fax, pen drive, external hard disk, external
DVD writer, web camera, etc.; (vi) LPT (Line Printer
Terminal) port for connecting old style dot matrix/ line
printers; (vii) 3.5mm audio jack for speaker output/ mic
Figure: Ports in CPU
Input unit
1) Keyboard: Keyboard is otherwise called console input
unit. Common layout of keyboard supports English(US),
English(UK) and local languages like Hindi, Tamil, etc.

Figure: Keyboard [27]


Input unit
2) Mouse - Mouse has LASER based or roller based tracking
mechanism to measure change of position. The movement of
the mouse causes movement of pointer on the VDU. Mouse
has 3 buttons: (a) the left button, (b) the right button and
(c) the centre button which doubles as mouse roller for
scrolling.

Figure: Mouse [28]


Input unit
3) Scanner - It helps to convert content available on paper
to digital image using a moving scan system.
4) Tablet - It converts whatever is written with fingers or
a stylus to characters and images on screen.
5) Light pen - The device has a light sensitive tip which
converts traces the features of display on CRT monitor
and converts it to a new digital image.
Output unit
1) Monitor (otherwise called Console Output Unit or
Visual Display Unit (VDU))
1. Cathode Ray Tube (CRT) monitors were used in the early days
of computer.
2. Plasma (Ionized gas) monitors were also used with
computers. But, they are now used for large panel
televisions instead of computers. It is not
economical to manufacture plasma monitors
less than 32” in size.
3. Liquid Crystal Display (LCD), Light Emitting Diode (LED)
and
Thin Film Transistor (TFT) monitors are commonly used.
LCD may be a bit dull compared to LED and TFT monitors.
4. Plasma, LCD, LED and TFT monitors consume lower power
compared to the CRT monitors, occupy less space and present
vivid range of colours.
5. The maximum permissible resolution for LCD and LED
monitors is numerically limited but have sufficient resolution
(PPI - Pixels Per Inch) to produce vivid images.
(a) CRT[32] (b) LCD[34]

(c) TFT[33] (d) LED[35]

Figure: Types of monitor


Monitor resolution and aspect ratio
1) Resolution of monitor refers to the number of pixels
(Picture Elements, dots) which can be placed on the display
area.
2) Aspect ratio is ratio between the number of pixels in
the horizontal direction to the number of pixels in the
vertical direction.
3) The CRT monitors had aspect ratio of 4:3. Resolutions
of 400x300 and 800x600 fall under the aspect ratio of
4:3.
4) Modern LCD, LED and TFT monitors have aspect ratios of
16:9, 16:10, etc. Modern monitors are called wide screen
displays due to the higher width to height ratio. Resolution
of 1920x1080 is the typical resolution for aspect ratio of 16:9
and 1280x800 is the typical resolution for aspect ratio of
16:10.
5) Monitor resolution may also be measured using Pixels Per
Inch (PPI), which is the number of pixels in one inch
distance of the monitor.
Monitor resolutions
W
Table: Monitor resolutions
No. Display Definition Pixel resoultion Progressive Resolution
1 Standard Definition (SD) 640x480 480p
2 High Definition (HD) 1280x720 720p
3 Full High Definition (FHD) 1980x1080 1080p
4 2k resolution 2048x1080 2k
5 4k resolution 3840x2160 4k/ ultra HD
2) Printer: Printer produces paper copies called hard
copies. Following printers are available:
1. Impact type printers: Impact type printers hit the paper
using characters and shapes to produce an imprint on the
paper. Dot matrix printer, line printer, chain printer, golf
ball printer, daisy wheel printer, etc. are
examples of impact printers.
2. Non-impact type printers: Non-impact type printers do
not
physically hit the shapes and characters on the paper. Some
of the most common types of non-impact printer are:
(i) Inkjet printer: Inkjet printer uses ink cartridges and print
head. The head spits ink in desired pattern to produced
characters and shapes.
(ii) LASER printer: Laser printer uses heat generated by LASER
beam to create shapes/characters and make the toner powder
to stick to the paper
(iii) Thermal printer: Thermal printer creates desired shapes and
characters using heating filament on a special paper coated
with BisPhenol A (BPA). It is used in ATM machines,
ticketing machines, point of sale terminals, etc.
(iv) Plotter: Plotter is a large printer (usually non-impact type)
used to produce large size drawings on paper.
(a) DOT (b) p Line (c) p Chain
matrix p rinter[37] rinter[38]
rinter[36]

(d) Golf ball (e) Daisy


printer[39] wheel p
rinter[39]
(a) Inkjet printer[41] (b) LASER printer[42]

(c) Thermal printer[43] (d) Plotter[44]


Common terms related to computer hardware
1) CPU: Central Processing Unit
2) PS2: Personal System 2
3) USB: Universal Serial Bus
4) RS-232 (Serial) port: Recommended Standard 232
5) LPT (Parallel) port: Line Print Terminal
6) VGA: Video Graphics Array
7) RJ-45: Registered Jack 45. Other names: Ethernet port
or LAN Port. LAN stands for Local Area Network. Used
for broadband connection.
8) RJ-11: Registered Jack 11. Used for connecting
telephone line or networking through telephone line.
9) DVI: Digital Visual Interface.
10) HDMI: High Definition Media Interface.
11) SMPS: Switch Mode Power Supply.
12) HDD: Hard Disk Drive.
Common terms related to computer hardware
13) FDD: Floppy Disk Drive.
14) SATA: Serial Advanced Technology Attachment.
15) PATA: Parallel Advanced Technology Attachment.
Otherwise called Parallel port or IDE port.
16) IDE: Integrated Device Electronics. This is an alternate
name for PATA.
17) RAM: Random Access Memory. Otherwise called Primary
storage or main memory or volatile memory.
18) CMOS: Complimentary Metal Oxide Semi-conductor.
19) BIOS: Basic Input Output System.
20) CNR: Communication and Network Riser.
21) IEEE 1394: Institute of Electrical and Electronics
Engineers 1394. Otherwise called Firewire port.
22) ATA: Advanced Technology Attachment.
23) ATX: Advanced Technology eXtension.
24) DDR: Double Data Rate.
Computer software

▶ Computer software decides how the hardware works.

▶ Software is the reason why computers can produce


output based on given input.
▶ Software can be divided into 2 essential categories:
1. System software: The software needed for by the computer
to support other software and hardware components
is called the system software. The Basic Input Output
System (BIOS), the Operating System (Windows, Unix,
Linux, Mac OS, etc.) and device drivers are the
major system software. System software does not directly
carry out any productive work (like document
editing). It helps other software packages to work and
produce desired output through available hardware.
2. Application software: Application software helps in
productive working of computer like creating
documents, spreadsheets, playing music/video,
managing databases, etc.. It does not worry about
Functions of an operating system
1) Operating system coordinates with BIOS in
identifying hardware available at the time of booting.
2) Operating system initializes, operates and controls
all peripheral units through appropriate drivers.
3) Operating system coordinates application programs and
allows time sharing or parallelism. Parallel processing helps
several applications to run concurrently through sharing of
the processor time. Users feel as if all the applications are
running continuously in the background and foreground.
4) Operating system allots, manages and frees memory
needed for other processes.
Introduction to operating
system
5) Operating system makes secondary storage devices to
load and save data.
6) Operating system manages network connections and
shares available connection between programs needing
network access.
7) Operating system manages hard disk fragmentations and
tries to arrange storage tracks in continuous chunks.
8) The core of the operating system, handling hardware, file
system and networking is called the kernel of the
operating system.
9) The part of the operating system which interacts with the
user is called shell of the operating system. Shell can
provide command line interface or Graphical User Interface
(GUI).
Popular Operating Systems in
use ▶ Following are the most popular operating systems
on computers:
1. Microsoft Windows
2. Apple Mac OS
3. Linux
4. UNIX
5. Free BSD, Darwin, BeOS, Solaris, IBM AIX, etc.
Microsoft Windows

▶ Microsoft Disk Operating System (MSDOS) released in 1981.


Development of MS DOS was stopped in the year 2000.
▶ MS DOS based Windows 1.0 was released by Microsoft in
1985. After Windows 3.1, subsequent releases were named
Windows 95, Windows 98, Windows Me. The MSDOS
based Windows were discontinued.
▶ Microsoft released a stable, multi-tasking, multi-processor
operating system named Windows NT in 1993. It was
succeeded by Windows 2000, Windows XP, Windows
Vista, Windows 7, Windows 8, Windows 10 and Windows
11.
Windows
11

Figure: Windows 11 [4]


(a) Windows (b)
10[?] Win-
dows
10
Mobi
le[65
]
Figure: Windows 10
Mac OS
▶ Apple computers released the first version of GUI based
Mac OS in the year 1984.

(a) Mac OS[63] (b)


iOS

Figure: Mac OS and iOS


Linux

▶ Linux was developed by Linus Torvalds in the year 1991.

▶ Linux is distributed under the GNU General Public License


(GNU GPL), which permits free access to source code, but
mandates redistribution of software under the same
license.
▶ Linux operating system was inspired by Unix operating
system.
▶ Linux provides a stable, scalable, highly productive kernel.
(a) GNOME on Linux[63]

(b) KDE on Linux[?]


Mobile adaptations of Linux kernel

(a) Android (b) Firefox (c) Tizen[68]


OS[67]

Figure: Mobile versions of Linux


UNIX

▶ UNIX was one of the first operating systems to


support multi-tasking and multiple user logins.
▶ UNIX was developed at AT&T Bell Labs in the year 1970
by Ken Thompson, Dennis Ritchie, M. D. McIlroy and J. F.
Ossanna and others.
▶ UNIX still remains the gold standard for any operating
system.
▶ The UNIX operating system was standardized by POSIX
(Portable Operating System Interface), which was
superceded by SUS (Single Unix Standard).
Figure: Common Desktop Environment (CDE) on UNIX
Overview of operating
systems
▶ By market share, Microsoft Windows is the most
common operating system used in personal computers.
▶ Windows 10 and Windows 11 are the most common
versions of Windows at present.
▶ Windows 3.1, Windows 95, Windows 98, Windows Me,
Windows NT, Windows 2000, Windows 2003, Windows XP
and Windows 7 and Windows 8 are some of the obsolete
versions of Windows operating system.
▶ Apple computers installs Mac OS X in its computers. This
operating system presents a Graphical User Interface
(GUI) and good security. Mac OS Big Sur is the latest
version of Mac.
▶ Free operating system named Linux is available for variety of
computers from desktops to servers. Linux kernel has been
repacked with a variety of features in the names of Debian,
Main features of Windows O.S.
1) Windows is based on a graphical user environment
called Desktop.
2) The desktop contains a collection of icons, named
desktop icons or shortcut icons.
3) Windows provides a taskbar. The Taskbar contains
start menu, quick launch icons and the system tray.
4) The start button opens a list of applications which can be
run by clicking on their names or icons. Usually, start button
appears at the left most end of task bar.
5) Quick launch icons are provided near the start button.
They offer shortcuts to frequently used programs.
6) System tray provides status of several background tasks,
data and time, volume control (optional) and network
connectivity icon. The system tray is a quintessential control
panel for background programs.
7) Clicking any icon in the desktop area or quick launch
bar opens the corresponding application.
8) The list of processes currently running in the foreground
Directory structure
1) Windows provides a directory named user (also called
Documents and Settings) in the root folder of C: drive.
2) The user folder contains sub-folders representing the name of
each user who logs in. In addition to individual sub-folders, a
sub-folder named Public is available, the contents of which
are shared with all users.
3) The sub-folder named after the individual user is called
the Home folder. E.g., a person having login name krish
gets a home folder called C : \users\krish.
4) Within the home directory, folder named Desktop stores all
items seen in the desktop, Documents saves all files created
by the user, Downloads saves all files downloaded from the
Internet, Pictures stores all image files, Videos saves all
video files, folder named Music saves all music files.
Features of Windows Explorer

▶ Windows Explorer may be opened from the start menu or


by pressing Windows button+E.
▶ To rename a file, right click on the file (or select the file
and press F2). The name file becomes editable.
▶ To copy a file, right click and choose copy (or press
Ctrl+C).
Press Ctrl+V at the new destination where a copy of the
original file is needed.
▶ To cut a file (make a copy file and remove the original file),
right click and choose cut (or press Ctrl+X). Press Ctrl+V at
the new destination where a copy of the original file is
needed. After copying, the original file will be deleted.
▶ To open a document, spreadsheet, music file, video file or
any other file having a known support application (like MS
▶ To create desktop shortcut to a file, right click on the
file, choose Send to − > Desktop (create shortcut).
▶ To burn a file to CD/DVD, right click the file, choose Send
to− >X: <CD/DVD Drive name>. The file writing dialog
will appear when a blank CD/DVD is inserted. Follow on
screen instructions to complete the process.
▶ To compress a file, right click, choose Send to − >
Compressed/Zipped archive. The file will be compressed. If
a third party zipping program like WinZip or WinRAR is
installed, separate entries will be available for zipping.
▶ To unzip a compresed archive, simply double click the
archive.
Otherwise, right click the archive and choose appropriate
option for unzipping.
▶ Large files can be compressed into smaller size with the
help of zipping. WinRAR provides support for splitting a
Shortcut keys in Windows
▶ F1 - Windows help.

▶ F2 - Rename.

▶ F3 - Find all files.

▶ F5 - Refresh current window.

▶ F6 - Move among panes in Windows Explorer.

▶ Windows + L - Lock computer.

▶ Windows + M - Show desktop.

▶ Windows + D - Show desktop.

▶ Windows + R - Run a command.

▶ Windows + P - Display sharing (with projector, secondary


monitor, etc.).
▶ Windows + V - start clipboard.
...Shortcut keys in Windows
▶ Alt+F4 - Close current program/shutdown Windows.

▶ Alt+Tab - Cycle through currently running processes.

▶ Alt+Down arrow - Pop down list.

▶ Alt+Space - Window’s system menu.

▶ Alt+- - System menu for child window.

▶ Alt+Enter -properties of the selected object.

▶ Alt+Left arrow - Previous folder in Windows Explorer.

▶ Shift+Delete - Delete permanently.

▶ Shift+F10 - Context menu; equivalent to right click.

▶ SHIFT - Disable autorun for newly inserted media.

▶ Ctrl+F4 - Closes the current child window.


Booting process of computer

▶ Booting is the process of harware waking up and getting


ready to load the operating system (Windows, Linux, Mac
OS X, etc.).
▶ When the computer boots, the BIOS (Basic Input Output
System) activates a series of hardware checkes called
Power On Self Test (POST).
▶ The BIOS reads essential settings like date, time and
boot device order, as customized by the user, from the
CMOS.
▶ BIOS initializes all devices (disc drives, video cards,
sound cards, network cards, floppy drives, USB ports and
hard drives) connected to the computer.
▶ BIOS later works with the processor to transfer data to
and from those devices.
Booting process of computer
▶ On successful completion of the POST routines, the boot
loader loads the operating system from specified boot
device (hard disk, DVD ROM, CD ROM, etc.).
▶ The boot loaded initially loads from a chip and is called
Primary Boot Loader. The primary boot loader then calls
a more elaborate boot loader program called Secondary
Boot Loader.
▶ The secondary boot loader is normally stored in Master
Boot Record (MBR). GNU GRUB, BOOTMGR, NTLDR,
UEFI
(Unified Extensible Firmware Interface) or ESP (EFI system
partition).)
▶ The secondary boot loader, loads the operating system.
When the operating system finishes loading, booting is
complete and the computer is ready for usage.
Booting process of computer
▶ In case the POST fails, codified beeps are issued to
denote the type of error encounted during POST. The
beep codes and messages are as follows:
1. Steady, short beeps: Power supply may be bad
2. Long continuous beep tone: Memory failure
3. Steady, long beeps: Power supply bad
4. No beep: No power supply or beeper damaged.
5. One long, two short beeps: Video card failure
BIOS settings

▶ BIOS is the Basic Input Output System in computer.

▶ Settings needed for BIOS are stored in CMOS (a RAM chip).

▶ CMOS is kept continuously power on using a special


battery called CMOS battery (model No.CR2032).
▶ When CMOS battery fails or is removed, all settings stored
in CMOS are lost.
▶ BIOS settings may be accessed by pressing DEL, F2, ESC,
or any other key (depending on the manufacturer)
immediately after switching the power supply on.
BIOS settings
▶ The BIOS settings may be classified under the
following heads:
1. Main: Settings related to date, time, drive options,
memory details, etc.
2. Advanced: Configuration of processor, on board features of
the motherboard, configuration of USB, etc. can be
accessed through Advanced option.
3. Power: Power options relate to the options to deal with
power
off and subsequent restart, suspension of disk drive
after particular duration, etc.
4. Boot: The options relating to UEFI, order of the boot
devices
and options to change boot order, etc. are displayed in
boot settings.
5. Security: The options related to setting of user and
administrator passwords is available from Security menu.
6. Exit: Options for saving the settings before exit, load optimal
defaults before exit, load previous settings that
worked, discard all changes and exit the CMOS settings, etc.
Figure: Message to access BIOS settings
Figure: BIOS - Main settings
Figure: BIOS - Advanced settings
Figure: BIOS - Boot settings
Figure: BIOS - Security settings
Figure: Message for booting from CD
Basic Hardware and software issues and their solutions
1) Brute solution to many problems: Reboot the computer.
It solves several problems without going through the details.
So, restart is the first solution to fix problems in a running
computer.
2) Computer is slow: Remove Internet connection. Run disk
cleanup from control panel. Open task manager (run
taskmgr, press Ctrl+Shift+Esc, or press Ctrl+Alt+Delete and
choose task manager), right click unwanted programs and
choose End Process.
3) Computer misbehaves: Remove all peripherals. Connect
just monitor, keyboard and mouse. Boot PC to know
whether problems recurs. Add all other peripheral units one
by one. Identify whether the problem occurs due to any
particular peripheral.
4) PC does not boot: Reconnect/ replace power cables.
Check whether SMPS is running (SMPS switch turned on
and fan running in the rear panel). Check whether
motherboard LED is lit up.
5) Long beeps & boot halted: Remove RAM chip. Clean
the RAM canal and the ram chip. Reinsert the chip.
6) Insert boot media error: Open BIOS settings. Arrange
boot devices in right order. Reboot. If problem persists, see
whether the required media is listed in the BIOS. Boot from
alternate media (like CD, DVD or pen drive) to check
whether the PC can boot at all.
7) Boot halted due to wrong settings: Press Del or F2
or enlisted key to access BIOS. Set correct date and
time.
8) PC does not switch on: Check power cables. Check
SMPS.
9) BIOS settings are lost after each poweroff:
Replace CMOS battery (CR2032).
10) Printers do not work: Open control panel. Go to
services. Click on Print Spooler service. If it is not running
(most probable), start the service.
11) PC Reboots while working: Try another RAM. If
problem persists, try another SMPS. Check all IDE/ SATA
cables. Reinsert all power cables.
12) Internet connection is slow: See whether Windows is
automatically downloading updates. Pause the updates and
check connection speed (Automatic updates may be
disabled using control panel).
13) Cannot install new program: Right click on setup file and
choose Run as administrator. If it does not solve the
problem, choose compatible installer (32 bit or 64 bit) for the
operating system.
14) Paper jam error: Switch off printer. Remove top
cover. Remove jammed paper. Power on the printer and
check whether it works.
Usage of application software

▶ Application software packages help in making productive


use of computers.
▶ Microsoft Office is one of the most popular
appication software packages.
▶ MS Office contains Word for document editing, Excel for
spreadsheets, PowerPoint for making presentations.
▶ MS Paint helps in preparation of drawings and editing of
images.
▶ Third party applications may be installed for image editing
(Photoshop, GIMP, Corel Draw, etc.), video editing (Adobe
Premier, Openshot, etc.) or any other task.
▶ For browsing the web, Microsoft Edge (Based on Chrome)
is available. Third party browsers like Firefox, Google
Antivirus

▶ Antivirus prevents malicious software from infecting the


computer.
▶ Antivirus packages like McAffee, Norton, Kaspersky, K7,
Bitdefender, Panda, AVG, etc. are available for annual
payment for renewal.
▶ Some free antivirus packages like Avast, Avira, AVG
(free version), Malwarebytes, etc. are also available.
▶ Generally, installation of antivirus slows down the performance
of computer.
▶ Antivirus prevents viruses spreading through pen drives, DVDs
and the Internet/ email.
Introduction to DOS
▶ MS DOS was a small operating system released by
Microsoft Corporation in the year 1981 to run on IBM
Personal Computer.
▶ After releasing version 8.0 in September 2000,
development work on MS DOS ceased.
▶ MS DOS applications had either .COM extension or .EXE
extension.
▶ MS DOS supports two types of commands:
(i) Internal DOS commands - the commands which were part
of the DOS os and loaded to memory, whether called for or
not. These commands are also called Memory Resident
DOS Commands.
(ii) External DOS commands - the commands which were kept
in disk and loaded only when invoked from the
command prompt.
▶ A collection of DOS commands may be typed inside a file
(typically beginning with @echo off) having .BAT extension
Internal DOS commands
1 CLS Clear screen.
2 DIR Show list of files and directories.
3 VER Show version number of MS DOS.
4 VOL Show volume label for a disk drive.
5 DATE Show current date; set new date if necessary.
6 TIME Show current time; set new time if necessary.
7 COPY Create copy of one file to another file.
8 TYPE Display contents of a file in the command
windo Copy the typed content to a file name
provided in as argument. Copying
9 COPY CON
stops when Ctrl+Z (end of file
indicator) is pressed.
Rename the file (first argument - old
10 REN
name; second argument - new
11 DEL or ERASE name). Delete a file.
12 MD or MKDIR Create new directory.
13 CD or CHDIR Change to new working directory.
14 RD or RMDIR Remove given directory.
Takes on or off argument to decide whether
15 ECHO commands file batch file are displayed or not.
16 EXIT Closes command prompt.
Displays list of directories in which a
17 PATH command
18 PAUSE is looked for. Sets new path if necessary.
19 PROMPT Hold on processing until Enter key is
20 REM pressed. Set new command prompt instead
21 SET of C : \ > Remarks.
Set new values for an environment variable.
External DOS commands
Adds given directories to the end of
1 APPEND
PATH environment variable.
Change given drive name to a new
2 ASSIGN
drive letter.
Change attributes (a-archive, h-
3 ATTRIB hidden,
4 BACKUP r-read only, s-system file).
Backup specified files to given
5 CHKDSK
destination.
6 COMMAND.COM MS DOS operating system program.
Check thetwo
Compare diskfiles.
for errors
Reportand
firstrectify
7 COMP
errors.
mismatch. Debug given program. One
8 DEBUG
can examine values store in variables.
9 DISKCOMP Compare 2 disks with each other.
10 DISKCOPY Copy contents of one disk to another.
11 DOSKEY Store command history.
A visual shell for exploring files and
12 DOSSHEL di-
rectories.
External DOS
commands
13 EDIT MS DOS Editor.
14 EDLIN Edit single line.
15 EXPAND Decompress files.
16 FC Compare 2 files.
17 FDISK Create disk partitions.
18 FORMAT Format specified partition.
19 HELP Display help about MS DOS commands.
20 LABEL Display disk label.
21 VOL Display volume details.
22 MEM Display memory usage details.
Create backup file named MIRROR.FIL
23 MIRROR at root directory to restore lost informa-
tion, if any, at a later date.
Show given information in small chunks
for easy reading. Pressing a key moves
24 MORE forward. Pressing < space > shows next
page, < enter > shows next line, =
shows line number, Q quits.
External DOS commands
Create a new file having contents of
25 MOVE
the file, but delete the old
old
26 PRINT file. Send given file to the
printer.
27 SCANDISK Check and correct errors in
the file sys-
CHKDSK command.
Sort
tem given inputdrive.
of given lines inWorks
alphabetic
28 SORT order.
similar to
/R option sorts in reverse order (Z to A
29 SYS or 9 to 0).
Make given disk bootable. It should
Display
be files and directories in tree
30 TREE
struc- ture.
issued from C: drive.
31 UNDELETE Restore recently deleted file.
Extended copy mode for copying
32 XCOPY
directo-
ries, subdirectories and files.
Output rediction in MS DOS
Write the output of the left side
program to the file provided on the
1 > right side.
the file If not exist, it is created. If
does
the file already exists, its contents
are
deleted.
Write the ouput of the program on the
left side to the file indicated on the
2 >> right. If the file does not exist, it is
created. If it exists, new content is
appended to the end of file.
Pipe symbol. Pass the output of the
3 pro- gram on the left to that on the
| right of the pipe.
Special characters in MS DOS
1 * Match any number of
characters.
2 ? Match any one character.
Introduction to Open Source
Software
▶ Open source software denotes software for which the
original source code is available (not necessarily free of
cost).
▶ Open source software helps capable users to correct bugs
or add new features to the software.
▶ Open source model of software development enabled
developers across the world to contribute to the
improvement of a software.
▶ Open source model opposes the closed source monopoly
of large corporates.
▶ Advent of open source software paved the way for creation
of valuable software like Linux operating system, Mozilla
Firefox browser, Open Office software package, GIMP image
editor, QCAD drafting & design software, Blender 3D
Introduction to Open Source
Software
▶ Some of the software licenses which adopt open source
licensing system are: Apache License, BSD license, GNU
General Public License, GNU Lesser General Public License,
MIT License, Eclipse Public License and Mozilla Public
License.
▶ Richard Stallman created the GNU (GNU Not Unix)
project.
▶ Linus Torwalds released the Linux operating system in 1991.
Source code for Linux was distributed under the GNU
General Public License.
Features of Linux OS

▶ Linux operating system provides software packages for


almost all common tasks.
▶ LibreOffice provides swriter for document editing, scalc
for spreadsheets, impress for editing presentations.
▶ GIMP is one of the most powerful packages for image
editing.
▶ Blender is free 3D modelling and animation package.

▶ Video editors like Openshot help in multimedia related


works.
▶ Settings app is provided for controlling the work
environment and hardware features.
▶ Linux provides several compilers and IDEs for programming.
Applications menu in
Linux

Figure: Application list in GNOME


Browser

Figure: Firefox browser


Settings app in
Linux

Figure: Settings app


Document editing using LibreOffice
Writer

Figure: LibreOffice Writer


Spreadsheet using LibreOffice
Calc

Figure: LibreOffice Calc


Image editing using GIMP

Figure: GNU Image Manipulation Program (GIMP)


Files
app

Figure: Files
app
Basic Linux commands

▶ Linux operating system contains 2 essential components,


(i)the kernel which controls the computer peripherals,
(ii)the shell, which transmits commands issued by the user
to the kernel for processing.
▶ Linux commands may also be typed inside a text file and
used as a new command. Such text file is called shell script.
▶ Several shells are available for interaction with the Linux
kernel. Some of the most common shells are: (i)sh - Bourne
Again Shell or bash, #/bin/sh at the beginning of shell
script denotes bash script. (ii)csh - C shell. It supports
conditions and loops features similar to C programming
language. (iii)ksh - Korn Shell. Korn shell was released as
an improvement to the Bourne shell by AT&T Bell Labs.
Basic Linux shell commands
1 ls List files and folders.
2 mkdir Make directory having given name.
3 rmdir Remove directory having given
4 cp name. Copy given file to new name.
5 mv Move given file to new
6 cd name. Change directory.
7 cd .. Change to parent directory.
8 cd ˜ Change to home directory.
9 cd / Change to root directory.
10 mount Mount a file system/ drive.
11 umount Unmount a file system/drive.
12 eject Eject a drive.
13 shutdown -r < time > Restart the computer after given
14 shutdown -h < time > time. Halt the computer after given
15 sleep time.
16 sort Stop processing work for given
duration. Sort given input.
Basic Linux shell commands
17 ln Create a link to the original
18 tar file. Tape archive. Create an
19 zip (or) gzip archive. Zip a file.
20 unzip (or) Decompres given file.
gunzip long list of files.
21 ls -l Display screenfulls of
22 more output. Display screenfulls of
23 less output.
Search for a file having
24 given name from given
find directory. find . -name
temp.txt -exec ls -l {}
25 banner \; search for a file named temp.txt from the
26 rm current directory (.). Execute the command
27 cat ls
28 cat - > -l on the resulting file ({} ).
29 cat - >> Display given text in banner
30 date format. Remove a file.
Basic Linux shell commands
33 cc Run C-language compiler.
34 vi Open VI text editor.
35 emacs Open emacs text editor.
36 gedit Open gedit text editor.
37 useradd Create new user. Works in super user
38 userdel mode. Deletes given user name.
39 passwd Changes password of the given user.
40 su Increase previleges to super user
41 sudo level.
42 cal Run given command with super user
43 calc/ bc previlege. Display calendar.
44 cron Calculator.
45 awk Run given programs as per scheduled timings.
46 sed Interpreted language and filter for text
47 which handling. Stream editor and filter for text
48 file handling.
Find full path of given
command. Display file type of
Basic Linux shell commands
49 tr Substotute given character in place of unwanted
50 chown one. Change ownership of file.
Change file access mode for owner, group and
51 chmod .
world. 1-read, 2 - write, 4 -
52 groupadd execute. Create a new group.
53 groupdel Delete a group.
54 grep Catch lines with given text.
55 test Test file for read, write or execute
If condition is true, then part is executed. else
permissions.
56 if
and elif are supported. fi is the end of if.
57 while Run the loop so long as given condition is true.
58 for Run given loop with stated arguments.
59 tree Display tree structure of files and directories.
60 c++ Run C++ language compiler.
61 export Place the variable, value pair in the shell
environment.
62 clear Clear contents of the screen.
63 ps Display list of running processes.
64 kill Kill/ terminate process with given process ID.
Special characters in Linux
shell1 # What follows ’#’ character is comment.
2 * The wild card. Matches any number of letters.
3 ? Match any single character.
4 Send output to a new file. Delete contents if
>
file already exists.
Append the output of program to given file.
6
5 >>
|
Send output of the left side program to the in-
put of the right side program.
7 $? Exit code of previous process. 0 denotes
success.
8 & Run process to the left of & in the background.
9 - Denotes standard input (keyboard).
10 ˜ Home directory.
11 [[ ]] Test condition.
12 ! Negation of condition.
13 &&
Run right side program only if the left side pro-
gram succeeds.
14 Run right side program only if the left side pro-
||
gram fails.
Introduction to the various applications in office. Introduction
to Word features, office button, toolbars. Creating, saving
and formatting and printing documents using Word. Working
with inserting objects, macro, mail merge, templates and
other tools in Word. Page setup and printing documents
using Word.
Introduction to the various applications in
office
▶ Microsoft office has a collection of tools for carrying
out various productive jobs like preparation of
document, accouting, mailing, presentation, database
management, preparation of banners, visiting cards,
etc.
▶ The packages in Microsoft office and their purposes are
as follows:
Sl. Name Description
No. Table: Tools in MS Office
of tool /purpose
1 Word Helps preparation of documents.
2 Excel Preparation of spreadsheets.
3 Powerpoint Preparation of presentations.
4 Access Creation and maintenance of databases.
Tool for creating page based publications. Useful
5 Publisher
for creation of reports, banners, ID cards, etc.
6 Onenote The program for creating and sharing notes.
Email client. It fetches emails from
7 Outlook several
servers. It can also send emails.
Features of MS Word

▶ MS Word may be used for preparation of letters,


memos, books, reports, theses, brochures and visiting
cards.
▶ MS Word supports the paradigm of ”WYSWYG” - which
stands for What You See, What You Get. It means the
hard copy will be similar to what is seen on screen.
▶ MS Word provides template documents for creating several
types of publications. You may choose a template, fill
required details to get a professional looking publication.
▶ MS Office supports a large number of images called clip arts.

▶ MS Word can take list from Excel or Access and create


mail merged document addressed to several persons
individually.
▶ MS Word checks spelling (red underline below spelling
Office button in MS
Word
▶ The circular button located at top left corner of MS Word
window is the office button. In recent versions, office
button has been renamed to File ((Alt + F )).
▶ Office button contains the following menu items (Fig.103):
1) Save: Saves file (Ctrl+S or Alt+F+S).
▶ Save As: Saves another copy of the file with new
name (Alt+F+A).
2) Open: Open a file (Ctrl+O or Alt+F+O).
3) Close: Close current file (Alt+F+C).
4) Info: Show permissions, author name, version details,
pages, lines, words, duration of editing, etc. pertaining to
current file (Alt+F+I).
5) Recent: Show recently opened files (Alt+F+R).
6) New: Create a new document (Ctrl+N or Alt+F+N).
Templates may be chosen to provide a
skeleton for the document.
7) Print: Print the current document (Ctrl+P or
Alt+F+P).
Office button in MS
Word

Figure: Office menu in MS Word


Office button in MS
Word 8) Save & Send: Save current document and send it
through email, save it on the web, share it to the
blog, (Alt+F+D).
9) Help: Help regarding MS Word (Alt+F+H or F1).
10) Options: Options help to control several features of MS
Word (Alt+F+T). Choosing Advanced− > Print and
removing the tick mark in front of ”Scale content for
A4 or
8.5’x11’ paper sizes is important after installing windows.
Otherwise all pages will be scaled to letter size paper instead
of A4 size paper. General, display, proofing, save, language,
advanced, etc. are common headings displayed under
Options.
11) Exit: Close all documents and exit MS Word (Alt+F+X).
Toolbars in MS Word
▶ Toolbars in MS Word are organized under the following
menus:
(a) Home (Alt + H)
(b) Insert (Alt + N)
(c) Page Layout (Alt + P)
(d) References (Alt + S )
(e) Mailing (Alt + M)
(f) Review (Alt + R)
(g) View (Alt + W )

▶ On pressing each menu, the toolbar related to that


menu appears.
▶ The toolbar is organized into suitable groups with a
heading shown at the bottom of the toolbar.
▶ Pressing the square shaped button at the bottom of each
item in the toolbar opens a detailed menu related to that
toolbar.
Home menu in MS
Word
▶ Fig.106 shows the items contained in Home menu of
MS Word.

Figure: Home menu in MS Word


Home menu in MS
Word▶ Home menu contains many of the most essential items
required for formatting a document (Fig.106), as
detailed below:
(a) Clipboard (Alt + H + FO) - cut (Ctrl + X or Alt + H +
X ),
copy (Ctrl + C or Alt + H + C ), paste (Ctrl + V or
Alt + H + V ) & format painter (Alt + H + FP).
(b) Font style (Alt + H + FN) - bold (Ctrl + B or Alt + H +
1), italic (Ctrl + I or Alt + H + 2), underline (Ctrl + U
or
Alt + H + 3), strikethrough (Alt + H + 4), subscript
(Ctrl + Plus or Alt + H + 5), superscript (Ctrl + Shift +
Plus or Alt + H + 6), font name (Alt + H + FF ), font size
(Alt + H + FS ), fill colour (Alt + H + I ), font colour
(Alt + H + FC ).
(c) Paragraph formating (Alt + H + PG ) - bullets (Alt + H +
U) & numbering (Alt + H + N), multilevel list (Alt + H +
M), paragraph alignment (left (Ctrl + L or Alt + H + AL),
right (Ctrl + R or Alt + H + AR), centre (Ctrl + E or
Alt + H + AC ) & justified (Ctrl + J or Alt + H + AJ)), line
Insert menu in MS Word
▶ Fig.108 shows the items contained in Insert menu of
MS Word.

Figure: Insert menu in MS Word


Insert menu in MS Word
▶ Insert menu (Alt + N) contains items insertion of items
like pages, tables and images, as detailed below (Fig.108):
(a) Page insertion - cover page (Alt + N + V ), blank page
(Alt + N + NP) & page break (Alt + N + B).
(b) Table insertion (Alt + N + T ) - simple table, table by rows
and columns (Alt + N + T + I ), draw table (Alt + N +
D), convert text to table (Alt + N + T + V ), Excel
spreadsheet
(Alt + N + T + X ) & quick table (Alt + N + T + T ).
(c) Illustrations - pictures (Alt + N + P), clip art (Alt + N +
F ), shapes (Alt + N + SH) [line, rectangle, circle, arrows,
flow chart, etc.]), chart (Alt + N + C ), smart art (Alt + N
+ M), screenshot (Alt + N + SC )).
(d) Links - hyperlink (Alt + N + I ), bookmark (Alt + N + K ),
cross reference (Alt + N + RF ).
(e) Header & Footer - header (Alt + N + H),
footer (Alt + N + O), page number (Alt + N +
NU).
(f) Text - text box (Alt + N + X ), quick parts (Alt
+ N + Q),
Page Layout menu in MS Word
▶ Fig.110 shows the items contained in Page Layout menu
in MS Word.

Figure: Page Layout menu in MS Word


Page Layout menu in MS Word
▶ Page Layout (Alt + P) menu (Fig.110) contains several
options related to page size and layout, as detailed
below:
(a) Theme - Theme (Alt + P + TH), Colors (Alt + P +
TC ), Fonts (Alt + P + TF ), effects (Alt + P + TE ).
(b) Page Setup (Alt + P + SP) - margins (Alt + P + M),
orientation (Alt + P + O), size (Alt + P +
SZ ), columns
(Alt + P + J or (Alt + P + J + C )), break (Alt + P +
B), line
number (Alt + P + LN) & hyphenation (Alt + P + H).
(c) Page background - water mark (Alt + P + PW ), page
color (Alt + P + PC ) & page border (Alt + P + PB).
(d) Paragraph (Alt + P + PG ) - indent left (Alt + P + IL),
indent
right (Alt + P + IR) & spacing before (Alt + P + SB)
and space after (Alt + P + SA).
(e) Arrange object - position (Alt + P + PO), text wrap
(Alt + P + TW ), bring forward (Alt + P + AF ), selection
pane (Alt + P + AE ), select para (Alt + P + AP), align
References menu in MS Word
▶ Fig.112 shows the items contained in References menu in
MS Word.

Figure: References menu in MS Word


References menu in MS Word
▶ References (Alt + S ) menu (Fig.112) contains several
options related to cross referencing of tables, images and
citations, as detailed below:
(a) Table of Contents - table of contents (Alt + S + T ), add
text (Alt + S + A), update table (Alt + S + U).
(b) Foot notes (Alt+S+Q) - insert footnote (Alt + S + F ),
insert endnote (Alt + S + E ), next footnote (Alt + S +
O) & show notes (Alt + S + H)
(c) Citaion & Bibliography - insert citation (Alt + S + C ),
manage
sources (Alt + S + M), style (Alt + S + L),
bibliography (Alt + S + B).
(d) Captions - insert caption (Alt + S + P), insert table of
figures
(Alt + S + G ), update table (Alt + S + V ), cross
reference (Alt + S + RF ).
(e) Index - mark entry (Alt + S + N), insert index (Alt + S +
X ),
update index (Alt + S + D).
(f) Table of authorities - mark citation (Alt + S + I ), insert
Mailings menu in MS Word
▶ Fig.114 shows the items contained in Mailings menu in
MS Word.

Figure: Mailings menu in MS Word


Mailings menu in MS Word
▶ Mailings (Alt + M) menu (Fig.??) is the source of the
famous mail merge function in MS Word. Mail merge
functions may be visualized as a high level fill in the blanks,
which can produce individualized messages from a general
template. It has the following options:
(a) Create - envolopes (Alt + M + E ), labels (Alt + M + L).
(b) Start Mail Merge - start mail merge (Alt + M + S ), select
recepient (Alt + M + R) - type new list (Alt + M + R
+ N), use existing list (Alt + M + R + E ), select from
outlook contacts (Alt + M + R + O) & edit
recepient list (Alt + M + D).
(c) Write & Insert Fields - highlight merge fields (Alt + M + H),
address book (Alt + M + A), greeting line (Alt + M + G ),
insert merge field (Alt + M + I ), rules (Alt + M + U),
match fields (Alt + M + T ), update labels (Alt + M + B).
(d) Preview Results - preview results (Alt + M + P), first record
(Alt + M + Q), previous record (Alt + M + M), record
number (Alt + M + W ), next record(Alt + M + X ), last
record
(Alt + M + V ).
Review menu in MS Word
▶ Fig.116 shows the items contained in Review menu in
MS Word.

Figure: Review menu in MS Word


Review menu in MS Word
▶ Review (Alt + R) menu (Fig.116) helps to check spelling,
grammer and document statistics. It contains the
following options:
(a) Proofing - spelling & grammer (Alt + R + S ),
research (Alt + R + R), thesaurus (Alt + R + E ),
word count (Alt + R + W ).
(b) Languages - translate (Alt + R + L), language (Alt +
R + U).
(c) Comments - new comment (Alt + R + C ), delete
(Alt + R + D), previous record (Alt + R + V ),
next (Alt + R + N).
(d) Tracking - track changes (Alt + R + G ), final:
show markup
(Alt + R + TD), show markup (Alt + R + TM),
reviewing pane (Alt + R + TP).
(e) Changes - accept (Alt + R + A), reject (Alt + R + J),
previous
(Alt + R + F ), next (Alt + R + H).
(f) Compare - compare (Alt + R + M).
(g) Protect - block authors (Alt + R + PB), restrict
View menu in MS
Word
▶ Fig.118 shows the items contained in View menu in MS
Word.

Figure: View menu in MS Word


Review menu in MS Word
▶ View (Alt + W ) menu (Fig.118) helps to customize
the appearance of document:
(a) Document Views - page layout (Alt + W + P), full screen
reading (Alt + W + F ), web layout (Alt + W + L),
outline (Alt + W + U), draft (Alt + W + E ).
(b) Show - ruler (Alt + W + R), gridlines (Alt + W +
G ), navigation pane (Alt + W + K ).
(c) Zoom - zoom (Alt + W + Q), 100 (Alt + W + J),
two pages
(Alt + W + 1), (Alt + W + 2), page width (Alt + W
+ I ).
(d) Window - new window (Alt + W + n), arrange all
(Alt + W + A), split (Alt + W + S ), view
side by side
(Alt + W + B), synchronous scrolling (Alt + W + YS
), reset
window position (Alt + W + T ), switch
windows (Alt + W + W ).
(e) Macros - Macros (Alt + W + M)
Creating, saving and formatting documents using
M.S. Word

▶ When MS Word is opened without any argument, it displays


a blank document.
▶ MS Word provides the following online templates (available
only over an Internet connection) for creating new
document: (i)agenda, (ii)award certificate, (iii)business
cards, (iv)resumes, (v)budget, (vi)flier, (vii)brocher,
(viii)visiting cards, (ix)calendars, (x)reports/ books, etc.
▶ After opening a document, it is necessary to set paper
size, paper orientation (landscape or portrait) and margins
on all four sides, before entering text. These settings can
be accessed from PageLayout− > Page Setup (Alt + P +
SP) menu.
▶ Line spacing should be set through
Creating, saving and formatting documents using
M.S. Word

▶ Text alignment can be set to center (Ctrl+E), left (Ctrl+L),


right (Ctrl+R) or justified (Ctrl+J).
▶ Font face/name (Alt+H+FF), font size (Alt+H+FS), font
colour (Alt+H+FC) and background colour (Alt+H+I) may
be set to appropriate values for given document.
▶ Tables, figures and equations may be assigned caption
using References-¿Insert caption (Alt+S+P). This will help
MS Word to create list of tables, list of figures and list of
equations automatically.
▶ To insert book title, chapter title, heading1, heading2,
normal text, sue appropriate icons available under Home− >
Styles menu (Alt + H + L). Using this menu will help in the
insertion of automatic table of contents.
Creating, saving and formatting documents using
M.S. Word

▶ While typing references, use


References− > Insert Citation (Alt + S + C ). This will
help in the insertion of automatic bibliography.
▶ To mark the words to be automatically indexed, use
References− > Mark Entry (Alt + S + N). This will help
in automatic insertion of index of words at the end of a
document.
▶ Use Insert menu to insert table, picture, shapes, flow
charts, headers, footers, page numbers, word art, drop cap,
equation or symbol.
▶ To save a document, use
File− > Save (Ctrl + S or Alt + F + S ).
▶ To save the document in a new name, use File− > SaveAs
Inserting objects in MS Word
▶ The most common objects used in MS Word are: (i)table,
(ii)picture, (iii)geometric shapes, (iv)clip arts,
(v)equations, (vi)lists.
▶ Table can be inserted from Insert− > Table menu
(Alt + N + T ) in MS Word. Table caption is placed above the
table. Use References− > Insert Caption (Alt + S + N) to
insert table caption.
▶ Pictures can be inserted from
Insert− > Picture (Alt + N + P) in MS Word. Picture
caption is placed below the picture. Use
References− > Insert Caption (Alt + S + N) to insert table
caption.
▶ Geometric shapes like line, circle, rectangle, text box, clip
art, word art, flow chart symbols, etc. can be inserted from
Insert menu.
Inserting objects in MS Word
▶ To insert predefined art works, choose
Insert− > ClipArt (Alt + N + F ) menu. This permits
several simple artworks to be inserted in a document.
▶ Word art provides attractive size and shape for text
headings. To insert word art, click Insert− > Word Art (Alt
+ N + RC ) menu.
▶ To insert a drop cap (First letter having height of
several lines), use Insert− > Drop Cap (Alt + N +
RC ) menu.
▶ Inserting a list is very simple in MS Word. Type a number or
letter enclosed in parantheses [like (1)] or succeded by a
right paranthesis [like 1)]. This will induce MS Word to
create a new list. Use the options available under
Home− > Paragraph to customize the number format, letter
format or bullet used for the list. Although MS Word
automatically inserts successive numbers for list, specific
Inserting macros in MS Word
▶ Macros help to create custom commands in MS Word,
which will help us complete repeated works with ease.
Imagine macro as a pet dog, which can take care of
repeated works, once the initial training is complete.
▶ Macros may be assigned keystrokes or buttons.

▶ Initially, word does not show macros menu. Choose


File− > Word Options (Alt + F + T ) menu, click Trust
Center in the left side pane, click Trust Center Settings
and click Enable all macros (not recommended, potentially
dangerous code can run).
▶ To record a new macro (e.g. to type Government ITI for
Women, Pondicherry, whenever Alt+W is pressed), open View
menu, click Macros, choose Record Macro (Alt+W+M+R).
▶ Choose whether you create a button (left) or a
keyboard shortcut.
Inserting macros in MS Word

▶ Type a description of what the macro does and and press OK.
This starts the recording of macro. Mouse is disabled during
macro recording. Hence, use keyboard to control the
document.
▶ Simply carry out the work and allow the macro to learn
what you do.
▶ When your work is complete, choose
View− > Macro− > Stop Recording (Alt + W + M + R).
▶ Now, you can press the macro button placed at the title
bar or type required keystroke to invoke the macro and get
your work done.
Performing mail merge in MS
Word
▶ Mail merge helps to make general purpose document
targetting several persons to look as if the document was
prepared for each individual separately, giving a feeling of
trust and affinity.
▶ Prepare a document with blank spaces where
individualized items like name, address, gender, age, etc.
are to appear.
▶ Prepare a list of using MS Excel or MS Access, with
suitable column names. The list could even be prepared
using notepad, sufficient that rows are separated by newline
and columns are separated by TAB.
▶ After completing the document, open Mailings− >
SelectRecepients− > UseExistingList (Alt + M + R + E ).
Choose the MS Excel, MS Access or notepad text
document containing the personal details. For MS Excel or
Performing mail merge in MS
Word
▶ Now, choose Mailings− > InsertMergeField (Alt + M + I )
and choose the appropriate column name to be filled in each
blank space.
▶ Choose Mailings− > PreviewResults (Alt + M + P) to view
the mail merged results.
▶ Mail merge results for each record may be viewed by
accessing Mailing− > PreviewResults tool bar and changing
the record number.
▶ A new word document containing all mail merge results can be
created using Mailings− > EditIndividualDocuments (Alt + F +
E ). This document may be saved under a different name. Record
range may be chosen for finishing the mail merge to new
document.
▶ The mail merge results may be printed using
Mailings− > PrintDocuments (Alt + F + P). Record range may be
chosen for finishing the mail merge to printer.
▶ The mail merge results may be sent through email to email
Creating and using templates in MS Word

▶ Template in MS Word may be visualized as a standard


mould using which several objects may be cast.
▶ After creating a document which is so well formatted that it
is fit to serve as the standard for other documents, choose
File− > Save As. In the save as dialog, click the triangular
button to the right of Save as type and choose
Word Template.
▶ A word template has .dotx extension, instead of the
usual extension of .docx for normal word documents.
▶ When a Word template is opened, edited changes can
be saved in a new word document with .docx
extension.
▶ Templates are published magazines and journals to help the
authors typeset their content according to the style
Page setup and printing documents using Word
▶ The first work on creating a document is page setup and
the last work is to print or email that document.
▶ Page setup can be accessed using
Page Layout− > Page Setup (Alt + P + SP) menu.
▶ Page setup brings a dialog containing 3 panels, viz., Margins,
Paper & Layout.
▶ Margins panel in page setup dialog helps to specify left
margin, right margin, top margin and bottom margin.
In addition to the margins, gutter margin (for binding)
and gutter position (left or top) may also be specified.
▶ Margins panel in page setup dialog permits choosing paper
orientation (portrait [width is less than height] or
landscape[width is larger than height]), margin
arrangement for multiple pages, preview of margin setup
and applicability of the new page setup.
Page setup and printing documents using Word

▶ Printing a document is possible by choosing


File− > Print (Ctrl + P) in the menu.
▶ The name of printer (which has already been installed),
number of copies, page ranges to be printed, type of
printing to be adopted for multiple copies (collated - divide
by set, uncollated - take given number of copies in each
page before proceeding to print the next page)
▶ Print dialog also permits access to printer properties,
which may control print resolution, colour mode (in case
of colour printer), finishing of pages, quality of print, etc.
▶ The print dialog also permits scaling of pages to suit
available paper size.
▶ Pressing the print button sends the document to the
printer and produces hard copy of the document.
Introduction to Excel features and Data Types. Cell
referencing. Use of functions of various categories, linking
Sheets. Introduction to various functions in all categories
of Excel. Concepts of Sorting, Filtering and Validating
Data. Analyzing data using charts, data tables, pivot
tables, goal seek and scenarios. Introduction to Reporting.
Introduction to features of
Excel
▶ Excel works on the basis of cells, one cell being
the intersection of a column and a row.
▶ Columns (vertically aligned dividers) have the alphabet
names (A,B,C, ... Z, AA, AB, ..., AZ, BA...).
▶ Rows have numeric identifier (1, 2, 3, ...).

▶ Cells are addressed by combination of column name - row


number, e.g. A1 for the first cell, B6 for the cell at
second column, sixth row.
▶ Excel has a large collection of functions (entered in a cell
after typing = sign), which are helpful in data analysis and
computations.
▶ Excel can sort and arrange data in easily readable format.

▶ Excel can draw charts (like pie, bar, column, scatter, etc.) to
help visualize data entered in cells.
Introduction to features of
Excel
▶ MS Excel can work with other applications like MS Word
and MS Access.
▶ MS Excel can be used for storage and manipulation of small
amount of data which may not qualify to occupy a
database.
▶ MS Excel supports recording repeated actions and calling
the same action sequences with the help of macros.
▶ MS Excel supports full fledged programming using Visual
Basic for Applications (VBA).
▶ Each excel file is called a Workbook. Each workbook can
have several sheets.
▶ By default, sheets in MS Excel are Sheet1, Sheet2, etc.
The sheets can be renamed or copied by right clicking on
sheet name.
Data types in
Excel
▶ Following types of data are available in MS Excel:

1) General - Can be number, text, date, time or any other type.


2) Number - number permits control of decimal places
and grouping of digits.
3) Currency - Currency format permits control of decimal
places, digit grouping and prefixing of currency symbol.
4) Accounting - Permits control of number of digits and
prefixing of currency symbol.
5) Date - Permits selection of date format from several
available formats. The default date format used in India is
DD/MM/YYYY.
6) Time - Permits selection time format.
7) Percentage - Displays a fraction (between 0 and 1) as
a percentage. Decimal places of the percentage can be
controlled.
Data types in
Excel
8) Fraction - Permits display of decimal fraction into
common fraction or vulgar fraction.
9) Scientific - Displays numbers in exponential notation.
10) Text - Displays given data as text.
11) Special - Special type is useful for tracking list and
database values.
12) Custom - Number format may be customized using #
(space or digit. 0 - zero or digit). Any text enclosed in
double quotes is displayed as without any changes.
Cell referencing
▶ When the name of cell (like B5) is referenced in a formula,
it can be done in 3 different ways, as detailed below:
a) Relative referencing - dynamic row & column change mode
b) Semi-relative referencing - fynamic row & static column mode
or static row and dynamic column mode
c) Absolute referencing - static row & static column mode
▶ Relative referencing: In this mode, copying the formula to a
new cell (e.g., add 4 to columns & 3 to rows) causes the cell
reference to change relative to the new column (by adding
the same 4 to columns & 3 to rows to the reference made in
the formula).
▶ Semi-relative referencing: In this mode, either the row or
column references are static, denoted by a $ symbol
preceding the row number or column name.
▶ Absolute referencing: In this mode, both column name and
row number are static and are preceded by a $ symbol.
When the formula is copied from one cell to another, the cell
Examples of cell referencing systems
a) Relative referencing: The formula = D3 + E 3 is entered in
cell F3. On copying the formula to cell K4, the copied
formula becomes = I 4 + J4, which references cells in
relation to the cell containing the formula.
b) Semi-relative referencing: The formula = $D3 + $E 3 is
entered in cell F3. On copying the formula to cell K4, the
copied formula becomes = $D4 + $E 4, which references
rows in relation to the cell containing the formula, but
freezes any changes to the column name.
c) Semi-Relative referencing: The formula = D$3 + E $3 is
entered in cell F3. On copying the formula to cell K4, the
copied formula becomes = I 3+J3, which references
columns in relation to the cell containing the formula, but
freezes any changes to the row number.
d) Absolute referencing: The formula = $D$3 + $E $3 is
entered in cell F3. On copying the formula to cell K4, the
copied formula becomes = $D$3 + $E $3. Absolute system
freezes all cell references.
Use of functions of various categories

▶ Cube functions: These functions look up and analyze


data from a multi-dimensional database stored in a
spreadsheet.
▶ Database functions: These functions help to
access databases from Excel.
▶ Date and Time functions: These functions display
and manipulate date and time values.
▶ Engineering functions: Converts number from one base
to another, supports complex numbers, helps bit shifting
and provides Bessel function.
▶ Financial functions: These functions support
financial accounting in Excel.
▶ Information functions: These functions support
Use of functions of various categories

▶ Logical functions: These are comparison functions


which help carry out Boolean logic on data.
▶ Lookup and reference functions: These functions help
to fund cell references using search, lookup, etc.
▶ Math & Trigonometry functions: These function help to
manipulate numbers and determine trigonometric values.
▶ Statistical functions: These functions help to calculate
statistical quantities like average, mode, median,
standard deviation, etc.
▶ Text functions: These functions help to search,
concatenate and manipulate text strings.
DATE functions
Takes the arguments YYYY, MM, DD as input
1 DATE and returns a date.
Calculates difference between given dates in
years or months or days. Takes the start
2 DATEDIF
date, end date and the unit (” Y” for years,
”M” for months and ”D” for days.
3 DATEVALUE Parses a text string and calculates date.
4 DAY Returns day of month.
5 DAYS Returns the number of days between two
dates.
Calculates the number of days between two
6 DAYS360 dates based on a 360-day year
Returns the date which occurs particular num-
ber of months before or after the given date.
7 EDATE
Takes date as first argument, number of
months as the second argument.
DATE functions
Returns the date last day of month given a
start
8 EOMONTH date and number of months. Takes date as
first argument, number of months as the
second ar- gument.
9 HOUR Converts a serial number to an hour.
Returns the number of the ISO week number of
10 ISOWEEKNUM the year for a given date.
11 MINUTE Converts a serial number to a minute.
12 MONTH Converts a serial number to a month
Returns the number of whole workdays
13 NETWORKDA YSbetween
two dates.
Returns the number of whole workdays
14 NETWORKDA between
YtSw.oINdTaLtes using parameters to indicate
which and how many days are weekend days.
Returns the serial number of the current date
15 NOW and time.
16 SECOND Converts a serial number to a second.
DATE functions
Converts a time in the form of text to a serial
18 TIMEVALUE number.
19 TODAY Returns the serial number of today’s date.
20 WEEKDAY Converts a serial number to a day of the
week.
Converts a serial number to a number repre-
21 WEEKNUM senting where the week falls numerically with
a year.
Returns the serial number of the date before or
22 WORKDAY after a specified number of workdays.
Returns the serial number of the date before or
WORKDAY. after a specified number of workdays using
23
INTL pa- rameters to indicate which and how many
days are weekend days.
24 YEAR Converts a serial number to a year.
Returns the year fraction representing the num-
25 YEARFRAC ber of whole days between start date
and end date.
Engineering
functions
1 BIN2DEC Converts binary number to decimal number.
Converts binary number to hexadecimal num-
2 BIN2HEX ber.
3 BIN2OCT Converts binary number to Octal number.
4 BITAND Returns bitwise and for given numbers.
5 BITLSHIFT Bitwise left shift.
6 BITOR Bitwise OR for given numbers.
7 BITRSHIFT Bitwise right shift of number.
8 BITXOR Bitwise XOR of given numbers.
Converts given value from one system of units
9 CONVERT to another (e.g. ”m” to ”ft”).
10 DEC2BIN Converts decimal number to binary number.
Converts decimal number to hexadecimal num-
11 DEC2HEX ber.
12 DEC2OCT Converts decimal number to Octal number.
13 DELTA Tests whether given values are equal.
Converts hexadecimal number to binary num-
14 HEX2BIN ber.
Engineering
functions
15 HEX2DEC
Converts hexadecimal number to decimal num-
ber.
16 HEX2OCT Converts hexadecimal number to octal number.
Creates a complex number from real and imag-
17 COMPLEX inary parts.
18 IMABS Displays the absolute value of complex
function.
19 IMAGINARY Returns imaginary part of complex number.
20 IMREAL Returns real part of complex number.
21 IMREAL Returns conjugate of a complex number.
22 OCT2BIN Converts octal number to binary number.
23 OCT2DEC Converts octal number to decimal number.
24 OCT2HEX Converts octal number to hexadecimal number.
Cell functions
Returns a numeric identifier corresponding to
1 ERROR.TYPE an error type.
returns information about the current operating
2 INFO environment.
3 ISBLANK Returns true if a cell is blank.
Returns true if the cell contains an error (other
4 ISERR than #NA).
5 ISEVEN Returns true if the number is even.
6 ISODD Returns true if the cell contains an odd number.
7 ISFORMULA Returns true if the cell contains a formula.
Cell functions
Returns true if the cell contains a logical (true
8 ISLOGICAL of false) value.
9 ISNA Returns true if there is #NA error.
Returns true if the cell contains anything other
10 ISNONTEXT than text.
11 ISNUMBER Returns true if the cell contains a number.
Returns true if the cell contains a reference to
12 ISREF another cell.
13 ISTEXT Returns true if the cell contains text.
14 N Converts given input to a number.
Returns a number corresponding to the #NA
15 NA error type.
Returns a number corresponding to the data
16 TYPE type of the cell.
Logical
functions
1 AND Returns true only if all given conditions are
true.
Returns true if at least one of the given condi-
2 OR tions is true.
3 FALSE Returns FALSE logical value.
4 TRUE Returns TRUE logical value.
Contains 3 parts separated by comma. In case
the condition given at first part is true, the
5 IF
sec- ond part is executed. Otherwise, the
condition given at the third part is executed.
Math functions
Returns the absolute (positive) value of the
1 ABS function, whether the input number is
positive or negative.
Inverse of sine value. Returns angle in radian
2 ASIN for given input value (Input should be
between 0 and 1).
Inverse of cosine value. Returns angle in radian
3 ACOS for given input value (Input should be
between 0 and 1).
Inverse of tangent value. Returns angle in ra-
4 ATAN dian for given input value.
Inverse of cot value. Returns angle in radian for
5 ACOT given input value (Input should be between 0
and 1).
Inverse of tangent value from given X and Y
6 ATAN2 coordinates. Returns angle in radian for given
input value.
Returns aggregate value like sum, count, etc.
7 AGGREGATE from a database.
Math functions
8 ARABIC Converts Roman numberal to Arabic numeral.
9 ASINH Returns inverse of hyperbolic sin.
10 ATANH Returns inverse of hyperbolic tangent.
Returns an integer just above the given frac-
11 CEILING tional number. e.g. =CEIL(2.1) returns 3.
Returns an integer just below the given frac-
12 FLOOR tional number. e.g. =FLOOR(2.99) returns 2.
Rounds a number to given number of
digits. e.g. =ROUND(2.99,1) re-
13 ROUND turns 3.0, =ROUND(2.629,2) returns
2.63, =ROUND(2.5,0) returns 3.0,
=ROUND(23154.25,-2) returns 23200.
Rounds a number to given number of digits.
But it simply truncates the trailing digits,
with- out considering whether the truncated
14 ROUNDDOW digit is below 5 or not. e.g.
N =ROUNDDOWN(2.99,1) returns 2.9,
=ROUNDDOWN(2.629,2) returns 2.62,
Math functions
Rounds a number to given number of digits.
But it simply adds one to the last digit,
without considering whether the truncated
15 ROUNDUP digit is be- low 5 or not. e.g.
=ROUNDUP(2.99,1) returns 3.0,
=ROUNDUP(2.622,2) re-
turns 2.63, =ROUNDUP(2.1,0) returns
3.0, =ROUNDUP(23124.25,-2) returns 23200.
Returns number of possible combinations for
16 COMBIN given number of objects nCr .
Returns degree value of angle for given angular
17 DEGREES value in radian.
Returns the nearest even number just above the
18 EVEN given number.
Returns the nearest odd number just above the
19 ODD given number.
20 EXP Returns exponential value of a given number.
Math functions
21 FACT Returns factorial of given number.
22 FACTDOUBLE Returns factorial of given number.
23 GCD Returns greatest common divisor of the number.
Returns integer value just below the given real
24 INT number.
Returns least common multiple of given num-
25 LCM bers.
26 LN Returns natural logarithm of given number.
27 LOG Returns common logarithm of given number.
Returns logarithm of given number to the base
28 LOG10 10.
29 MDETERM Returns determinant of given matrix.
30 MINVERSE Returns inverse of given matrix.
31 MMUL Multipication result of given matrices.
32 MOD Returns modulo reminder of division.
Returns nearest value rounded to the given mul-
33 MROUND tiple.
34 PI Returns the value of PI (3.1415...).
35 POWER Returns the the given power of a number.
Math functions
36 QUOTIENT Returns quotient of division.
37 RADIANS Returns radians for given degree angle.
38 RAND Returns a random number.
Returns a random number between given input
39 RANDBETWEE N
numbers.
Returns Roman numeral for given Arabic num-
40 ROMAN ber.
41 SIGN Returns sign ± + or -.
Returns square root of the given number (only
42 SQRT
positive numbers are permitted in argument).
43 SUBTOTAL Returns subtotal of given numbers.
44 SUM Returns sum of given numbers.
Returns sum of given numbers if given
45 SUMIF condition
is fulfilled.
46 SUMSQ Returns sum of squares of given numbers.
47 TRUNC Truncates given number to integer value.
Statistical
functions
1 AVEDEV
Returns average of absolute/unsigned deviation
of data from the mean.
2 AVERAGE Returns average of given numbers.
Returns average of given numbers, text and log-
3 AVERAGEA ical values.
Returns average of given numbers which meet
4 AVERAGEIFS criteria specified.
Returns coefficient of correlation between given
5 CORREL data sets.
6 COUNT Returns count of items in specified range.
Counts the number of items in specified range,
7 COUNTIF only if that item meets specified criterion.
Counts the number of items in specified range,
8 COUNTIFS only if that item meets several criteria
specified after the first argument.
Counts the number of arguments provided to
9 COUNTA the function.
Counts the number of blank cells in specified
10 COUNTBLANK range.
Statistical
functions
11 DEVSQ Returns sum of squares of deviations.
Returns the most probable next value in a set
12 FORECAST of dependent and independent variables.
13 GEOMEAN Returns geometric mean of given values.
Returns exponential forecast for a new X value
14 GROWTH based on given Y and X values.
15 LARGE Returns rank based large value in a data set.
16 MAX Returns highest numeric value.
Returns highest value from the given
17 MAXA numbers,
text or logical values.
Returns the median (the data that occurs at the
18 MEDIAN middle) of given set of data.
19 MIN Returns the least value of given numbers.
Statistical
functions
20
Returns the least value of given numbers, text
MINA and logical values.
Returns permutation for given number of ob-
21 PERMUT jects.
Returns rank for a given value in comparison to
22 RANK a list of values.
Returns smallest number having given rank
23 SMALL value.
Returns standard deviation of given list of num-
24 STDEV bers.
Text functions
Returns character having the given code num-
1 CHAR ber under ASCII (American Standard Code
for Information Interchange) system.
2 CODE Returns numeric code of given character.
3 CONCATENA TECombines multiple string values.
Returns given number in currency format based
4 DOLLAR on current locale.
5 EXACT Compares given text values.
Returns the index/ location count of the occur-
6 FIND rence of first string within the second (larger)
string.
Formats a number with fixed number of
7 FORMAT decimal
places.
8 LEFT Returns leftmost character from a string.
9 RIGHT Returns rightmost character from a string.
10 LEN Returns length of a string.
Statistical
functions
11 LOWER Converts given string to lowercase letters.
12 UPPER Converts given string to uppercase letters.
Capitalizes the first letter of each word in
13 PROPER given
string.
Takes a string for first argument. Takes start lo-
cation for replacement, number of characters
14 REPLACE to be replaced as second and third arguments.
The given range is replaced using the string
given in the fourth argument.
Repeat the text given in first argument for
15 REPT num-
ber of times specified in second argument.
Returns the index/location of occurrence of first
16 SEARCH text within second text (case insensitive).
Text functions
Takes target string, search string and replace-
17 SUBSTITUTE ment string as arguments. Replaces
second string with the third string in the first
string.
Returns text value. Does not return anything
18 T for number and logical values.
Formats the number given in the first
19 TEXT argument
according to format specified in the second
ar- gument.
Removes spaces from the beginning and end of
20 TRIM given string.
21 VALUE Converts text to number.
Sorting in MS
Excel
▶ To sort data, select all the cells containing the data to
be sorted.
▶ Avoid the most common mistakes of selecting the just the
single column containing the values to be sorted and
omitting some columns which you might consider
unnecessary of inclusion. Such an error may result in
separation of data from its proper row members.
▶ Click Data− > Sort. In the dialog that opens, keep or
remove the tick mark against the field ”My data contains
headers”.
▶ The sort options contain 3 columns. First, select the
column using which data needs to be sorted. In case the
data contains headers, the header name is displayed.
Otherwise, column name in alphabets (A,B,C,...) is
displayed.
Filtering of data in MS Excel

▶ For filtering data, the first row should contain headers.

▶ Select all the data including headers.

▶ Choose Data− > Filter . A triangular filter marker appears


to the right of each column in the first row of data.
▶ Clicking the triangular marker of any column permits sorting
in ascending or descending order, sorting by color, search for
specific values, applying several filter conditions for numbers
(like equals, does not equal, greater than, less than, less
than or equal to, between, top 10, above average, below
average, custom filter) and text (like equals, does not
equal, begins with, ends with, contains, does not
contain,custom filter).
▶ Filter helps to select data based on convenient criterion.
Validation of data in MS Excel
▶ Select the cells (or column or row) in which data validation
is required.
▶ Choose Data− > Data Validation from the menu.
Select Data Validation.
▶ The data validation dialog appears.

▶ Select the data type from Allow criterion.

▶ Select the data criterion (between, not between, equal to,


not equal to, greater than, less than, greater than or equal
to, less than or equal to).
▶ Enter the values for validation.

▶ If you wish to display an error message for wrong input,


click Input Message tab and enter the title and content of
error message.
Analyzing data using charts in MS Excel

▶ MS Excel supports column, line, pie, area, scatter and


other chart types like stock, surface, doughnut, bubble and
radar.
▶ To display a chart like column, line, pie or bar, type X-Axis
title in the one column and Y-Axis title in the next
column.
▶ Enter X-Axis values and Y-Axis values in the selected
columns.
▶ Select the data (including title).

▶ Choose Insert menu. Click the type of chart like column,


line, pie, bar or scatter.
▶ The chart is inserted by Excel.

▶ Edit display parameters if necessary.


Data tables in MS
Excel
▶ Using data table, Excel can be made to calculate the
results for a row, a column or an array.
▶ If you wish to create a column based data table, fill the
input values on the left. Calculate the result for the first
row.
▶ Select the entire table, choose Data− >What
If Analysis− >Data Table.
▶ Choose first column in the input box (leave the row
value blank).
▶ Excel will fill up the remaining blank cells.

▶ Similarly, you can create a row based data table. You need
to create a row based input, calculate the result in the first
column of the next row. Choose first cell of the row in row
Data tables in MS
Excel
▶ If you wish to create a matrix using data table, enter
input values in 2 cells, calculate the result value in a new
cell.
▶ Create a row of inputs to the right of the result cell.

▶ Create a column of inputs below the result cell.

▶ Select the new matrix. Leave the row and column input
cells unselected.
▶ Choose What Data− >If Analysis− >Data Table.

▶ In the input box, select the cells for row and column input.

▶ When OK button is pressed, Excel fills all the cells of


the matrix based on your formula.
Pivot table in MS Excel

▶ Pivot table (and pivot chart) provide a means for


summarizing data presented in a table.
▶ Choose the table based on which pivot table needs to
be created.
▶ Choose Insert− >Pivot− >Pivot Table.

▶ MS Excel inserts a summary table in a new worksheet.


Goal seek in MS
Excel
▶ Suppose you have a formula in a cell.

▶ If you wish to know the input for which the formula will
yield a desired result, goal seek will help you.
▶ Click the cell containing the formula. Choose Data−
>What If Analysis− >Goal Seek.
▶ In the first cell of the dialog, enter desired result.

▶ In the second cell, enter the address of the cell


containing wrong input, which needs to be adjusted to
produce the desired new result.
▶ Press seek button and see the suggested new input
value.
▶ Press OK to accept the modified input and cancel to
discard the changes.
Scenarios in MS
Excel
▶ Scenario helps to save different sets of input values
and compare the results of different scenario later on.
▶ To create a scenario, create a set of input values and
calculate the result.
▶ Choose Data− >What If Analysis− >Scenario. Enter a title.

▶ Choose cells for which different sets of input values are to


be tested. Use control to select more than one cell.
▶ Save the scenario with an optional comment.

▶ Repeat the same steps to create more such scenarios.


Save different input values for each scenario.
▶ You can choose any of the scenario at a later time to see
the results.
Image editing, Introduction to the properties and editing of
images. Introduction to Open Office. Introduction to
PowerPoint and its advantages. Creating Slide Shows.
Fine tuning the presentation and good presentation
techniques.
Types of image
▶ Images belong to the following 2 categories:
(i) Raster image: Raster images have pixel as their basic unit.
The most common types of raster image are JPEG (Joint
Photographics Experts Group), PNG (Picture Natural Group),
TIFF (Tagged Image File Format), GIF (Graphics Interchange
Format), PNG (Portable Network Graphics), etc.
(ii) Vector image: Vector images store details of geometrical
shapes and the parameters needed to redraw
those shapes. The most common formats used to store
vector images are SVG (Scalable Vector
Graphics), CGM (Computer Graphics
Metafile), etc.
Basics of digital
images
▶ Digital images comprise of pixels arranged in rectangular
grids.
▶ Each pixel is a dot in an image.

▶ In monitor display, the colour of each pixel is


determined based on RGB (Red-Green-Blue) system,
HSL
(Hue-Saturation-Lightness) system or HSV (Hue Saturation
Value) system.
▶ For printing, CMYK (Cyan-Magenta-Yellow-blacK) colour
system is adopted.
▶ The transparency value of a pixel is represented by
Alpha value (usually 0 to 255).
▶ The spacing of pixels per inch on an image display
Image
editing
▶ Digital images are generated through digital photography,
digital image editing software, scanning of painted images,
etc.
▶ Image editing is necessitated due to:
(i) Photograph having low exposure.
(ii) Photos which require touchup.
(iii) Merging or splitting of digital images.
(iv) Resizing or scaling of digital images.
(v) Adjusting brightness of digital images.
(vi) Adjusting contrast of digital images.
(vii) Creating printable albums and layouts.

▶ Software packages like GIMP, Adobe Photoshop, CorelDraw,


etc. help in editing digital images.
Basic adjustments to an
image
▶ Brightness and contrast values of an image may be
adjusted using Image− >Adjustments−
>Brightness/Contrast menu. Brightness and contrast sliders
may be used to make changes to the image.
▶ Brightness, contrast and threshold values of an image
may be adjusted using Image− >Adjustments− >Levels
menu.
The histogram values may be adjusted to make changes to
the image.
▶ Brightness and contrast values of an image may be
adjusted using Image− >Adjustments− >Curves menu. The
straight line on the histogram values may be adjusted up or
down to make changes to the image.
Tools available in Adobe Photoshop
▶ Rectangular Marquee Tool (M) in Adobe
Photoshop permits selection of rectangular/elliptical
areas. It also permits single or single column marquee
selection.
▶ Lasso Tool (L) in Adobe Photoshop permits selection of
irregular areas (like face from an image, hand from an
image, etc). Lasso tool provides Polygonal lasso and
magnetic lasso options. Whereas Lasso selection is made
between a click and release of mouse button, polygonal lasso
permits placing several points along a selection path.
Magnetic lasso tool places suitable points along the path of
selection when the mouse is simply dragged through a
boundary.
▶ Quick selection tool (W) in Adobe Photoshop creates
a polygonal selection using the selection points. It
provides Magic wand option, which is very popular to
Tools available in Adobe Photoshop

▶ Eye dropper tool (I) in Adobe Photoshop selects


colour from specific point.
▶ Spot healing brush tool (J) in Adobe Photoshop take
sample from one image (or area) and blend it with
another image. Spot healing tools can be configured to
work as Healing brush tool, Patch tool, Content-aware
move tool or Red eye tool.
▶ Brush tool (B) in Adobe Photoshop helps to draw
using selected colour. Brush tool can be configured to
work like Pencil tool, Color replacement tool or Mixer
brush tool.
▶ Clone stamp tool (S) in Adobe Photoshop takes a sample
from one area (Alt+Mouse click) and applies the same in a
new place (Mouse click). This tool has the option for
Pattern stamp tool.
Tools available in Adobe Photoshop

▶ History brush tool (S) in Adobe Photoshop stores


previous sample and mixes the same with the newly
painted layer.
▶ Eraser tool (E) in Adobe Photoshop removes contents of
the current layer and exposes the background layer. It has
the options for Background eraser tool and Magic eraser
tool.
▶ Gradient tool (G) in Adobe Photoshop fills selected
area with a colour gradient, which gradually changes
from one colour to another. It has the option for Bucket
fill tool.
▶ Blur tool in Adobe Photoshop reduces the visibility/ clarity
of selected portion of an image. It has the options for
Sharpen tool and Smudge tool.
Tools available in Adobe Photoshop

▶ Pen tool (O) in Adobe Photoshop helps to draw a shape


and convert the shape to selection, path or vector mask or
define a custom shape by right clicking the closed shape.
▶ Horizontal type tool (T) in Adobe Photoshop helps to
type text elements. It has options for vertical type,
horizontal type mask and vertical type mask.
▶ Path selection tool (A) in Adobe Photoshop selects
elements bounded by a path. It has option for direct
selection tool.
▶ Rectangle tool (U) in Adobe Photoshop draws a rectangle.
It has options for rounded rectangle, ellipse, polygon and
line.
▶ Hand tool (H) in Adobe Photoshop drags a drawing (PAN).
It has option for Rotate tool.
Simple tasks in image editing
▶ Create maxi size photos: Choose File− >New (Ctrl+N).
Set the width to 12 inches and 8 inches and resolution to
200 pixels per inch. If Ruler is not visible, press Ctrl+R
(View− >Rulers). Drag the left line and top line of ruler
to mid width and mid height respectively. Drag and drop
4 photos on 4 parts of the image. Adjust the size and
other effects of photos as you desire.
▶ Create Passport size photo layout: Choose File− >New
(Ctrl+N). Set the width to 12 inches and 8 inches and
resolution to 200 pixels per inch. Open the photo which
should be set to passport size. Use polygonal lasso (or any
other tool) to select the required portion of image. Select All
(Ctrl+A) and Copy (Ctrl+C) the photo. Create new image,
paste the photo. Choose Image− >Image Size and enter
3cm x 5cm size (for passport size photo). Press Ctrl+A,
Ctrl+C to copy. Choose Original blank image (12in x 8in).
Paste multiple times, drag the photo and arrange the photos
Simple tasks in image editing

▶ Create a photo album: Choose File− >New (Ctrl+N). Set


width=16inch and height=10 inch (width and height may
change based on requirements). Set resolution to 300 dots
per inch. Drag the required photo and place it on the page.
Resize the photo and place it in a convenient position. Drag
more photos and organize them. Use blur tool or smudge
tool or sponge tool to blend the overlapping portions. Save
the file. Export it to JPG format. Create many such pages
(one page per file).
▶ Create a banner: Choose File− >New (Ctrl+N). Set
width=72 inch and height=48 inch (width and height may
change based on requirements). Set resolution to 300 dots
per inch. Draw a rectangle and choose suitable fill color for
background. Place text objects are required locations. Copy
and paste (or drag and drop) images. Resize the images to
required size. Save the document and export it to JPG
Simple tasks in image editing

▶ Create a video using photos: Choose File− >New


(Ctrl+N). At the bottom of Adobe Photoshop window, video
timeline appears. Click the triangular button next to video
frame icon and choose Add media. Select all the photos to
be used in the video. Increase or decrease the duration for
each photo (default 5 seconds) by dragging the boundary of
the photo. Audio track can be added using the audio icon.
Choose File− >Export− >Render video. Enter file name and
press Render button. The video is exported to MP4 format.
Introduction to Open
Office
▶ OpenOffice.org was an open source and free software
released in the year 2000, as the successor to the proprietary
office suite called Star Office.
▶ OpenOffice contains a word processor (Writer), spreadsheet
(Calc), Presentation creator (Impress), drawing editor
(Draw), formula editor (Math) and a database tool (Base).
▶ File− >New menu in OpenOffice permits creation of all
types of document supported by OpenOffice.
▶ OpenOffice displays File, Edit, View, Insert, Format, Tools,
Window and Help menus by default. Some extra menus
might appear to suit the needs of specific programs.
▶ OpenOffice features similar to those offered by MS Office.

▶ OpenOffice can open and edit most of the MS


File formats for OpenOffice documents

Table: File formats for OpenOffice documents


No. File Purpose
extension
1 .odt ODF Text.
2 .ott ODF Template Text.
3 .odm ODF Master Document.
4 .ods ODF Spreadsheet.
5 .ots ODF Spreadsheet Template.
6 .odg ODF Drawing.
7 .otg ODF Template Drawing.
8 .odp ODF Presentation.
9 .otp ODF Template Presentation.
10 .odf ODF Formula.
11 .odb ODF Database.
Introduction to Power Point

▶ Microsoft Powerpoint, (command name powerpnt), is a


tool for creating presentations.
▶ Powerpoint is included as a part of Microsoft Office.

▶ Powerpoint files have extension of .pptx. Files created


using Powerpoint in earlier versions of MS Office (up to
2003) had extension of .ppt.
▶ Powerpoint helps to create slide by slide presentations.

▶ Powerpoint is helpful for making classroom presentations,


business proposals and progress reports.
Menu structure of Power Point

▶ Powerpoint has the following menu


structure:
(i) File/ office:
(a) Save (Alt+F+S, Ctrl+S)
(b) Save As (Alt+F+A)
(c) Open (Alt+F+O, Ctrl+O)
(d) Close (Alt+F+C)
(e) Info (Alt+F+I)
(f) Recent (Alt+F+R)
(g) New (Alt+F+N, Ctrl+N)
(h) Print (Alt+F+P, Ctrl+P)
(i) Save & Send (Alt+F+D)
(j) Help (Alt+F+H)
(k) Options (Alt+F+T)
(l) Exit (Alt+F+X).
Home
menu
(ii) Home:
(a) Clipboard (Alt+H+FO), Paste (Alt+H+V, Ctrl+V), Cut
(Alt+H+X, Ctrl+X), Copy (Alt+H+C, Ctrl+C), Format
Painter (Alt+H+FP).
(b) Slides, Insert (Alt+H+I, Ctrl+M), Layout (Alt+H+L),
Reset
(Alt+H+Q), Selection (Alt+H+T).
(c) Font (Alt+H+FN), Font Face (ALt+H+FF), Font Size
(Alt+H+FS), Font Grow (Alt+H+FG), Font Decrease
(Alt+H+FK), Bold (Alt+H+1, Ctrl+B), Italic (Alt+H+I,
Ctrl+I), Underline (Alt+H+U, Ctrl+U), Text Shadow
(Alt+H+5), Strikethrough (Alt+H+4), Character spacing
(Alt+H+6), Change case (Alt+H+7, Shift+F3), Font Color
(Alt+H+FC).
(d) Paragraph (Alt+H+PG), Bullets (Alt+H+U), Numbering
(Alt+H+N), Decrease list level (Alt+H+AO), Increase list
level (Alt+H+AI), Align left (Alt+H+AL, Ctrl+L), Align
Right (Alt+H+AR, Ctrl+R), Justify (Alt+H+AJ, Ctrl+J),
Columns (Alt+H+J), Line Spacing (Alt+H+K), Text direction
(Alt+H+AX), Align text (Alt+H+AT), Convert to Smart Art
Home menu ...Contd.
(e) Drawing (Alt+H+O), Shapes (Alt+H+SH), Arrange
(Alt+H+G), Shape Quick Styles (Alt+H+SS), Shape Fill
(Alt+H+SF), Shape Outline (Alt+H+SO), Shape Effects
(Alt+H+SE).
(f) Editing, Find (Alt+F+FD, Ctrl+F), Replace (Alt+H+R,
Ctrl+H), Select (Alt+H+SL), Select All (Ctrl+A).
Insert & Design
menu
(iii) Insert:
(a) Table (Alt+N+T).
(b) Images, Picture (Alt+N+P), Clip Art (Alt+N+F), Screenshot
(Alt+N+SC), Photo (Alt+N+A).
(c) Illustrations, Picture (Alt+N+SH), Smart Art (Alt+N+M),
Chart (Alt+N+C).
(d) Links, Hyperlink (Alt+N+U), Action (Alt+N+K).
(e) Text, Text Box (Alt+N+X), Header & Footer (Alt+N+H),
Word Art (Alt+N+W), Date & Time (Alt+N+D), Slide
Number (Alt+N+SN), Object (Alt+N+J).
(f) Symbols, Equation (Alt+N+E), Symbol (Alt+N+U)
(iv) Design:
(a) Page Setup, Page Setup (Alt+G+S), Slide Orientation
(Alt+G+O).
(b) Themes, Colours (Alt+G+TC), Fonts (Alt+G+TF), Effects
(Alt+G+TE), More (Alt+G+H).
(c) Background (Alt+G+G), Background Styles (Alt+G+B),
Slide Background (Alt+G+M)
Transitions & Animations menu
(v) Transitions
(a) Preview Preview (Alt+K+P, F5)
(b) Transition, More (Alt+K+T), Effect Options (Alt+K+O).
(c) Timing, Sound (Alt+K+U), Duration (Alt+K+E), Apply to
all (Alt+K+L), On mouse click (Alt+K+M), After
(Alt+K+F).
(vi) Animations
(a) Preview, Preview (Alt+A+P), Animations (Alt+A+M),
Shapes (Alt+A+S), Effect Options (Alt+A+O).
(b) Advance Animation, Add Animation (Alt+A+AA),
Animation Pane (Alt+A+C), Trigger (Alt+A+AT),
Animation Painter (Alt+A+AP).
(c) Timing, Start (Alt+A+T), Duration (Alt+A+DU), Delay
(Alt+A+DE), Move Earlier (Alt+A+E), Move Later
(Alt+A+L).
(vii) Slide
Show(a) Start Slide Show From Beginning (Alt+S+B, F5), From
Current (Alt+S+C, Shift+F5), Broadcast Slide Show
(Alt+S+D), Slide show (Alt+A+M).
(b) Setup Setup Slide Show (Alt+S+S), Hide Slide (Alt+S+H),
Rehearse Timings (Alt+S+T), Record Slide Show
(Alt+S+N), Play Narrations (Alt+S+P), Use Timings
(Alt+S+U), Show Media Controls (Alt+S+W).
(c) Monitors Resolution (Alt+S+R), Show On (Alt+S+O), Use
Presenter View (Alt+S+V).
(viii)Review
(a) Proofing, Spelling (Alt+R+S), Research (Alt+R+R),
Thesaurus (Alt+R+E).
(b) Language, Translate (Alt+R+2), Language
(Alt+R+U).
(c) Comments, Show Markup (Alt+R+M), View Comment
(Alt+R+C), Edit Comment (Alt+R+T), Delete (Alt+R+D),
Edit Comment (Alt+R+T), Previous (Alt+R+V), Next
(Alt+R+N).
(d) Compare, Compare (Alt+R+G), Accept (Alt+R+A), Reject
(Alt+R+T), Previous (Alt+R+F), Next (Alt+R+H), Preview
Creating Slide
Shows
▶ Slide show can be created by choosing File− >New
from menu or by pressing Ctrl+N/ Alt+F+N.
▶ Presentation starts with a single slide.

▶ Choose suitable design for the presentation from


Design menu. Different slide colours and designs are
available.
▶ Choose Headers and Footers from Insert− >Text−
>Header & Footer (Alt+N+H). Set appropriate values for
header and footer.
▶ First slide requires name of presentation, author name
and other details related to the presentation.
▶ Insert new slide by choosing Home− >Slides− >Insert
or pressing Ctrl+M/ Alt+H+I.
▶ The new slide has a caption. Fill appropriate caption.
Creating Slide
Shows
▶ Slide transition effects may be controlled
using Transitions− >Transition menu.
▶ Animation for slide transition may be applied
from Animations− >Preview− >Animations or
Animations− >Preview− >Shapes or
Animations− >Preview− >Effect Options.
▶ Slide show can be started from current slide (Shift+F5) or
from the beginning (F5). To stop presentation, press Esc
key.
▶ Mistakes in spelling are underlined in red colour. Spelling
mistakes can be corrected by choosing
Review− >Proofing− >Spelling from menu or by pressing
Alt+R+S.
Fine tuning a presentation

▶ Presentation may be made to change slides at


specified interval automatically using
Animations− >Timing− >Duration.
▶ Specified tone may be permitted to play at the time of
each slide transition using Transitions− >Timing−
>Sound.
▶ Audio may be recorded for each slide using Slide
Show− >Setup− >Record Narration (Alt+S+N). This audio
plays when the slide is presented. Recording may be verified
using Slide Show− >Setup− >Play Narration (Alt+S+P).
▶ Search may be carried out using Home− >Editing−
>Find (Ctrl+F/ Alt+H+FD).
▶ Replace may be carried out using
Home− >Editing− >Replace (Ctrl+H/ Alt+H+R).
Good presentation techniques

▶ Choose contrasting background and foreground colours


(light background and dark foreground OR dark background
and light foreground).
▶ Choose mild animations for slide transition. Fast and
repeating animations create irritation to the
audience.
▶ Transition effects may be applied uniformly to all slides.
Different transition effect for each slide might distract
the attention of the audience.
▶ Text in each slide should be large enough for the audience
to read without strain.
▶ In case of automated slide transition in presentation, the
duration should be sufficient for even the slowest reader
to read/ observe the slide.
Syllabus
Concept of DBMS, RDBMS, Data Models, Concept of DBA,
Database Users, Database Schema, Designing Database
using Normalization Rules, Various data types Data integrity,
DDL, DML and DCL statements, Enforcing Primary key and
foreign key, Adding Indices, Concepts of Transactions, ACID
Property of Transaction, Constraints, Joining of tables, Sub
Queries, Functions used in query like sum, average, max,
min, count etc.
Data

▶ Information collected for storage, reference and


analysis purpose is called data.
▶ Data may be in the form of digital text or numbers.

▶ Data may be stored in paper format or in electronic


storage.
▶ Datum is the singular form for the word data.

▶ Data related to financial transactions is used for


accounting.
▶ Survey is a systematic method for data collection.

▶ Specialized software for storage, analysis and retrieval of


data is called Database Management System (DBMS).
Information

▶ Details collected about an particular object is


called information.
▶ While data can be a collection of unrelated
details, information has some common theme.
▶ Information is always used in singular form.

▶ Storage and transmission of information is the main use


of communication technology in the modern era.
▶ Digital information may be stored in hard drive, optical
drive, SD card, pen drive, cloud storage or data centre.
Database

▶ The system for storage and retrieval of data in digital


format is called database.
▶ Database can be stored in a single computer or in
multiple computers.
▶ Database makes the storage and retrieval of data easy for
the client.
▶ Databases are of the following types:
(i) Navigational or Hierarchical database - 1960-1970
(ii) Relational Database - Edgar Codd - 1970 - SQL (Structured
Query Language)
(iii) Object Oriented Database Management System (OODBMS)
-
1990
(iv) NoSQL - 2000 - Fast, unstructured, inconsistent - Mostly used
by Social Media platforms.
(v) NewSQL - 2000 - Combination of NoSQL engine with SQL
Concept of DBMS
▶ Data Base Management System (DBMS) was invented
for storing and retrieving information in tables.
▶ Each table has columns (which are given names) and
rows, which represented information.
▶ All data in DBMS was usually packed in a single table.

▶ Since a single table had to store all information, in any


given row, may columns remained without value.
▶ DBMS like DBase, Foxpro, etc. made data management
easier.
▶ DBMS were inherently inefficient in storing data.
The relational system superceded the DBMS.
Concept of RDBMS

Figure: Relational Data Base Management System (RDBMS)[6]


Concept of RDBMS

▶ Relational Data Base Management System (RDBMS) was


an evlution of DBMS.
▶ The RDBMS system was proposed by Edgar Codd of IBM
in the year 1970.
▶ Edgar Codd stipulated 13 rules, numbered from Rule 0
to Rule 12, which are to be enforced by any RDBMS.
▶ The concept of set theory and relations were applied
to database tables and the same was called RDBMS.
▶ RDBMS supports many tables, each table related to the
other using some key column.
▶ RDBMS allows inner join, outer join and sub-query
when selecting data.
▶ RDBMS madates that all data operations should be carried
Data Models

Figure: Data Models[7]


Data Models
1 RDBMS: Relational Data Base System (RDBMS) is used in
most of the commercial software applications. RDBMS is
reliable, fast and flexible. The security model of RDBMS is
also makes it suitable for enterprise software applications.
2 Entity Relationship Model: Entities, also called objects,
are created. Relations between entities are defined. This
entity relationship model was proposed by Peter Chen in
1976. An entity named ’student’ may have relationship sets
named ’student roll number’,’student name’,’student dob’.
etc.
3 Object Relational Model: Entity Relational model was
extended with the name of Object Relational Model
using Object oriented concepts of methods,
encapsulation, inheritance, etc.
4 Semi-structured model: Semi-structured data model
does not enfoce particular column structure for
information. Each item has got different structure.
Popular Database
Engines
1 Oracle: Oracle is one of the most popular database
software.
Oracle is fully compliant with all the rules applicable for
Relational Database Management System (RDBMS).
Oracle is the platform preferred by many professional
organizations.
2 Microsoft SQL Server: Microsoft SQL Server is fast
growing platform for database management. It provides fast
performance and is available for Windows, Linux and Mac
operating systems. It provides easy integration with MS
Excel and other software packages.
3 IBM DB2: IBM DB2 is a high performance database
engine providing back end services for many business
organizations and insurance companies. IBM was the leader
in the field of Relational Database Management, since
Edgar Codd, was an employee of IBM and DB2 was one of
the first relational database systems.
4 Teradata: Teradata supports large scale databases
Popular databases
5 MySQL: MySQL was developed by MySQL AB, bought by
Sun Microsystems and bought again by Oracle. MySQL is
an open source database engine. MySQL is the preferred
database system for web based applications.
6 PostgreSQL: PostgreSQL is an enterprise grade RDBMS
and OODBMS available under open source licensing.
7 MongoDB: MongoDB is a NOSQL database engine.
MongoDB has the advantage of speed and flexibility and is
used by social media platforms where speed and flexibility
are more important than data integrity.
8 SAP ASE: SAP (formerly Sybase) Adaptive Server Enterprise
(ASE) is a fast relational database system.
9 Informix: Informix is an object oriented database system
and supports NoSQL features. It is owned by IBM.
10 Microsoft Access: Microsoft Access is suitable for
desktop based database management. It provides facilities
to create forms and reports.
11 SQLite: SQLite is a light weight database engine used for
Codd’s Rules for RDBMS

▶ Rule 0 - Foundation rule: A relational database system


must be able to manage data entirely through relational
rules.
▶ Rule 1 - Information rule: data in a database should be
held only in table.
▶ Rule 2 - Guaranteed access rule: Each and every datum
should be accessible through a combination of table, key
and column.
▶ Rule 3 - Null value rule: Absence of data should be
represented through null value, irrespective of data
type.
▶ Rule 4 - Active online catalogue rule: Table schema
should also be stored in tables and should be accessible
through SQL.
Codd’s Rules for RDBMS
▶ Rule 7 - High level insert, update and delete rule:
The data sub-language should support insert, update and
delete operations in addition to select option.
▶ Rule 8 - Physical data independence: The mode of
physical storage media and structure of media should
not affect the data sub-language.
▶ Rule 9 - Logical data independence: Any application
accessing the data should be unaffected by the changes
to schema used for data tables.
▶ Rule 10 - Integrity independence: Database must
be independent of the application using the data.
▶ Rule 11 - Distribution independence: End user must
not feel any difference between data stored in local media
and data stored in several locations (over the network).
Key terms related to RDBMS
1 RDBMS: Relational Database Management System. It is
compliant with Codd’s rules and is accessed through
SQL.
2 SQL: Structured Query Language - the sub-language used
to work with RDBMS.
3 Database: A collection of tables used to store data.
4 Table: A group of columns used to store data related to
an individual entity.
5 Column: One subhead for storing data in a table (like
name, mobile number, email id, etc.)
6 Row or Record: One set of information relating to an
object which fills up all the columns with data values
(including null value), like
(’Krish’,’345345345’,’[email protected]’).
Key terms related to RDBMS
7 Row: One set of information relating to an object which
fills up all the columns with data values (including null
value), like (’Pavithra’,’345345345’,’[email protected]’).
8 Data Type: A column may have a data type. Common
data types supported by MySQL are char, varchar, int, date,
time, datetime, bigint, double, clob, blob. Different
database servers support slightly different names for data
types.
9 Primary key: The main column used for indexing and
searching data is called primary key. Primary key does
not support duplicate values.
10 Foreign key: The primary key of a different table used in
another table for relational, searching and indexing purposes
is called foreign key. Foreign key permits duplicate values.
11 Constraints: NOT NULL, AUTO INCREMENT, UNIQUE,
DEFAULT, PRIMARY KEY, FOREIGN KEY, INDEX etc. are
some of the constraints used to fill columns with valid data.
Data Base Administrator (DBA)

Figure: Data Base Administrator’s Roles[8]

▶ Data Base Administrator (DBA) designs databases and tables.

▶ DBA decides the structure of table, called schema of table.

▶ DBA is responsible for creating relationships between tables.

▶ DBA creates user id and passwords for use by others.

▶ DBA is responsible for creating backup at periodic intervals.


Data Base
User
▶ Database users have a login id and password.

▶ Users login and perform tasks within their assigned rights.

▶ Some users can create databases and tables (just like


admin), some can alter tables, some can only insert data or
select data, some can only view data.
▶ Rights for each user can be granted or revoked by the DBA.

▶ Normal users can be dropped (removed) by the DBA.

▶ To create a new user name ’krish’, the DBA would run


the following mysql query:
CREATE USER ’krish’@’localhost’ IDENTIFIED BY
’password’;
Data Base
User
▶ There are previleges to CREATE, SELECT, INSERT,
UPDATE, DELETE and DROP for normal users. e.g., DBA
may grant create, select and insert previleges to krish
using the following query:
GRANT CREATE, SELECT, INSERT ON * . * TO
’krish’@’localhost’;
▶ Using REVOKE in place of GRANT in the above query will
revoke permissions. To remove create and insert
permissions, the following query will work:
REVOKE CREATE,INSERT ON * . * TO ’krish’@’localhost’;
▶ Finally, a user may be removed from the list of users
using drop command. The following query removes our
user account:
DROP USER ’krish’@’localhost’;
Schema
▶ Schema describes the structure of a database table.

▶ Normally, the column names, data types and constraints form


the logical schema for table.
▶ The storage allocation and file/ disk related
activities constitute the physical schema.
▶ In mysql, decribe command displays the table schema. e.g.,
to display the structure of a table named ITI, one may issued
the following SQL command: DESCRIBE ITI;
Rules for designing good
tables
1 Determine the purpose of the database.
2 Organize the information to be stored in the database.
3 Divide the information into suitable tables.
4 Define column values and primary key.
5 Define relationships between tables.
6 Normalization is the process of defining the columns
required and methodically grouping them into suitable
tables.
7 The purpose of normalization is to create a table in such
a way that each column may be closely related to the
other.
8 When certain columns repeat with duplicate values,
those columns may be divided into separate tables.
9 Primary key is the unique identifier for each table. Values
in primary key column are to be unique (to occur only
once).
Normalization of tables

▶ The process of starting with all required columns and


finishing with different tables and relationships is called
Normalization.
▶ Normamization is applied in 5 different stages called
Normal Forms as follows:
(i) 1NF or First Normal Form: Define column names and
data types.
(ii) 2NF or Second Normal Form: Remove repetition of data.
(iii) 3NF or Third Normal Form: Define a primary key for
each table.
(iv) 4NF or Fourth Normal Form: Divide unrelated columns
of
table into separate tables.
(v) 5NF or Fifth Normal Form: If columns in a table can be
divided into separate tables connected by appropriate keys,
the table should be further divided.
Integrity rules and constraints in a
table 1 Domain Integrity: Specifying suitable constraints and
setting values permitted and not permitted in a table is
called domain integrity. For example, specifying that ID is a
primary key and has auto increment attributes is one way of
specifying domain integrity.
2 Entity integrity: Every table should have a primary key.
3 Referential integrity: Value referred in a foreign key
column should be present in some other table as a value in
primary column.
Relationships in tables
1 One to many relationship: One primary key column of a
table getting referred many times through foreign key value
in another table (patient.ID and visit.PATIENT ID columns
in patient and visit tables).
2 Many to many relationship: The appearance of many
keys of first table against many other keys of a second
table is called many to many relationship (Many product
IDs of product table appearing in several order IDs of order
table is an example of many to many relationship).
3 One to one relationship: If one key value of first table
appears only once in a second table, it is called one to one
relationship (the relation between personal.AADHAR and
contact.AADHAR is one to one and cannot have more
than one relationship).
String datatypes in MySQL
1 CHAR(n): Character data type with n characters (fixed).
Maximum length: 255 characters.
2 VARCHAR(n): Variable number of characters.
Maximum length: 65,535.
3 BINARY(n): Stores binary bytes (instead of human
readable strings).
4 VARBINARY(n): Stores variable number of binary
bytes (instead of human readable strings).
5 TINYBLOB: Stores up to 255 binary bytes of data.
6 TINYTEXT: Stores up to 255 characters of data.
7 TEXT(n): Stores up to 65,535 characters of data.
8 BLOB(n): Stores up to 65,535 Binary Large OBjects
(BLOB) of data.
9 MEDIUMTEXT: Stores up to 16,777,215 Characters of
data.
10 MEDIUMBLOB: Stores up to 16,777,215 Binary Large
String datatypes
11 LONGTEXT: Stores up to 4,294,967,295 Characters of data.
12 LONGBLOB: Stores up to 4,294,967,295 Binary
Large OBjects (BLOB) of data.
13 ENUM(”one”,”two”,”three”): Enum data type creates
a column whose data can have one of the given values.
12 SET(”one”,”two”,”three”): Set creates a data type
where the columns can have any one or combination of
values defined inside the set (for the above type,
”one,two”,”one,three”,”one,two,three”,”two,three” are some
of the permissible values for given column).
Numeric datatypes in MySQL
1 BIT(n): Can hold bit values. Maximum size is 64 bits.
2 TINYINT: Can hold integer values in the range of -128 to
+127 or 0 to 255.
3 BOOL or BOOLEAN: TRUE or FALSE value (0 - FALSE, ̸=
0 - TRUE).
4 SMALLINT: Integer values of -32768 to 32767 (signed) or
0 to 65535 (unsigned) may be stored.
5 MEDIUMINT: Integer values of -8388608 to
8388607 (signed) or 0 to 16777215 (unsigned) may
be stored.
6 INT or INTEGER: Integer values of -2147483648 to
2147483647 (signed) or 0 to 4294967295 (unsigned) may
be stored.
7 BIGINT: Integer values of -9223372036854775808
to 9223372036854775807 (signed) or 0 to
18446744073709551615 (unsigned) may be stored.
8 FLOAT(size, d): Stores floating point numbers of given
size with d decimal places. It will be removed in future
Date and Time datatypes in MySQL
1 DATE: Holds date in ’yyyy-mm-dd’.
2 DATETIME: Holds date and time in the
format ’YYYY-MM-DD hh:mm:ss’.
3 TIMESTAMP: Number of seconds since 01-Jan-1970 (UNIX
epoch)).
4 TIME: Time value in hh:mm:ss format.
5 YEAR: Four digit year values may be stored. e.g., ’2022’.
Data Definition Language (DDL)
1 DDL - Data Definition Language: The commands used
to create or alter databases and tables is called DDL.
Typical DDL commands are:
(i) create database ITI;
(ii) create table TRAINEE (reg no varchar(14) primary key, name
varchar(50), dob date not null, mark int not null
default 0, max mark int not null default 1);
(iii) alter table trainee add column percentage double default 0
after max mark;
(iv) drop table TRAINEE;
(v) drop database ITI;
Data Manipulation language (DML)
2 DML - Data Manipulation language: Helps to
insert, update and delete data values.
(i) insert into trainee
values(’001784000132’,’Mala’,’2002-03-19’,460,500,92.00);
(ii) update trainee set name=’Malarvizhi’ where
reg no=’001784000132’;
(iii) delete from trainee where reg
no=’001784000132’;
Data Query Language (DQL)
3 DQL - Data Query Language: SQL commands used
to select data from tables falls under the category of
DQL. Typical DQL commands are:
(i) select reg no, name, dob from TRAINEE
where name=’Malarvizhi’;
(ii) select reg no, name, dob from TRAINEE
where reg no=’001784000132 ’;
(iii) select * from TRAINEE order by dob;
(iv) select * from TRAINEE order by dob DESC;
(v) select * from TRAINEE where name like ’Ma
%’ order by dob;
(vi) select * from TRAINEE where name like ’%arvi%’ order
by dob;
(vii) select average(percentage) from TRAINEE;
(viii) select average(percentage) from TRAINEE group by dob;
(ix) select average(percentage) from TRAINEE group by dob order
by percentage;
(x) select average(percentage) from TRAINEE having dob >
’2000-01-01’ group by dob order by percentage;
Data Control Language (DCL)
4 DCL - Data Control Language: Used for database
administration functions like creating user, changing
password, granting rights, revoking rights, etc.
1. To create a new user name ’krish’, the DBA would run the
following mysql query:
CREATE USER ’krish’@’localhost’ IDENTIFIED BY
’password’;
2. There are previleges to CREATE, SELECT, INSERT,
UPDATE, DELETE and DROP for normal users. e.g., DBA
may grant create, select and insert previleges to krish using
the following query:
GRANT CREATE, SELECT, INSERT ON * . * TO
’krish’@’localhost’;
3. Using REVOKE in place of GRANT in the above query will
revoke permissions. To remove create and insert
permissions, the following query will work:
REVOKE CREATE,INSERT ON * . * TO ’krish’@’localhost’;
4. Finally, a user may be removed from the list of users using
drop command. The following query removes our user
account: DROP USER ’krish’@’localhost’;
Enforcing primary
key
▶ Primary key is a unique identifier for one row of data in
a table. No duplicate enties are permitted.
▶ As an example, one may create a table for storing name,
address and phone numbers. Since a person may have one
address and many mobile numbers, we may create two
tables as follows:
1. address: Containing id, name and address columns. It may
be created using the following command:
create table address (id bigint, name varchar(50) not null,
address varchar(300) not null default ”,primary key(id));
2. phone: containing id, person id, mobile columns,
created
using the following command:
create table phone (id bigint auto increment primary key,
person id bigint, phone varchar(20) not null default ”,
constraint fk foreign key(person id) REFERENCES
address(id));

▶ Primary key in address table is referred as foreign key in


Enforcing primary key and foreign
key
▶ The following commands are permitted on address
table: insert into address values(1,’Ram’,’Uttar
Pradesh’); insert into address
values(2,’Krish’,’Gujarat’);
▶ The following command will fail because primary key value
of 2 has already been allotted to Krish:
insert into address values(2,’Govind’,’Andra Pradesh’);
▶ The following commands will work on phone table:
insert into phone values(0,1,’23423422’);
insert into phone values(0,1,’4563453343’);
insert into phone values(0,1,’23423422’);
insert into phone values(0,2,’23423423’);
insert into phone values(0,2,’45646454’);
▶ The zero (0) value against id column is permissible
since auto increment property has been set.
Adding Indices
1. Index is a special column on which frequent search
operation may be performed while querying the table.
2. We might like to create index on column name in
table address. This is possible using the following
query: create index name on address(name);
3. Alternately, index may have been declared while creating
the table itself. The SQL should be mildly modified as
follows: create table address (id bigint, name varchar(50)
not null, address varchar(300) not null default ”,primary
key(id), index(name));
4. Declaration of index will make queries to work faster.
Concepts of Transactions
1. Transactions are a set of tasks to be carried out on a
database.
2. Each query like insert, delete, drop, alter, grant,
revoke creates certain transactions.
3. Each transaction begins with opening of a particular
entity (typically a table) and ends in its closing.
4. Each transaction may contain several smaller tasks.
5. We might invoke an update query as follows:
update address set name=’Sriram’ where id=1;
6. Typically, the query will generate following operations to
complete the transaction:
open(address);
search for
index=1; set
name=’Sriram’;
close(address);
ACID Property of Transaction
1. ACID property stands for Atomicity, Consistency, Isolation,
Durability.
2. Atomicity: The transaction should have either taken place
or failed. It should not leave the database with unfinished
transaction.
3. Consitency: Each transaction should leave the database
with proper values of data.
4. Isolation: Although several transactions take place at the
same time, each transaction should be carried out as
though it were the only transaction.
5. Durability: Result of each transaction should remain
permanent, no matter what happens to the computer (like
a restart).
Constraints

▶ Constraints are restrictions placed on the values a column


may or may not permit.
▶ Constraint specifiers follow the declaration of column
name and data type.
▶ Following are the constraints enforced by mysql:
1. NOT NULL: Ensures that the column value is always
something other than NULL.
2. UNIQUE: Duplicate values are not permitted in the
column.
3. PRIMARY KEY: It is a combination of NOT NULL and
UNIQUE. It ensures unique non-null value for
column.
4. FOREIGN KEY: Ensures that relationships between
tables
tables are not removed.
5. DEFAULT: This value is inserted if not value is specified for
the particular column.
Joining of
tables
▶ Connecting two tables to produce results for select query
is called join.
▶ Four types of JOIN operations are permitted by mysql.
They are:
1. INNER JOIN: Intersection of two tables is selected.
2. LEFT JOIN: Intersection of two tables and entire data in left
table are selected.
3. RIGHT JOIN: Intersection of two tables and entire data in
right table are selected.
4. CROSS JOIN: Each row in left table is joined with all rows
in right table.

(a) INNER (b) LEFT (c) RIGHT (d)


JOIN JOIN JOIN CROSS
JOIN
Examples of join statements

▶ The query select address.id, address.name, phone.phone


from address INNER JOIN phone on
address.id=phone.person id; will prodce inner join selection.
▶ The query select address.id, address.name, phone.phone
from address LFET JOIN phone on address.id=phone.person
id; will prodce left join selection.
▶ The query select address.id, address.name, phone.phone
from address RIGHT JOIN phone on
address.id=phone.person id; will prodce right join selection.
▶ The query select address.id, address.name, phone.phone
from address CROSS JOIN phone on
address.id=phone.person id; will prodce cross join selection.
Examples of join
statements

(a) INNER JOIN

(b) LEFT JOIN


Examples of join statements

(c) RIGHT JOIN

(d) CROSS JOIN

Figure: Resuls of JOIN Operations in MySQL


Sub
Queries
▶ Sub queries are executed first and the result substituted in
the main query.
▶ Imagine a condition where we know the name of person to
be contacted (Ram) and wish to get contact numbers.
▶ Since ID value in address for Ram is not known, one
may execute a subquery (select id from address where
name=’Ram’;) to find the same.
▶ The query with subquery may be executed as follows:
select phone from phone where person id=(select id
from address where name=’Ram’);
▶ Results of the subquery for names of Ram and Krish
are shown in fig.51.
Aggregate functions in MySQL

▶ Aggregate functions help to calculate count, sum,


average, minimum, maximum, standard deviation, etc.
▶ Following aggregate functions are commonly available
in mysql:
1. count: Number of rows matching given condition
(where clause).
2. sum: Sum of values in particular column where rows
match given condition (where clause).
3. avg: Average of values in particular column where rows
match
given condition (where clause).
4. min: Minimum value of particular column where rows
match given condition (where clause).
5. max: Maximum value of particular column where rows
match
given condition (where clause).
6. stddev: Standard deviation of value contained in particular
column where rows match given condition (where
Aggregate functions in MySQL

▶ A table named result with id, name, subject and


mark columns is created using the following query:
create table result (id bigint auto increment primary key, name
varchar(20), subject
ENUM(’Tamil’,’English’,’Maths’,’Science’,’Social’), mark int);
▶ Following values may be inserted into the result
table: emph insert into result
values(0,’Ram’,’Tamil’,94); insert into result
values(0,’Ram’,’English’,92);
insert into result values(0,’Ram’,’Maths’,100);
insert into result values(0,’Ram’,’Science’,98);
insert into result values(0,’Ram’,’Social’,91);
insert into result values(0,’Krish’,’Social’,76);
insert into result values(0,’Krish’,’Maths’,93);
Aggregate functions in MySQL

Figure: Inserting data into result


table
Aggregate functions in MySQL

▶ Following queries were run to populate the result table:


emph select subject, count(subject) from result group
by subject order by subject;
select name, sum(mark) from result group by name order by
name;
elect name, avg(mark) from result group by name order by
name;
select min(mark) from result;
select max(mark) from
result;
Aggregate functions in MySQL

(a) Count

(b) Sum
Aggregate functions in MySQL

(c) Average

(d) Min (e) Max

Figure: Aggregate functions in MySQL


Syllabus
Local Networks, Communicating on a Local Network,
Principles of Communications, How do Ethernet Networks
Work?, How are Networks Built?, Routing Across
Networks, How end-user devices and local networks
interact with the global Internet. Concept of network
communication. Local Networks Explain the roles of devices
in a network. What Does a Home Network Look Like?
How Does Wi-Fi Work? Introduction to LAN Devices,
Internetworking Devices, Introduction to www, Concept of
Internet, Web Browsers, internet servers and search
engines. Concepts of Domain naming Systems and E mail
communication. Introduction to video chatting tools and
Social Networking concepts.
Computer Networks

▶ The communication infrastructure meant for sharing of


data between computers is called computer network.
▶ Connection between computers may be through cable, WiFi
(Wireless Fidelity), bluetooth or any other method.
▶ Modem, repeater, hub, bridge, switch, firewall, etc. are the
essential infrastructure to run a network.
▶ Each computer connected to a computer assumes a
unique identifier called IP (Internet Protocol) Address
(IP4 - 216.58.201.174, IP6 -
2001:0db8:85a3:0000:0000:8a2e:0370:7334).
▶ Domain name is converted to equivalent IP address
using Domain Name Server (DNS).
▶ IP4 address is 32 bits (4 bytes) in length.
Computer Networks
▶ There are 3 classes of IP address, as detailed below:
(i) Class - A network (Fig.54): High order byte (right most 8
bits) of the network is reserved for network ID. The
remaining 24 bits are used to set IP address of the host.
This permits 126 networks and 16,777,214 hosts per
network.

Figure: Address bit configuration: Class A network


[69]
Computer Networks
(ii) Class - B network (Fig.55): High order 2 bytes (right
most 16 bits) of the network are reserved for network ID.
The first and second bits of network ID are always 1 and 0.
The remaining 14 bits are used to set network IDs (16,384
networks). The lower 2 bytes of the IP address are meant
for host ID (16,534 hosts).

Figure: Address bit configuration: Class B network


[69]
Computer Networks
(iii) Class - C network (Fig.56): High order 3 bytes (right most
24 bits) of the network are reserved for network ID. The first,
second and third bits of network ID are always 1, 1 and 0.
The remaining 21 bits are used to set network IDs (2,097,152
networks). The lowest byte of the IP address is meant for
host ID (254 hosts).

Figure: Address bit configuration: Class C network


[69]
Client Server
computing
▶ Client and server are two computers behaving like a
customer and service person in a hotel desk.
▶ Both the client and the server have a unique IP address (to
locate the computer on the network) and Port number (to
identify the program which communicates over the
network).
▶ The sets of {IPclient, Portclient} and {IPserver , Portserver } are
called half associations.
▶ Taken together, the IP and port data of client and server
({IPclient, Portclient} and {IPserver , Portserver }) form a full
association.
▶ On getting connected, the client places a request to the
server to get some job done (like the customer placing an
order to the service person in a hotel desk).
Client Server
computing
▶ The server gets any additional data required for processing,
completes the job and delivers the result to the client (like
the service person in a hotel desk offering the food items
ordered by the customer).
▶ The client side half association {IPclient, Portclient} is called
client socket.
▶ The server side half association {IPserver , Portserver } is called
server socket.
▶ As a real world example, www.google.com is a server and
the user computer accessing it is a client.
▶ The server awaits the arrival of a client request, completes
the request and keeps waiting for clients (called listening).
▶ The client and server might use Transmission Control
Protocol (TCP) for error free transmission of sensitive
data (like bank transactions, email, etc.).
Peer to peer networking

▶ Peer to peer communication takes place between two


computers connected on an equal status (unlike client
and server).
▶ Peer to peer communication helps to share files and
folders.
▶ Peer to peer communication helps in the easy sharing
of printers and scanners.
▶ Peer to peer communication has the limitation of
not permitting connection to any external network.
Proxy server, Firewall and Proxy
Firewall
▶ Proxy servers: Proxy servers run as the intermediary
between actual server and the client. The proxy server helps
in content filtering and load balancing of web servers.
▶ Firewall: Firewall separates a small network from the
Internet. It scrutinizes all incoming and outgoing data
and prevents communication of harmful data.
▶ Proxy Firewall: Proxy Firewall is an improvement to the
actual firewall and provides security at deeper levels (layer 7
of the 7 layer OSI model) of communication than the
firewall.
Proxy firewall separates a small network from the Internet. It
scrutinizes all incoming and outgoing data and prevents
communication of harmful data.
Network Topologies

Figure: Network topologies


[70]
Network Topologies (Fig.57)[70]
(i) Bus topology: Bus topology provides a single linear
network cable to which all other nodes are connected.
(ii) Star topology: Star topology provides single central node
through which all other nodes communicate with each
other.
(iii) Ring topology: Ring topology ends where it began,
all computers/ nodes connected to the endless ring.
(iv) Mesh topology or Fully connected topology: Mesh
topology or fully connected topology has direct
connection between all computers connected to the
network. It offers speed by it is costly.
(v) Tree topology: Tree topology allows each node of the
network to divide/ diverge into 2 separate connections,
each new node dividing till the end of network is reached.
(vi) Hybrid topology: Hybrid topology allows different
portions of the network to adopt different topologies (like
Network
types
(i) PAN - Personal Area Network: Tiny network running
inside a few rooms of a building, typically created using
Bluetooth technology, is called Personal Area Network (PAN).
(ii) LAN - Local Area Network: Small network running inside
a building is called Local Area Network (LAN).
(iii) CAN - Campus Area Network: The network consisting of
several LANs located inside the campus, typically inside a
University or College, is called Campus Area Network
(CAN).
(iv) MAN - Metropolitan Area Network: A network larger
than a LAN, running across several buildings in a
geographical area (or a small city) is called Metropolitan
Area Network (MAN)
(v) WAN - Wide Area Network: The network spread over a
large area, interconnecting several LANs and MANs is
called Wide Area Network (WAN).
Networking hardware
(i) Gateway: Gateway converts speeds, protocols and
speeds between heterogeneous networks.
(ii) Router: Router forwards data packets to other routers.
Each router commands the traffic between different
networks.
(iii) Hub: Hub transmits data between computers connected in
a LAN. Hub simply receives a data packet and forwards the
data to all other computers connected to the network,
whether the data is addressed to a computer or not. Hub
results in inefficient data transmission.
(iv) Switch: Switch is a device which transmits data received
from one node to just those computers which are meant
to receive the data. It results in efficient data
transmission.
(v) Bridge: Bridge is a device which connects several
networking segments.
(vi) Repeater: Repeater receives a signal which is weak and
transmits the same at full energy to increase the range of
Networking
hardware

Figure: Networking hardware


[71]
Networking
cables
(i) Unshielded Twisted Pair (UTP) Cable: 4 pairs of cables
twisted together and usually connected through RJ45 is
called twisted pair. CAT 5e and CAT 6 cables are common
twisted pair cables.
(ii) Shielded Twisted Pair (STP) Cable: When each cable of
twisted pair is individually shielded using metal foil and the
entire set of cables is collectively shielded, the cable is
called shielded twisted pair. This type of cable is less
susceptible to electromagnetic interferences.
(iii) Coaxial Cable: A copper core surrounded by plastic
insulation and a metal hood is called coaxial cable.
Provides fast data transmission and long range.
(iv) Fiber Optic Cable: Glass fibre core surrounded by plastic
insulation and a metal core is called fire optic cable. It
provides very high speed, very long range and very low loss
of energy during transmission. Fibre optic cable is not
affected by electromagnetic disturbances.
Networking
cables

Figure: Unshielded and Shielded twisted pair


[72]

Figure: Coaxial cable


[73]

Figure: Coaxial cable


[74]
Wireless communication
(i) NFC - Near Field Communication: It works between
two mobile devices when gently touching each other. Used
for payment at PoS and pairing of bluetooth devices.
(ii) Bluetooth: Bluetooth is a wireless communication
technology with connection range of 40m to 400m
under bluetooth version 4.
(iii) WiFi - Wireless Fidelity: WiFi is a technology for fast
data transmission within a range of 100m. Mobile devices
have to pair to a WiFi hotspot to enable data transmission.
Ethernet

▶ Ethernet provides a unique physical address to the


computer or any connected device.
▶ The physical address in ethernet (RJ-45 port) is called
Media Access Control (MAC) address.
▶ When a computer joins a network, the MAC address is
linked to an Internet Protocol (IP) address.
▶ The MAC to IP mapping lasts till the termination
of connection.
▶ Data communication over the network is governed by
the Open System Interconnection (OSI) 7 layer model.
OSI 7 layer
model

Figure: OSI 7 layer model


[75]
Network
protocols
▶ Protocol is a set of rules for transmission of data across
the network and communication between client and server.
▶ IP: Internet Protocol (IP) is the procedure used for
transmission of data by routing of data packets from one
host to another. Each host connected to a network is
assigned a unique ID called IP Address.
▶ TCP/IP: Transmission Control Protocol (TCP) over Internet
Protocol (IP): TCP divides large data into smaller packets,
assigns sequence number to the packet, transmits the data
through IP layer, received the packets at the remote host,
receives acknowledgement from the remote host, allows
reassembling of data packets at the remote host. TCP is an
error free protocol for transmission of data. It is a bit slow
compared to User Datagram Protocol. TCP requires a
dedicated connection.
Network
protocols
▶ UDP/IP: User Datagram Protocol (UDP) over Internet
Protocol (IP) divides data packets into smaller packets. UDP
packets, called datagram packets, are transmitted over the IP
network. UDP applies checksums to verify integrity of data
packets. But, it does not care to verify whether all data
packets were received by the remote host. UDP is fast but
unreliable. UDP is adopted by streaming audio and
streaming video channels on the Internet. UDP is not
suitable for financial accounting applications like core
banking (where reliability is required).
▶ Telnet: Telnet is a protocol working on of TCP/IP to login
and control a remote computer over the Internet. Telnet
works on port number 23. It permits logging in to a
computer through the Internet.
Network
protocols
▶ File Transfer Protocol (FTP): File Transfer Protocol (FTP)
helps in the transfer of large files between local and remote
hosts over the Internet. Port number 21 is used for FTP
control sequences and port number 20 is used for data
transfer.
▶ Simple Mail Transfer Protocol (FTP): Simple Mail
Transfer Protocol (FTP) is used for transfer of email
between local host and remote host. Port number 25 is used
SMTP. The Interim Mail Access Protocol (IMAP) uses port
number 143, Post Office Protocol version 2 (POP2) uses
port 109 and POP3 uses port number 110. Email
transmission over Secure Socket Layer (SSL) uses port
number 993.
Logical and physical addresses

▶ Logical address is the IP address assigned to a host when it


is connected to a network.
▶ Physical address is the address of the networking
hardware (like ethernet adapter). It is also called the
Media Access Control (MAC) address.
▶ The mapping of a logical address to a physical address
is called address binding.
Dynamic Host Configuration Protocol (DHCP)

▶ When a Local Area Network (LAN) is implemented, each


new host connected to a LAN requires a unique IP address.
▶ Instead of assigning a static IP address to each host,
the DHCP assigns a new IP for each connected host.
▶ DHCP claims back unused IP addresses and reuses the
address, thus leading to efficient use of the addressing
system.
▶ DHCP maintains a free pool of assignable IP addresses
for new hosts connected to the network.
Internet
▶ The global network of networks is called Internet.

▶ Internet supports several modes of data exchange, like


Hyper Text Transfer Protocol (HTTP), Hyper Text Transfer
Protocol over Secure Socket Layer (HTTPS), File Transfer
Protocol (FTP), Simple Mail Transfer Protocol (SMTP),
Voice Over Internet Protocol (VOIP), etc.
▶ Internet supports many communication protocols like TCP/IP
and UDP/IP.
▶ Internet originated through a United States
Government project called ARPANET (Advanced
Research Projects Agency Network) created in 1969.
▶ All nodes connected to the Internet share the
Internet Protocol (IP).
▶ Internet works on the principle of Packet Switching,
which means information packets are transmitted and
Introduction to WWW
▶ The WWW (World Wide Web) is governed by W3C (World
Wide Web Consortium).
▶ WWW works through Hyper Text Transfer Protocol (HTTP)
and Hyper Text Transfer Protocol over Secure Socket Layer
(HTTPS) on top of the TCP/IP protocol stack.
▶ Web pages are created using Hyper Text Markup
Language (HTML).
▶ WWW was invented by Tim Berners Lee at the CERN
labs, Geneva.
▶ Hyper text helps to create navigational links called hyper
links.
▶ Each web address is called a URL (Uniform Resource
Locator).
Web browser

▶ Web browser receives data from a web server and renders


the same on the screen of the client machine.
▶ First web browser was called WorldWideWeb and was
created by Tim Berners Lee.
▶ Most popular web browsers are Firefox, Google
Chrome, Opera, Microsoft Edge, Apple Safari, etc.
▶ Browsers like Netscape navigator, Internet Explorer are
dead for all practical purposes.
▶ Web browser essentially renders the text, images, video
and animations from a web page.
▶ The address bar of the web browser can be opened using
the shortcut Ctrl+L.
▶ Normally, pressing Ctrl+S saves the web page, Ctrl+P
Internet server and search
engine
▶ Internet server is a software that sends pages
requested through URL.
▶ The data sent by the web server is rendered by the
web browser.
▶ Web server usually runs on port number 80 (HTTP) and
port number 443 (HTTPS).
▶ Apache web server is the most popular open source
web server.
▶ Microsoft IIS (Internet Information Server), nginx, GWS
(Google Web Server), etc. are some of the most
common, commercially supported web servers.
▶ At hardware level, a computer hardware that helps the
running of web server software is also called a web
Domain Name System (DNS)

▶ Domain Name System (DNS) is the convention used


for naming URL.
▶ Different components of URL are separated by dot (.).

▶ The URL labels identify the owner of the domain (e.g.,


google, yahoo, rediff, microsoft, etc.), the type of
organization (e.g., .com for commercial ventures, .edu for
educational Institutions, .org for organizations, .in for Indian
domains, etc.)
▶ Domain names are mapped to an IPV4 or IPV6 address.

▶ Address Resolution Protocol (ARP) is used by servers


which take human readable address and send back IP
address.
▶ Reverse Address Resolution Protocol (RARP) is used by
Email
▶ The system for electronic transmission of text and
documents over a network from the sender to recipient is
called email.
▶ Email servers use port numbers 25 - SMTP (Simple Mail
Transfer Protocol), 109 - POP2 (Post Office Protocol 2), 110
- POP3 (Post Office Protocol 3), 993 - IMAP (Internet
Message Access Protocol).
▶ Email clients have made it possible to access mailing
system from the browser or dedicated client programs.
▶ Email messages are fast in message delivery.

▶ the most popular email servers are gmail.com,


yahoo.com, rediff.com, rediffmail.com, ymail.com,
icloud.com, hotmail.com, etc.
▶ Corporate companies have their own email servers with
their own domains.
Video chat tool

▶ Video chat tools help in sharing of live video between


the caller and the receiver.
▶ Video chat tools like Viber, Skype, Facebook Messenger,
Google Hangouts, Instagram, etc. are widely used.
▶ Video calling facility works through data streaming over
the Internet.
Voice Over IP (VOIP)

▶ Voice Over Internet Protocol (VOIP) is a system for


making audio calls over the Internet.
▶ VOIP clients bind to the mobile number of the user.

▶ When VOIP call is made, the recipient cannot distinguish


the call from a GSM (Global System for Mobile
communication) call.
▶ VOIP streams audio over the Internet and uses the
mobile number of the caller as the identifier.
Social media networking
▶ Social media permits sharing of casual, usually
non-commercial information with one or several other
persons.
▶ Social media permits sharing of photos, videos, text
messages, etc. over the Internet.
▶ Social media websites like Facebook, Twitter, LinkedIn
Instagram, Skype, Hangouts, WhatsApp, Telegram, etc.
are some of the most popular social media platforms.
▶ Social media encourages sharing of personal information
and getting appreciation from the recipients.
▶ Social media has become one of the necessary evils of
the modern society.
▶ Many modern day crimes relate to extracting
information from innocent youngsters and women and
using the same information for blackmailing the
Syllabus
Concepts of Static and Dynamic Web pages. Introduction
to HTML and various tags in HTML. Creating Forms with
controls using HTML. Concepts of CSS and applying CSS
to HTML Introduction to open source CMS viz,. Joomla,
Wordpress, etc. and web authoring tools viz.
Kompozer,FrontPage etc.
Static web
pages
▶ Web pages which provide fixed content in the form of text,
images and video without any user interaction are called
static web pages.
▶ Web pages which interact with the user and provide based
on the actions of the user are called dynamic web pages.
▶ Static web pages use HTML (Hyper Text Markup
Language).
Dynamic web
pages
▶ Dynamic web page is created by scripts which result
in dynamic content based on the interaction of the
user.
▶ Dynamic web pages can be created by:
(i) Server side script: Script stored in the server and written
in languages like PHP, Perl, Python, ASP.NET, etc. is called
server side script. Server side scripts are useful for data
storage, data retrieval, storing photos received from forms,
authentication of login, managing session, etc.
(ii) Client side script: Script written in languages like
JavaScript, VBScript, etc. and running inside a browser
(or the client) is called client side script. Client side scripts
are suitable for error checking in forms and
dynamic interaction using mouse or keyboard.

▶ A combination of client side and server side scripting


will render a web page highly attractive and useful.
HTML tags
All HTML tags have a corresponding closing tag. Some tags
might not have a closing tag with end with / > symbol.
▶ HTML: All HTML files begin with <HTML> and end with
< /HTML>.
▶ HEAD: The title and meta information of a HTML file
are entered inside a pair of <HEAD> and < /HTML>
tags.
▶ TITLE: Title of the document is enclosed inside a pair of
<TITLE> and < /TITLE> tags.
▶ BODY: All contents of the HTML file are enclosed inside a
<BODY> and < /BODY>.
▶ H1 to H6: Defines various levels of headings from level 1
to level 6.
▶ TABLE: Table tag encloses a table. It has border option
HTML tags

▶ INPUT: Input tag can have several type options (like text,
date, email, number, etc.), a name, an ID and other
attributes like readonly if necessary.
▶ SELECT Select tag displays a combo box with various
options enclosed inside OPTION tags. Each option
would have a value property.
▶ OL: Ordered list. Each list item is defined by LI tag.

▶ UL: Un-ordered list. Each list item is defined by LI tag.

▶ textbfFORM: The contents enclosed inside a FORM tag


can be submitted to a server side script for data storage
and be accessed by a client side script for validation of
input. It has options for ACTION, METHOD (POST or
GET), etc.
▶ SUBMIT: Submit button completes form data entry
HTML tags

▶ BUTTON: Displays a button with specified name, text and


ID.
▶ A: Anchor tag for hyper text linking. HREF option takes
the URL to be loaded when the link is clicked.
▶ B: BOLD tag.

▶ FONT: specifies name, color and size for font.

▶ IMG: IMS tag loads an image specified by the SRC option.

▶ CENTER: Centre aligns text and objects.

▶ SPAN: A place holder with an ID and name.

▶ MARQUEE: Marquee tag displays scrolling message, as


seen at the bottom of television display.
Special characters in HTML

Table: Special characters in HTML

code char code char code char code char


&quot; ” &num; # &dollar; $ &percnt; %
&amp; & &apos; ’ &lpar; ( &rpar; )
&ast; * &plus; + &comma; , &minus; -
&period; . &sol; / &colon; : &semi; ;
&lt; < &equals; = &gt; > &quest; ?
&commat; @ &lsqb; [ &bsol; \ &rsqb; ]
&Hat; ˆ &lowbar; &grave; ‘ &lcub; {
&rcub; } &verbar; — &tilde; ∼ &alpha; α
&beta; β &gamma; γ &delta; δ &pi; π
&theta; θ &phi; ϕ &psi; ψ &omega; ω
Creating HTML
pages
▶ HTML pages can be edited using text editor (notepad,
gedit, etc.) or can be edited using specialized tools like
Dreamweaver, Komposer, etc.
▶ The HTML files should be previewed in a browser
(like Firefox, Google Chrome, Edge, Safari, Opera,
etc.).
▶ Firefox browser provides a debugging tool to spot
errors through Developer Console (shortcut:
Ctrl+Shift+K).
▶ Some of the special characters used in HTML are tabulated
in Table 7.
▶ Sample HTML pages and their results are presented in
the following subsections.
Static information
page
<html>
<head>
<title>
My Intro Page
</title>
<style>
p{
text-align:justify;
font-size:240%;
font-style:bold;
font-weight:bold;
color:blue;
text-
indent:10mm
}
</style>
</head>
<body>
<h1 style=”color:red; text-align:center;font-size:300%”>
Welcome to my introduction page: Your name
</h1>
<p>
My name is .... I am studying COPA trade in Govt. ITI for Women, Puducherry. I am preparing for first semester
examination. The examination starts on 29-Jan-2018.
</p>
<p>
The second semester starts on 01-02-2018.
</p>
</body>
</html>
Figure: Intro page in HTML
Creating ordered and unordered lists
<html>
<head>
<title>
List of computer peripherals
</title>
<style>
h1{text-align:center; color:blue}
ol {font-size:120%; color:red}
</style>
</head>
<body>
<h1>List of computer
peripherals</h1>
<ol>
<li>Monitor</li>
<li>Keyboard</li>
<li>Mouse</li>
<li>Printer
<ul>
<li>Line matrix printer</li>
<li>Daisy wheel printer</li>
<li>Golf ball printer</li>
<li>Dot matrix printer</li>
<li>Inkjet printer</li>
<li>LASER printer</li>
<li>Thermal printer</li>
<li>Dot matrix printer</li>
</ul>
</li>
<li>Scanner</li>
</ol>
</body>
</html>
Figure: List page in HTML
Creating
table
<html>
<head>
<title>Ice creams</title>
<style>
h1{color:green; text-align:center}
th {vertical-align:middle; text-align-centre; font-weight:bold; background:lightgreen; color:red; font-size:120%}
#odd {vertical-align:middle; text-align-centre; font-weight:normal; background:#FFBBBB; color:blue;
font-size:120%}
#even {vertical-align:middle; text-align-centre; font-weight:normal; background:#BBBBFF; color:red;
font-size:120%}
</style>
</head>
<body>
<h1>Types of ice cream (<your name>)</h1>
<span align=”center”>
<table border=1>
<tr><th>Sl. No.</th><th>Name</th><th>Cream</th><th>Rate</th></tr>
<tr id=”odd”><td>1</td><td>Dessert</td><td><img width=20%
src=”ice-creams/01-dessert.jpg”></td><td>Rs.120/-</td></tr>
<tr id=”even”><td>2</td><td>Cone</td><td><img width=20%
src=”ice-creams/02-cone.jpg”></td><td>Rs.60/-</td></tr>
<tr id=”odd”><td>1</td><td>Chocolate</td><td><img width=20%
src=”ice-creams/03-chaco.jpg”></td><td>Rs.90/-</td></tr>
<tr id=”even”><td>4</td><td>Cone</td><td><img width=20%
src=”ice-creams/04-strawberry.jpg”></td><td>Rs.100/-</td></tr>
</table>
</span>
</body>
</html>
Figure: Table page in HTML
Cascading Style Sheet (CSS)

▶ A text file containing style properties is called Cascading


Style Sheet (CSS).
▶ CSS defines how

▶ The cascading sheet sheet can be linked to a HTML file


at the header section.
▶ The following tag helps to insert a CSS sheet:
<link rel=”stylesheet” type=”text/css”
href=”<style-sheet>.css”>
▶ The following subsection shows the appearance of HTML
file with different CSS linkages.
▶ Styles may be specified in any one of the following methods:
(a) Inline style: Specifying style just inside the tag is called
inline style specification. e.g., <h1
style=”color:#FF0000;text- align:center;background-
Red color theme with style
sheet
<html>
<head>
<title>Red style</title>
<link rel=”stylesheet” type=”text/css” href=”red.css”>
</had>
<body>
<h1>Ridge TV Channel</h1>
<marquee>
Breaking news
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
Nothing new under the Sun!
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
Keep your cool!!
</marquee>
</body>
</html>
Red color theme with style
sheet
body {
background-color: #222277;
font-size: 300%;
color: #FF0000
}
h1 {
color: #FF0000;
text-align: center
}
marquee {
background-
color: #0000FF
}
Green color theme with style
sheet
<html>
<head>
<title>Green style</title>
<link rel=”stylesheet” type=”text/css” href=”green.css”>
</had>
<body>
<h1>Ridge TV Channel</h1>
<marquee>
Breaking news
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
Nothing new under the Sun!
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
Keep your cool!!
</marquee>
</body>
</html>
Green color theme with style
sheet
The green.css file is shown
below: body {
background-color: #222266;
font-size: 300%;
color: #00FF00
}
h1 {
color: #00FF00;
text-align: center
}
marquee {
background-
color: #0000FF
}
CSS Property elements
1 align-content: Align content to left, right or center.
2 background: Specifies background color (Color is specified
in #000000 (black) #FFFFFF (white). First 2 digits
represent red, second 2 digits represent green and third 2
digits represent blue. Each digit can change from 0 to F
under hexadecimal system).
3 background-color: Specifies background color (Color is
specified in #000000 (black) #FFFFFF (white). First 2
digits represent red, second 2 digits represent green and
third 2 digits represent blue. Each digit can change from 0
to F under hexadecimal system).
4 border: size, type (solid, dotted, dashed, double dashed)
and color of border.
5 color: Color of element.
6 font-style: Font style may be italic, normal, oblique.
7 font-weight: may be normal, bold, bolder, lighter
(number 400 is normal, 700 is bold).
8 font-size: Font size may be specified in pixels (e.g.,
Creating HTML
forms
▶ Forms begin with the <form> tag and end with </form>
tag.
▶ Action property of form refers to the URL to be invoked
when the form is submitted.
▶ Method property of form submission may be GET or POST.

▶ Input type of ”submit” may be used to submit data to


the specified action URL.
▶ Input type of ”reset” may be used for clearing all changes
to the form.
▶ Some simple forms to calculate sum, difference,
product, quotient, age and power are presented in the
following sections.
HTML form for greeting
HTML form to greet a person is presented in the following
HTML code:
<html>
<head>
<title>Enter your name</title>
<link rel=”stylesheet” type=”text/css” href=”red.css”>
</head>
<body>
<h1>Name form</h1>
<form name=”nameForm” action=”#” method=”POST”>
<center>
<table border=0>
<tr><td>Name</td><td>:</td><td><input type=”text” name=”n”
placeholder=”Name”></td></tr>
</table>
<input type=”submit” value=”Greeting” onClick=”alert(’Welcome
’+n.value)”>
</center>
</form>
</body>
</html>
HTML form for addition
HTML form to add 2 numbers:
<html>
<head>
<title>Add numbers</title>
<link rel=”stylesheet” type=”text/css” href=”red.css”>
</head>
<body>
<h1>Add form</h1>
<form name=”addForm” action=”#” method=”POST”>
<center>
<table border=0>
<tr><td>Enter x</td><td>:</td><td><input type=”text” name=”x”></td></tr>
<tr><td>Enter y</td><td>:</td><td><input type=”text” name=”y”></td></tr>
<tr><td colspan=3 style=”text-align:center”><input type=”button” value=”Add” onClick=”z.value =
Number(x.value) + Number(y.value)”></td></tr>
<tr><td>Result</td><td>:</td><td><input type=”text” name=”z” readonly></td></tr>
</table>
</center>
</form>
</body>
</html>
HTML form for subtraction
HTML form to subtract a number from another numbers:
<html>
<head>
<title>Subtract numbers</title>
<link rel=”stylesheet” type=”text/css” href=”red.css”>
</head>
<body>
<h1>Subtract form</h1>
<form name=”subForm” action=”#” method=”POST”>
<center>
<table border=0>
<tr><td>Enter x</td><td>:</td><td><input type=”text” name=”x”></td></tr>
<tr><td>Enter y</td><td>:</td><td><input type=”text” name=”y”></td></tr>
<tr><td colspan=3 style=”text-align:center”><input type=”button” value=”Subtract” onClick=”z.value =
Number(x.value) - Number(y.value)”></td></tr>
<tr><td>Result</td><td>:</td><td><input type=”text” name=”z” readonly></td></tr>
</table>
</center>
</form>
</body>
</html>
HTML form for multiplication
HTML form to multiply 2 numbers:
<html>
<head>
<title>Multiplication form</title>
<link rel=”stylesheet” type=”text/css” href=”red.css”>
</head>
<body>
<h1>Multiply form</h1>
<form name=”mulForm” action=”#” method=”POST”>
<center>
<table border=0>
<tr><td>Enter x</td><td>:</td><td><input type=”text” name=”x”></td></tr>
<tr><td>Enter y</td><td>:</td><td><input type=”text” name=”y”></td></tr>
<tr><td colspan=3 style=”text-align:center”><input type=”button” value=”Multiply” onClick=”z.value =
Number(x.value) * Number(y.value)”></td></tr>
<tr><td>Result</td><td>:</td><td><input type=”text” name=”z” readonly></td></tr>
</table>
</center>
</form>
</body>
</html>
HTML form for division
HTML form to divide a number by another numbers:
<html>
<head>
<title>Division of numbers</title>
<link rel=”stylesheet” type=”text/css” href=”red.css”>
</head>
<body>
<h1>Division form</h1>
<form name=”divForm” action=”#” method=”POST”>
<center>
<table border=0>
<tr><td>Enter x</td><td>:</td><td><input type=”text” name=”x”></td></tr>
<tr><td>Enter y</td><td>:</td><td><input type=”text” name=”y”></td></tr>
<tr><td colspan=3 style=”text-align:center”><input type=”button” value=”Divide” onClick=”z.value =
Number(x.value) / Number(y.value)”></td></tr>
<tr><td>Result</td><td>:</td><td><input type=”text” name=”z” readonly></td></tr>
</table>
</center>
</form>
</body>
</html>
HTML form to calculate
ageHTML form to calculate age:
<html>
<head>
<title>Age calculation</title>
<link rel=”stylesheet” type=”text/css” href=”green.css”>
</head>
<body>
<h1>Age calculation</h1>
<form name=”ageForm” action=”#” method=”POST”>
<center>
<table border=0>
<tr><td>Enter DOB</td><td>:</td><td><input type=”date” name=”dob”></td></tr>
<tr><td colspan=3 style=”text-align:center”><input type=”button” value=”Age” onClick=”res.value = (new
Date(Date.now() - new Date(dob.value).getTime()).getUTCFullYear()-1970)”></td></tr>
<tr><td>Age</td><td>:</td><td><input type=”text” name=”res” readonly></td></tr>
</table>
</center>
</form>
</body>
</html>
HTML form to calculate power of a
number
HTML form to calculate power of a number:
<html>
<head>
<title>Power</title>
<link rel=”stylesheet” type=”text/css” href=”green.css”>
</head>
<body>
<h1>Power form</h1>
<form name=”powForm” action=”pow.php” method=”POST”>
<center>
<table border=0>
<tr><td>Enter x</td><td>:</td><td><input type=”text” name=”x”></td></tr>
<tr><td>Enter y</td><td>:</td><td><input type=”text” name=”y”></td></tr>
<tr><td colspan=3 style=”text-align:center”><input type=”submit” value=”Power”> <input type=”reset”
value=”Reset”> </td></tr>
</table>
</center>
</form>
</body>
</html>
PHP script to calculate power of a
number
PHP script to calculate power of a
number:
<?php
$x = $ POST[’x’];
$y = $ POST[’y’];
$z = pow($x, $y);
echo $x . ” ˆ” . $y . ” = ” . $z;
?>
Syllabus
Introduction to Web Servers and their features. Introduction
to Programming and Scripting Languages. Introduction to
JavaScript and its application for the web. JavaScript Basics
– Data types, Variables, Constants. Conversion between data
types. The Arithmetic, Comparison, Logical and String
Operators in JavaScript. Operator precedence. Arrays in
JavaScript – concepts, types and usage. Program Control
Statements and loops in JavaScript. Introduction to
Functions in JavaScript. Built in JavaScript functions
overview. The String data type in JavaScript. Introduction to
String, Math and Date Functions. Concepts of Pop Up boxes
in JavaScript. Introduction to the Document Object Model.
Concepts of using Animation and multimedia files in
JavaScript.
Algorithms
1) The sequence steps taken to solve a problem is called
an algorithm.
2) Algorithm helps to create computer program for
problem solving.
Flowcharts
1) Graphical representation of the step by step solution of
a problem is called flowchart.
2) Flowchart symbols and their purposes are given below:

1 Oval Start or End of flowchart.


Connector - Indicates
2 Circle flowchart continues where
a matching name or num-
ber is found.
3 Arrow Indicates flow direction.

4 / / / / Parallelogram Input or output.

5 Rectangle Processing

/ / Decision making (condi-


6 Rhombus tions - if/ switch, loops -
Introduction to web
servers
1 Web server sends HTML pages in response to request
from client. Web server uses Hyper Text Transfer Protocol
(HTTP).
2 Web server uses port number 80 for general data
exchange and port number 443 for data exchange over
Secure Socket Layer (SSL).
3 Scripts executed by the webserver are called server side
scripts.
4 PHP, Perl, Python and ASP.NET are some of the
programming languages used for server side
scripting.
5 Some scripts embedded in HTML pages are executed by the
browser. The scripts executed on browser are called client
side scripts.
6 Javascript and VBScript are some of the most common
client side scripting languages.
7 Microsoft Internet Information Server (IIS), Apache httpd,
Features of web
server
1 Port numbers 80 and 443 are used by web servers.
2 Web address is called Uniform Resource Locator (URL).
3 URL parts are separated by forward slash (/) symbol.
4 If a URL begins with http:// the communication takes
place on port number 80 and it is unsecure.
5 If a URL begins with https:// the communication takes
place on port number 443. Secure Socket Layer (SSL)
protocol is used to prevent data intrusion.
6 The last part of a web URL is the name of the file.
7 A folder named ‘htdocs’ or ‘wwwroot’ serves as the
root directory of the web server.
Compiler based programming languages
1 The human readable program is called source code.
2 A special program called compiler converts the source code
to machine readable binary code.
3 A source code should follow certain formatting details,
called syntax, if the program should be successfully
compiled.
4 Compiler detects errors and converts/ translates the code
only if the entire program has correct syntax.
5 Since compilation is done only once, the time spent on
removing syntax and logical errors (called debugging)
does not affect the time required for running on a
computer.
6 After compilation, machine code runs very fast on a
computer.
7 Assembly language, C, C++, Java, C#, etc. are some of
the most popular compiled languages.
Interpreter based programming languages
1 Interpreter is a special program to translate few lines of
source code, load it to the processor based on program flow.
2 Interpreted programs are slower than compiled programs.
3 Interpreted programming languages enforce liberal syntax
(they forgive some deviations) and have less stringent
data types.
4 Interpreted programs are easier and faster to develop for
small projects.
5 The liberal nature of interpreted programming
languages permits more errors and more complications
for large programs.
6 A class of languages suitable for embedding inside a
larger program are called scripting languages.
7 Javascript, Perl, Python, Unix/Linux shell script, etc.
are some of the most popular scripting languages.
Javascript
1 Javascript loosely follows the syntax of Java
programming language.
2 Javascript is embedded inside HTML code.
3 A Javascript function is embedded inside a pair of
< script > < /script > tags.
4 The script tag begins with one or both of the
following attributes: type=”text/javascript” and
language=”javascript”.
5 Javascript can be used as a procedural language (only
functions are permitted) or as an Object oriented
language (new data types called classes are permitted).
6 Each line of Javascript code ends with a semi-colon (;),
unless it begins a new block using curly brace({).
7 Javascript runs inside a browser.
8 Script can be written within the HTML file itself or in
an external file (with .js extension).
9 External script file (say welcome.js) may be embedded
using src attribute of script tag
Comments in Javascript
1 Comments in Javascript can cover single line or multiple
lines.
2 Single line comments start with / / symbol and run till the
end of the line in which it is placed. For example,
x*=2; //current value of x is doubled.
//The following code calcualtes age of a person.
are examples of single line comment.
3 Multiple line comment starts with /∗ and ends only when ∗/
is found. For example,
/∗
The following lines are ignored by the
browser. x+=5;
y=Math.pow(x,2);
∗/
is an example of multi-line comment.
5 Commented portions are ignored by the
browser.
Application of Javascript for
web
1 Javascript can be embedded in HTML code.
2 Support for Javascript is available in all the modern
web browsers.
3 Javascript methods can be easily invoked through
onClick property of a button.
4 Javascript can be used to dynamically interact with the
user of a web page.
5 Since Javascript is executed inside a browser, the danger
of malware spreading to the system through the script is
very low.
Data types in Javascript
1 Javascript supports the following primitive (basic level)
data types:

Sl. No. Primitive type Description


A sequence of characters is called a String. e.g., ”
1 String
It is enclosed in double quotes.
Any numerical value, whether integer or floating po
2 Number
Number.e.g. 3, 6.23.
3 Boolean Contains the result of a logical expression. e.g.,
true
4 Undefined When a variable is undeclared, it is categorized as
und
5 NULL It signifies the absence of any specific value.
Data types in Javascript
2 Javascript supports non-primitive data types called
Object (reference type objects).

Sl. No. Non-Primitive Description


Represents the basic reference type. New data ty
1 Object
Javascript may be defined using function itself.
Array represents a collection of indexed values.
2 Array var num=new Array(”Zero”,”One”, ”Two”, ” T
alert(num[2]); displays Two in the alert dialog.
3 RegExp Regular expression used for manipulation of strings.
Variables and constants in Javascript
1 A variable represents a memory location in which values
can be stored and retrieved.
2 Javascript variable names must start with alphabets (A-Z
or a-z) or underscore ( ) or dollar symbol ($).
3 Numbers can be used in variable names anywhere except
the first location.
4 Variable declaration starts with the keyword var . e.g., var
$x=1,y=3, z;
5 Javascript variables are case sensitive. i.e., var a=10,
A=20; declares two different variables named a and A.
6 A variable declared outside the scope of any function is
called a global variable.
7 If a declaration starts with the keyword const instead of
var , the variable so declared can be assigned a value only
once. e.g., const PI=3.14159625; will make PI a constant.
New values assigned to it (like PI=1;) will fail.
Conversion between data
types1 Data of any type (e.g. ”25.67”) can be converted to
number using the Number() function (e.g.,
x=Number(”25.67”);)
2 Data of any type can be converted to String using
String()
function (e.g. str=String(23.23);).
3 Data of any type can be converted to Boolean type (true
or false) using Boolean() function.
4 The typeof operator helps to determine the data type of
a variable. e.g.,
var name=”Desiga”, mark=95; alert(typeof name);
alert(typeof mark);
displays String and Number as the data types
respectively.
5 NaN is a special number which indicates a value too large
for storage in number type (like ∞).
6 null is another data type stored in a variable when there is
Arithmetic Operators in Javascript
1 Javascript provides operators for basic operations
like Division, Multiplication, Addition, Subtraction,
etc.

Table: List of arithmetic operators in Javascript


Airthmeti c
Sl. Example
Opera- Purpose Preceden
No.
tor
1 ∗∗ Exponentiation x = 10/2; / / x value is 2. 1
2 ∗ Multiplication x = 10 ∗ 2; / / x value is 20. 2
3 / Division x = 10/2; / / x value is 2. 3
4 % Modulo Re- x = 10%4; / / x value is 2. 4
mainder
5 + Addition x = 10 + 2; / / x value is 12. 5
6 − Subtraction x = 10 − 2; / / x value is 8. 6
7 ++ Increment x = 10; x + +; / / x value is 11. 7
8 −− Decrement x = 10; x − −; / / x value is 9. 8
Assignment Operators in Javascript
1 Javascript provides assignment operators to assign the
results of mathematical expression to variables.

Table: List of assignment operators in Javascript

Assignme nt
Sl. Example
Opera- Purpose Precedence
No.
tor
1 = Assignment x = 10; / / x value is 10. 1
Add and As- x = 10; x + = 4; / / x value is 2
2 +=
sign 14.
Subtract x = 10; x− = 4; / / x value is 3
3 −= and 6.
Assign
Multiply x = 10; x∗ = 4; / / x value is 4
4 ∗= and 40.
Assign
Take x = 2; x ∗∗ = 4; / / x value is
5 ∗∗ = power 16 (∵ 24 = 2x 2x 2x 2 = 16). 5
and Assign
Divide and As-
Comparison operators in Javascript
1 Comparison operators compare the left and right side results based
on Boolean logic (true or false) results. List of comparison
operators is shown in Table 10.

Table: Comparison operators in Javascript

Sl. Operator Purpose


No.
Equal to (ignore data type. e.g., ”20”==20 gives
1 == true as the result, since data types are not consid-
ered.)
Equal to (compare data type and value. ”20” ===
2 ===
20 is false.)
3 != Not equal to. Ignore data type.
Not equal to. Gives true result only when the data
4 ! ==
type and value are identical.
5 > Greater than.
6 >= Greater than or equal to.
7 < Less than.
8 <= Less than or equal to.
Logical operators in Javascript
1 Logical operators help to combine the results of several
logical operations (AND, OR, NOT, etc.) based on Boolean
logic.
Table 11 shows the logical operators used in Javascript.

Table: Logical operators in Javascript


Sl.
No. Operator Purpose
1 && Logical AND.
2 ∥∥ Logical OR.)
3 ! Logical NOT operator (Negation).
Special operators in Javascript
1 Following are some of the uncategorized, but
important operators used in Javascript (Table 12).

Table: Special operators in Javascript

Sl.
No. Operator Purpose
1 typeof Returns the data type of a variable.
2 new Creates a new object.
Evaluates the logical expression to the left of ?.
Executes left side of : if it is true, right side of
3 ? : ternary : otherwise. e.g., var x = 2; y = (x ! = 2)?5
: 8; sets y value to 8, since the logical
expression is false.
Checks whether a variable belongs to particular
4 instanceof
data type.
Takes a value from an array.
5 in Used
String operators in Javascript
1 String class supports assignment and string
concatenation operators (Table 13).

Table: String operators in Javascript

Sl.
No. Operator Purpose
Assigns string value on the right side to
1 = a variable on the left side. e.g.,
var name=”Gayathri”.
Adds 2 strings together. var x=”COPA”, y=”
2 + is great.”; var z=x+y; sets ”COPA is great.”
as the value in z.
Appends the string on right side to the
variable
3 += on left side. e.g., var x=”Sun”, y = ” is the
near- est star.”; x+=y; sets ”Sun is the
nearest star.” in variable x .
Arrays in Javascript
1 Array is a collection of values in a single variable.
2 Array elements are numbered from 0 (0,1,2,3,...).
3 Each element of an array may be accessed using []. e.g.
x = {3, 5, 2, 10}; alert(x [1]); displays 5.
4 In a for loop, elements of array may be accessed using
index values (0 to n) or using in operator. e.g.,
x={3,5,2,10};
for(var i=0;i<x.length; i++)
alert(x[i]);
and
x={3,5,2,10};
for(var y in x)
alert(x[y]);
display all the
elements
array x .
5 Array may be declared using a pair of { } or new Array
Associative arrays in Javascript
1 Instead of accessing array elements using a numeric index, it
is possible to permit some name to each element.
2 Such an array having a name for index is called an
associative array or hash map.
3 An associative array may be declared in any one of
the following styles:
var x={’Tamil’:92,’English’:80, ’Maths’:83, ’Science’:87,
’Social Science’:81};
or
var x= new Array(’Tamil’:92,’English’:80, ’Maths’:83,
’Science’:87, ’Social Science’:81);
4 Left side of an associative array or hash is called key and
the right side is called value. e.g., in array x , ’Maths’ is key
and 83 is value.
5 Elements of associative arrays are accessed using the key.
e.g.,
′ ′
Control statements in Javascript
1 Control statements help in conditional execution of
portions of code.
2 Conditional controls may be imposed
using (i)if...else condition,
(ii)switch ... case ...break condition,
or (iii)ternary operator (?:).
If ... else condition
1 The if condition contains a condition part. In case
the condition is true, the block (enclosed by a pair of
{ }) immediately following if condition is executed.
2 An if condition having a single line might omit the
pair of { }.
3 In case the if condition fails, an optional else block may
be coded. Else may also check for a condition using an if
(else if ).
4 Else block may also omit the pair of { } if the code for
it contains a single line.
Example of if condition
<html>
<head>
<title>Test of if condition</title>
<script type=”text/javascript” language=”javascript”>
function ageMessage() {
var age = this.ageForm.age.value;
if(age < 13) {
document.write(”<h1 style=’color:#FF0000’>You
are a kid </h1>”);
}
else if(age < 20) {
document.write(”<h1 style=’color:#FF0000’>You
are a teenager! </h1>”);
}
else if(age < 36)
document.write(”<h1 style=’color:#FF0000’>You are young! </h1>”);
else if(age < 50)
document.write(”<h1 style=’color:#FF0000’>You are middle aged!
</h1>”);
else
document.write(”<h1 style=’color:#FF0000’>You are old! </h1>”);
}
</script>
</head>
<body>
<form name=”ageForm”>
<center>
Enter your age: <input type=”number” name=”age”></br />
<input type=”button” value=”Get message” onClick=”ageMessage()”>
</center>
</form>
</body>
</html>
How the if condition program
works?
1 The if ladder first tests whether the age is less than 13.
In case it is correct, the message ”You are a kid!” is
displayed.
2 In case the value is the first test fails (age ¿= 13), the else
if part tests whether the age is between 13 and 19. In such
a case, the message ”You are a teenager!” loads.
3 In case the age is greater than or equal to 20, the third else
if condition checks whether the age is less than 36. If so,
the message ”You are young!” is displayed.
4 In case the age is greater than or equal to 36, the third else
if condition checks whether the age is less than 50. If so,
the message ”You are middle aged!” is displayed.
5 When all the if conditions fail, the last else is reached.
It displays the message ”You are old!”.
Switch condition
1 Switch condition takes one argument (e.g. switch(x)).
2 It checks the input against several case values (e.g., case
2:) and executes the lines following the matching case.
3 All cases, other than the last one end with break keyword.
4 The last condition may be called default :, which
handles cases not matching any of the previous ones.
<html>
<head>
<title>Test of switch condition</title>
<script type=”text/javascript” language=”javascript”>
function nameMessage() {
var name = this.nameForm.name.value;
var length=name.length;
switch(length) {
case 1:
case 2:
case 3:
case 4:
case 5:
document.write(”<h1 style=’color:#FF0000’>Very short name! </h1>”);
break;
case 6:
case 7:
case 8:
case 9:
case 10:
document.write(”<h1 style=’color:#FF0000’>Length of your name is normal! </h1>”);
break;
case 11:
document.write(”<h1 style=’color:#FF0000’>Your name is bit long! </h1>”);
break;
default:
document.write(”<h1 style=’color:#FF0000’>Your name is too long! </h1>”);
}
}
</script>
</head>
<body>
<form name=”nameForm”>
<center>
Enter your name: <input type=”text” name=”name”></br />
<input type=”button” value=”Get message” onClick=”nameMessage()”>
</center>
</form>
How the switch...case program
works?
1 The switch takes length of name as argument.
2 For cases 1, 2, 3, 4 and 5, it displays the message ”Very
short name!”.
3 For cases 6, 7, 8, 9 and 10, it displays the message ”Length
of your name is normal!”.
4 For case 11, it displays the message ”Your name is bit long!”.
5 As the default case (length > 11), it displays the
message ”Your name is too long!”.
6 Note that cases and case groups end with break.
7 The last condition (default) need not have a break.
The ternary operator (?:)
1 A simple if ... else condition may be re-written using one
liner called ternary.
2 Ternary operator has 3 parts.
3 First part of the ternary operator (to the left of ?) is
the condition. The condition may be either true or
false.
4 The second part of the ternary, placed to the right of ?
and the left of :, is executed if the condition is true.
5 The third part of the ternary, placed to the right of :,
is executed if the condition is false.
6 Consider the following lines:
x = 25;
y = (x < 21)?“Good′′ : “Bad′′;
can you guess the value of y ?
6 y has the value of “Bad”, since the condition turns out to
be false.
Example of ternary operator (?:)
<html>
<head>
<title>Test of if condition</title>
<script type=”text/javascript” language=”javascript”>
function bmiMessage() {
var wt = this.bmiForm.wt.value,
ht=this.bmiForm.ht.value/100; //Convert height from centimeter to metre.
var bmi=wt/ht/ht;
var mess=”Your BMI is ”;
mess += bmi<=20.3?”very good!”:”very high. You need exercise!”
document.getElementById(”res”).innerHTML=”<h1 color=#FF0000> ”+mess+”</h1>”;
}
</script>
</head>
<body>
<form name=”bmiForm”>
<center>
Enter weight: <input type=”number” name=”wt”></br />
Enter height in centi metre: <input type=”number” name=”ht”></br />
<input type=”button” value=”Get message” onClick=”bmiMessage()”>
<span id=”res”> </span>
</center>
</form>
</body>
</html>
Loops in Javascript
1 Javascript supports 4 types of loops:
(a) for loop with index value.
(b) for − in loop with list of array elements.
(c) while loop.
(d) do − while loop.
2 For loop having index value handle only integer
index.
1 Index value of for loop may be declared before
commencement of the loop or at the loop itself. (e.g., var i
; for (i = 0; i < 10; i + +) is equivalent to
for (var i = 0; i < 10; i + +)).
2 The for loop has 3 parts, viz., (i)initialization
part, (ii)condition part, (iii)increment part.
3 The initialization part sets the initial value of
index variable.
4 The for loop keeps running so long as the condition
part (second of the three parts) is true.
5 The increment part increases or decreases value of
variable. e.g., for (var i = 0; i < 100; i + +),
for (var i = 0; i < 100; i + = 2),
for (var i = 100; i >= 0; i − −), for (var i = 0; i < 100; +
+ i ), for (var i = 0; i < 100; i + = 10) are all valid
increments to the index variable of for loop.
6 Each of the 3 parts of for loop is separated by a
; (semi-colon).
7 One of more of the parts of for loop may be
Example of for
loop<html>
<head>
<title>
Example of for loop
</title>
</head>
<body>
<script type=”text/javascript” language=”javascript”>
var x = new Array(4,2,6,8,12,15,25), sum=0;
document.write(”Sum of ”);
for(var i=0; i<x.length; i++) {
document.write(x[i] + (i==x.length-1?” = ”:” + ”));
sum += x[i];
}
document.write(sum);
</script>
</body>
</html>
for − in loop in Javascript
1 for − in loop is used in conjunction with arrays and lists.
2 A typical for − in loop to move through the elements of an
array creates an index variable which changes value from
the first index to the last.
3 The for − in loop is a convenient replacement to for
loop having separate declaration, index limit checking
and increment parts.
Example of for − in loop
<html>
<head>
<title>
Example of for-in loop
</title>
</head>
<body>
<script type=”text/javascript” language=”javascript”>
var x = new Array(4,2,6,8,12,15,25), sum=0;
document.write(”Sum of ”);
for(var y in x) {
document.write(x[y] + ” ”);
sum += x[y];
}
document.write(” is ”+sum);
</script>
</body>
</html>
Mark statement using for − in loop and associative
array
<html>
<head>
<title>
Example of for-in loop
</title>
</head>
<body>
<script type=”text/javascript” language=”javascript”>
var x = {’Tamil’:92, ’English’:98, ’Maths’:100, ’Science’:94, ’Social’:91};
var sum=0;
document.write(”<center><h1>Mark statement</h1> <table border=1>”);
document.write(”<tr><th>Subject</th> <th>Mark</th></tr>”);
for(var y in x) {
document.write(”<tr><td>”+y+”</td><td
style=’text-align:right’>”+x[y]+”</td></tr>”);
sum += x[y];
}
document.write(”<tr><td
style=’color:#FF0000;
text-align:center’>Total</td><td
style=’color:#FF0000;
text-align:right’>”+sum+”</td></tr></table>”);
</script>
While loop in Javascript
1 While loop checks a condition. If the condition yields
true, the loop portion is executed.
2 If the loop contains only one statement, use of a pair of
curly braces ({ }) is optional.
3 If the loop contains more than one statement, the entire
loop body is enclosed in a pair of curly braces({ }).
4 Index variable of the while loop should be declared
and initialized before the while loop begins.
5 Index variable, if any, should be incremented or
decremented in a separate line within the while loop.
Example of while loop
<html>
<head>
<title>
Example of for-in loop
</title>
<script>
function table() {
var x=this.document.tabForm.n.value, y, i=1;
document.write(”<center><h1 style=’color:#FF0000’>”+x+” Table</h1><h2>”);
while(i<=10) {
y = i*x;
document.write(i+” x ”+x+” = ”+y+”<br />”);
i++
}
document.write(”</h2></center>”);
}
</script>
</head>
<body>
<center>
<form name=”tabForm” method=”GET” action=”#”>
Enter table number: <input type=”number”
name=”n”> <br />
<input type=”button” value=”Create table”
onClick=”table()”>
</form>
</center>
</body>
</html>
The do ... while loop in Javascript
1 Do ... while loop is a special loop which gets executed at
least once, because the condition is checked only at the last
statement of the loop.
2 The index variable, if any, should be declared outside the
loop.
3 The do ... while loop checks the condition at the last
line (which is a while).
Example of do ... while loop - Fibonacci series <html>
<head>
<title>
Example of do ... while loop
</title>
</head>
<body>
<script>
var i=1, x=1,y=1;
document.write(”<h1 style=’color:#FF0000’>Fibonacci series</h1><br
/>”);
document.write(”<h1 style=’color:#0000FF’>”+i+”) ”+x+”<br />”);
var next=false;
do {
document.write((++i)+”) ”+y+”<br />”);
var z=x;
x=y;
y+=z;
next
=
confir
m(”Do
you
want
Functions in Javascript
1 Generally, functions have 3 components:
(a) The function keyword at the beginning.
(b) The name of function following the function keyword.
The name of function contains pair of brackets (),
which might contain arguments.
(c) Body of the function enclosed in a pair of curly braces
({ }).
The function might use return keyword to return a value
after processing data.
2 In general, a named block of code is called function,
which may be invoked using the given name.
3 A variable declared inside the function dies within
that function.
4 A function may access variables declared inside the function
or with a global scope (outside any function).
5 Any changes made by a function to the global variables
is permanent and is visible in other functions too.
The following code shows 3 functions, having different combination of
arguments and return values. <html>
<head>
<title>
Test of Javascript functions
</title>
<script>
//Function without argument and without return value
function add1() {
var x = prompt(”Enter x”), y = prompt(”Enter y”),
z=Number(x)+Number(y);
alert(x+” + ”+y+” = ”+z);
}
//Function with arguments but without return value
function add2(x, y, z) {
var z=Number(x)+Number(y);
alert(x+” + ”+y+” = ”+z);
}
//Function with arguments and return value
function add3(x, y) {
var z = Number(x)+Number(y);
return z;
}
</script>
Use of function for OOPS in Javascript
1 OOPS stands for Object Oriented Programming System.
2 Object is a programming entity having properties (to
store values) and methods (to work with properties).
3 Javascript supports Object creation using function.
4 A function can be converted to a class definition.
5 Variable declared inside the function is accessed with
dot operator.
6 A method is declared using the expression this.method
= function() {}.
Example of objects using Javascript function <html>
<head>
<title>
OOPS using Javascript
</title>
<script>
function Student(name, dob, grade) {
this.name=name;
this.dob=dob;
this.grade=grade;
this.getName = function() {
return this.name;
}
this.getDOB = function() {
return this.dob;
}
this.getGrade = function() {
return this.grade;
}
this.setGrade = function(gr)
{
this.grade = gr;
}
}
</script>
</head>
<body>
<script>
var s1 = new Student(’Desiga’, ’2000-05-12’,’A’),
s2 = new Student(’Gayathri’,’2001-03-01’,’B’);
document.write(”<h1
style=’color:#FF0000’>Before changing
grade</h1><h2 style=’color:#0000FF’>”);
document.write(s1.getName()+”: ”+s1.getDOB()+”: ”+s1.getGrade()+”<br />”);
document.write(s2.getName()+”: ”+s2.getDOB()+”: ”+s2.getGrade()+”<br />”);
s1.setGrade(’S’);
s2.setGrade(’A’);
document.write(”</h2><br /><br /><h1 style=’color:#FF0000’>After changing grade</h1><h2
Built in JavaScript functions
overview
1 Functions which are readily available in the general
environment of Javascript are called built-in
functions.
2 Buil-in functions help to process data belonging to the built-
in data types.
3 Built-in functions of Javascript may be categorized under
the following heads:
(a) Number functions
(b) String functions
(c) Array functions
(d) Date functions
(e) Math functions
4 The built-in functions belonging to the above categories
are described in the following sections.
Built-in functions in Number data type

▶ toExponential(): Formats a number in


exponential (X × 10y ) notation.
▶ toFixed(digits): Formats a number with given number
of digits after the decimal point.
▶ toLocaleString(): Formats a number based on
browser geo-location.
▶ toPrecision(digits): Formats the number with given
total number of digits (including those to the left and
right of decimal point).
▶ toString(): Returns String value.

▶ valueOf(): Returns value of the number.


Built-in functions in String data
type
▶ charAt(index): Returns character at given index location.
Counting starts from 0.
▶ charCodeAt(index): Returns UNICODE value of
the character at given location. Counting starts from
0.
▶ concat(s1,s2, s3): Joins given Strings (s1, s2, s3, etc.)
with original String and returns the joined String.
▶ indexOf(s1): Returns the location where the given String
s1 occurs inside the original String. Returns -1 if no
occurrence of s1 is available inside the original String.
▶ lastIndexOf(s1): Returns the last location where the
given String s1 occurs inside the original String. Returns -
1 if no occurrence of s1 is available inside the original
String.
Built-in functions in String data
type
▶ match(s1): Compares the original and given Strings based
on regular expression notation.
▶ replace(s1, s2): Search for occurrences of s1 inside the
original String and replace with s2. String s1 may have
regular expression.
▶ search(s1): Searches the original String for the given
String s1. The String s1 may have regular expression.
▶ slice(begin, end): Splits the original String between
given beginning and end points. Returns the split String.
▶ toLocalLowerCase()/ toLocalUpperCase(): Returns
lower case version (or upper case version) according locale
String based on current geo-locale.
▶ toLowerCase()/ toUpperCase(): Returns lower case
Built-in functions in Array data
type
▶ concat(a1, a2, a3): Appends arrays a1, a2, a3, etc. to
the original array and return the resultign array.
▶ every(function): Returns values which satisfy given
function.
The function should return Boolean value.
▶ filter(function): Returns values which satisfy given
filter function. The function should return Boolean
value.
▶ forEach(function): Calls given function for each element
of the array.
▶ indexOf(val): Returns the firts occurrence location of
the given value in the original array.
▶ join(): Creates a String using the values of the array.
Built-in functions in Array data
type
▶ pop(): Remove the last element of the array.

▶ push(): Add new element to the end of the array.

▶ reduce(): Apply given function to the right and left


elements and replace them with given result till there
remains only a single element.
▶ reduceRight(): Reduces given array from right to
left, applies given function and returns a single value.
▶ shift(): Removes the first element of the array. Returns
the value of removed element.
▶ slice(begin, end): Splits the array from given
beginning through the given end.
▶ sort(): Sorts elements of the array.

▶ splice(location, length, value): Adds given value at given


Built-in functions in Date data
type
▶ Date(): Date and time of today and now.

▶ getDate(): Returns day of month (month counting starts


at 0).
▶ getDay(): Returns day of week (day count starts at 0).

▶ getFullYear(): Returns year stored in the date object in


4 digit format.
▶ getHours(): Return the time stored in the date object in
24 hour format.
▶ getMilliSeconds(): Returns the millisecond value of
time stored in date object.
▶ getMinutes(): Returns the minutes part of time stored in
the date object.
▶ getMonth(): Returns month value stored in the date
Built-in functions in Date data
type
▶ getTime(): Returns milliseconds passed since the epoch
date of 01.01.1970 (midnight).
▶ getUTCDate(), getUTCDay(), getUTCFullYear(),
getUTCHours(), getUTCMilliseconds(),
getUTCMinutes(), getUTCMonth(), getUTCSeconds():
get day of month, day of week, year, hours, milli-seconds,
minutes, month and seconds in Coordinated Universal Time.
▶ setDate(dt): Set dt value in the day of month part of
date object.
▶ setFullYear(y): Set y value in full year part of date
object.
▶ toDateString(): Returns the date and time values in
human readable string format.
▶ toGMTString(): Returns human readable date and time
Built-in functions in Date data
type
▶ toLocaleTimeString(): Returns time part of the
date according local format.
▶ toSource(): Return string equivalent of date object.

▶ toUTCString(): Returns string value of date object


in Coordinated Universal Time format.
▶ valueOf(): Returns the primitive value of date object.

▶ Date.parse(str): Parse the string and obtain equivalent


date object.
▶ Date.UTC(): Returns milliseconds value based
on Coordinated Universal Time.
Built-in functions in String Math
type
▶ Math.abs(x): Returns absolute value of given number,
ignoring + or - signs.
▶ Math.acos(x): Returns arc cosine (cos−1) value of x.

▶ Math.asin(x): Returns arc sine (sin−1) value of x.


y
▶ Math.atan(x):
value. Returns arc tangent (tan−1) value of x.

▶ Math.atan2(x, y): Returns
Math.ceil(x): Returns the arcjust
the integer tangent (tan
greater than) of
−1

x
given fraction x.
▶ Math.cos(x): Returns the cosine value of x.

▶ Math.exp(x): Return ex value of x, where e is the base


for Napier’s logarithm (e = 2.718281828459)
▶ Math.floor(x): Returns the integer just lower than the
given fraction x.
Built-in functions in Math data
type
▶ Math.log10(x): Returns logaithm to the base 10 for value
of x.
▶ Math.max(x,y,z,...): Returns maximum of the given set
of values.
▶ Math.min(x,y,z,...): Returns minimum of the given set
of values.
▶ Math.pow(x,y): Returns x power y (xy ) value.

▶ Math.random(): Returns random number between 0 and


1.
▶ Math.round(x): Rounds given number x to the
nearest integer value.
▶ Math.sin(x): Returns sine value of x.
Built-in functions in RegExp data type

▶ RegExp.match(exp): Matches given exp regular


expression against the given string. Returns the matching
part.
▶ RegExp.test(exp): Matches given exp regular
expression against the given string. Returns true if a
matching part is found.
Popup boxes in Javascript
1 Popup box opens out of a web page to convey an
information, to confirm an action or to obtain an input.
2 Following types of popup boxes are supported by Javascript:
(i) alert(message): Displays given message through a
popup dialog.
(ii) confirm(message): Confirms whether given option
should be
OK or Cancel.
(iii) prompt(message, default): Prompts for an input
by displaying a message and a default value
(optional).
Example of dialogs in Javascript
<html>
<head>
<title>Dialogs in Javascript</title>
</head>
<body>
<script>
var x = prompt(”Enter x:”,”10”);
var y = prompt(”Enter y:”,”20”);
if(confirm(”Do you wish to add the numbers?”)) {
var z = Number(x)+Number(y);
alert(x+” + ”+y+” = ”+z);
}
else
alert(”You have chosen not to do anything with the
given numbers”);
</script>
</body>
</html>
Document Object Model (DOM)
1 Accessing elements of a web page as though they belong to
a document (using the this.document interface methods and
properties) is called Document Object Model (DOM).
2 Document Object Model (DOM) may be visualized as
shown in Fig.66.

Figure: Document Object Model[78]


Properties of Document Object Model (DOM)
3 DOM supports access to HTML elements. Such
element properties of DOM are shown in Fig.67.

Figure: Properties of Document Object Model[79]


Methods and properties of Document Object
Model (DOM)
(1) getElementById(id): Returns the element having the
given id from the HTML document.
(2) getElementByName(name): Returns the HTML
element having the given name.
(3) getElementsByTagName(tag): Returns an array
of elements having the given tag name.
(4) getElementsByClassName(cls): Returns an array of
objects belonging to given class name.
(5) write(str): Writes given string value to the document.
(6) writeln(str): Writes given string value to the document
and appends a newline character.
(7) innerHTML: Sets HTML portion for a particular element
of the document.
(8) innerText: Sets text value for a particular element of
the document.
Example of DOM
<html>
<head>
<title>
Test of DOM
</title>
<script type=”text/javascript”>
function welcome() {
var name = document.nameForm.n.value; //DOM access
document.write(”Welcome ”+name+”!”); //DOM method write is used
}
</script>
</head>
<body>
<form name=”nameForm” method=”GET” action=”#”>
<center>
Enter name: <input type=”text” name=”n”><br / >
<input type=”button” value=”Message” onClick=”welcome()”>
</center>
</form>
</body>
</html>
Browser Object Model (BOM) in
Javascript
1 Browser Object Model (BOM) is supported by the
window class.
2 The window class of BOM is the parent of all other
objects.
The structure of BOM is shown in Fig.68.

Figure: Properties of Browser Object Mo


del[79]
Methods of window object in BOM
1 alert(msg): Displays alert message.
2 prompt(msg, default): Displays input dialog with
given message and default value.
3 confirm(msg): Displays confirmation dialog with OK
and Cancel options.
4 open(): Opens a new window.
5 close(): Closes current window.
6 setTimeout(): Waits for given amount of time before
taking action.
Methods of window.history object in BOM
1 window.history.forward(): Equivalent to pressing
forward button in browser.
2 window.history.back(): Equivalent to pressing back
button in browser.
3 window.history.go(number): Loads given page number
in history object.
Methods of window.history object in BOM
1 window.screen.width: Returns the width of screen.
2 window.screen.height: Returns the height of screen.
3 window.screen.availWidth: Returns available width
after deducting the width of unusable portions.
4 window.screen.availHeight: Returns available height after
deducting the height of unusable portions (like title bar,
status bar, etc.).
5 window.screen.colorDepth: Returns color depth.
6 window.screen.pixelDepth: Returns pixel depth.
Syllabus
MS excel revision (row, columns, basic formatting, insert
menu, Print setup, etc. ) and Look up introduction and
functions Types of references and cell naming Excel
Linkage Custom Format and Excel Protection Tips and
tricks Pivot table and Pivot chart Conditional formatting
Advanced Graphs Power Queries
Introduction to features of
Excel
▶ Excel works on the basis of cells, one cell being
the intersection of a column and a row.
▶ Columns (vertically aligned dividers) have the alphabet
names (A,B,C, ... Z, AA, AB, ..., AZ, BA...).
▶ Rows have numeric identifier (1, 2, 3, ...).

▶ Cells are addressed by combination of column name - row


number, e.g. A1 for the first cell, B6 for the cell at
second column, sixth row.
▶ Excel has a large collection of functions (entered in a cell
after typing = sign), which are helpful in data analysis and
computations.
▶ Excel can sort and arrange data in easily readable format.

▶ Excel can draw charts (like pie, bar, column, scatter, etc.) to
help visualize data entered in cells.
Lookup functions

▶ Lookup functions search in an array of data for a


particular value.
▶ They return given column value when matching row is
found.
▶ Lookup functions are:
1. LOOKUP(value, range to search, range to return):
Searches for given value in the range of cells
specified. It returns the corresponding value from
the matching row.
2. VLOOKUP(value, range to search, column index to
return): Searches for given value in the first
column of the range of cells specified. It returns the
corresponding column index value from the
matching row.
3. HLOOKUP(value, range to search, row index to
return):
Searches for given value in the first row of the range of
Cell protection

▶ Cells can be protected at the cell level, sheet level


or workbook level.
▶ Selected cell can be protected by opening
Home− >Alignment− >Format cells. Choose Locked
checkbox. Pressing Ok button locks the cells.
▶ To protect a sheet or workbook, go to
Review− >Changes− >Protect Sheet or
Review− >Changes− >Protect
Workbook.
Sorting in MS
Excel
▶ To sort data, select all the cells containing the data to
be sorted.
▶ Avoid the most common mistakes of selecting the just the
single column containing the values to be sorted and
omitting some columns which you might consider
unnecessary of inclusion. Such an error may result in
separation of data from its proper row members.
▶ Click Data− > Sort. In the dialog that opens, keep or
remove the tick mark against the field ”My data contains
headers”.
▶ The sort options contain 3 columns. First, select the
column using which data needs to be sorted. In case the
data contains headers, the header name is displayed.
Otherwise, column name in alphabets (A,B,C,...) is
displayed.
Cell referencing
▶ When the name of cell (like B5) is referenced in a formula,
it can be done in 3 different ways, as detailed below:
a) Relative referencing - dynamic row & column change mode
b) Semi-relative referencing - fynamic row & static column mode
or static row and dynamic column mode
c) Absolute referencing - static row & static column mode
▶ Relative referencing: In this mode, copying the formula to a
new cell (e.g., add 4 to columns & 3 to rows) causes the cell
reference to change relative to the new column (by adding
the same 4 to columns & 3 to rows to the reference made in
the formula).
▶ Semi-relative referencing: In this mode, either the row or
column references are static, denoted by a $ symbol
preceding the row number or column name.
▶ Absolute referencing: In this mode, both column name and
row number are static and are preceded by a $ symbol.
When the formula is copied from one cell to another, the cell
Filtering of data in MS Excel

▶ For filtering data, the first row should contain headers.

▶ Select all the data including headers.

▶ Choose Data− > Filter . A triangular filter marker appears


to the right of each column in the first row of data.
▶ Clicking the triangular marker of any column permits sorting
in ascending or descending order, sorting by color, search for
specific values, applying several filter conditions for numbers
(like equals, does not equal, greater than, less than, less
than or equal to, between, top 10, above average, below
average, custom filter) and text (like equals, does not
equal, begins with, ends with, contains, does not
contain,custom filter).
▶ Filter helps to select data based on convenient criterion.
Validation of data in MS Excel
▶ Select the cells (or column or row) in which data validation
is required.
▶ Choose Data− > Data Validation from the menu.
Select Data Validation.
▶ The data validation dialog appears.

▶ Select the data type from Allow criterion.

▶ Select the data criterion (between, not between, equal to,


not equal to, greater than, less than, greater than or equal
to, less than or equal to).
▶ Enter the values for validation.

▶ If you wish to display an error message for wrong input,


click Input Message tab and enter the title and content of
error message.
Analyzing data using charts in MS Excel

▶ MS Excel supports column, line, pie, area, scatter and


other chart types like stock, surface, doughnut, bubble and
radar.
▶ To display a chart like column, line, pie or bar, type X-Axis
title in the one column and Y-Axis title in the next
column.
▶ Enter X-Axis values and Y-Axis values in the selected
columns.
▶ Select the data (including title).

▶ Choose Insert menu. Click the type of chart like column,


line, pie, bar or scatter.
▶ The chart is inserted by Excel.

▶ Edit display parameters if necessary.


Data tables in MS
Excel
▶ Using data table, Excel can be made to calculate the
results for a row, a column or an array.
▶ If you wish to create a column based data table, fill the
input values on the left. Calculate the result for the first
row.
▶ Select the entire table, choose Data− >What
If Analysis− >Data Table.
▶ Choose first column in the input box (leave the row
value blank).
▶ Excel will fill up the remaining blank cells.

▶ Similarly, you can create a row based data table. You need
to create a row based input, calculate the result in the first
column of the next row. Choose first cell of the row in row
Data tables in MS
Excel
▶ If you wish to create a matrix using data table, enter
input values in 2 cells, calculate the result value in a new
cell.
▶ Create a row of inputs to the right of the result cell.

▶ Create a column of inputs below the result cell.

▶ Select the new matrix. Leave the row and column input
cells unselected.
▶ Choose What Data− >If Analysis− >Data Table.

▶ In the input box, select the cells for row and column input.

▶ When OK button is pressed, Excel fills all the cells of


the matrix based on your formula.
Pivot table in MS Excel

▶ Pivot table (and pivot chart) provide a means for


summarizing data presented in a table.
▶ Choose the table based on which pivot table needs to
be created.
▶ Choose Insert− >Pivot− >Pivot Table.

▶ MS Excel inserts a summary table in a new worksheet.


Goal seek in MS
Excel
▶ Suppose you have a formula in a cell.

▶ If you wish to know the input for which the formula will
yield a desired result, goal seek will help you.
▶ Click the cell containing the formula. Choose Data−
>What If Analysis− >Goal Seek.
▶ In the first cell of the dialog, enter desired result.

▶ In the second cell, enter the address of the cell


containing wrong input, which needs to be adjusted to
produce the desired new result.
▶ Press seek button and see the suggested new input
value.
▶ Press OK to accept the modified input and cancel to
discard the changes.
Scenarios in MS
Excel
▶ Scenario helps to save different sets of input values
and compare the results of different scenario later on.
▶ To create a scenario, create a set of input values and
calculate the result.
▶ Choose Data− >What If Analysis− >Scenario. Enter a title.

▶ Choose cells for which different sets of input values are to


be tested. Use control to select more than one cell.
▶ Save the scenario with an optional comment.

▶ Repeat the same steps to create more such scenarios.


Save different input values for each scenario.
▶ You can choose any of the scenario at a later time to see
the results.
Advanced graphs in MS Excel

▶ Insert menu in MS Excel provides several graph options,


including line chart, scatter diagram, column bart, bar
chart, pie chart and 3-D surface charts.
▶ The data to be visualized in the graph is to be entered
with appropriate column headings.
▶ After selecting the data to be visualized, accessing
the Insert− >Chart menu item provides the list of
options available for charting.
▶ Chart may be inserted as a floating frame over a
spreadsheet or as a separate sheet.
▶ Right clicking various regions of a chart provides the
options for customizing the chart.
Advanced graphs in MS Excel
[13]
▶ Insert menu in MS Excel provides several graph options,
including line chart, scatter diagram, column bart, bar
chart, pie chart and 3-D surface charts.
▶ The data to be visualized in the graph is to be entered
with appropriate column headings.
▶ After selecting the data to be visualized, accessing
the Insert− >Chart menu item provides the list of
options available for charting.
▶ Chart may be inserted as a floating frame over a
spreadsheet or as a separate sheet.
▶ Right clicking various regions of a chart provides the
options for customizing the chart.
▶ Fig.69 shows some of the advanced chart options available
Advanced graphs in MS Excel
[13]

(a) Column chart (b) Donut chart


Power query in MS Excel
[14]
▶ MS Excel provides advanced option for importing data
from cloud storages and other data sources.

Figure: Menu for importing external data in MS Excel [14]

▶ Fig.70 shows the menu for connecting to external data


source in MS Excel.
Power query in MS Excel
[14]
▶ On connecting to an external data source, the raw data is
to be imported to a worksheet.
▶ The raw data imported into the worksheet should be
suitably transformed/ reorganized for easy charting.
▶ An appropriate chart may be created using the
transformed data and chart elements modified as per
requirements.
▶ Whenever the particular workbook is opened in MS Excel or
when Ctrl + F 5 is pressed to refresh the spreadsheet or
when Ctrl + Alt + F 5 is pressed to refresh the entire
workbook, external data is synchronized and fresh data is
imported.
▶ Charts created using power query option are
automatically redrawn by MS Excel when data changes.
E-Commerce
Introduction to E Commerce and advantages. Building
business on the net. Payment and Order Processing,
Authorization, Chargeback and other payment
methods. Security issues and payment gateways.
Definition of E-Commerce
1 e-commerce stands for electronic commerce, which means
selling or buying goods through electronic means like
Internet, phone line, sms, etc.
2 Selling or buying goods through electronic means (based
on product description and photos) is called E-Commerce.
3 e-commerce may be carried out over phone line, SMS or
the Internet.
4 The buyer relies upon the description, photos and videos
of the product being sold online to make a decision.
5 e-commerce involves to entities (the buyer and the
seller) connected through a common platform.
Types of e-commerce
1 B2B or Business to Business: When the seller is a
business firm and the buyer too is business firm (not an
individual consumer), the e-commerce transaction is called
B2B or Business to Business transaction.
2 B2C or Business to Consumer: When the seller is an
online business firm and the buyer is an individual, the
online business transaction is called B2C or Business to
Consumer.
3 C2B or Consumer to Business: When the seller is an
individual and the buyer is a business firm, the online
business model is called C2B or Consumer to Business.
4 C2C or Consumer to Consumer: When the seller and the
buyer are both individuals, the online business model is
called C2C or Consumer to Consumer.
Scope of e-commerce platform
1 e-commerce platforms like quikr, olx, etc. have local scope.
2 e-commerce platforms like Flipkart, Shopclues, Snapdeal,
etc.
3 e-commerce platforms like eBay, amazon, etc. have
global scope in electronic commerce.
4 Scope of the e-commerce platform ranges from local level
to global level.
5 Benefits
Benefits of e-
commerce
1 Electronic commerce helps the buyer to choose the most
competitive price for a product from several alternate
sellers.
2 e-commerce allows a seller to fetch competitive price
for products.
3 e-commerce helps a consumer to order a product from far
off places, even if such product is not available in the local
market.
Disadvantages of e-commerce
1 Descriptions and photos provided by the seller may not
match the delivered product.
2 A product may get damaged during transit, since the
seller and the buyer are located at far off places.
3 The buyer may fail to pay for a product.
4 The buyer might return the product after using it for
few days, which could result in the loss of transit and
other expenses to the seller.
5 The buyer might get delivery of the product on the
expected date.
Difference between E-Commerce and traditional
commerce
Table: Difference between E-Commerce and traditional commerce
No. e-commerce traditional commerce
Buyer cannot touch or feel the Buyer can examine the product
1
product before buying. before buying.
2 Bargaining is restricted. Bargaining is possible.
Shipping time results in delay in
3 Immediate delivery of product.
getting the product.
User needs to figure out the us- Usually, a demo is given at the
4
age procedure by himself. shop floor.
Testing a product before pur- Testing before purchase is pos-
5
chase is not possible. sible.
In case of dispute, the buyer and
Conversations regarding a prod-
6 seller need to be fluent in a
uct are easy.
com- mon language (like
English).
e-commerce platform
allows Product infiltration through the
7
manufacturers to speedily dis- market chain takes time.
tribute their new products.
The buyer can be assured of
Fraudulant platforms might re-
8 product delivery for the money
sult in loss to the buyer.
paid.
Capabilities required for e-
commerce
1 An e-commerce platform should provide a cart, where
items may be added or removed.
2 Options for payment through CoD (Cash on Delivery),
credit card, debit card, netbanking and wallet transfer
should be supported by the platform.
3 e-commerce platform should provide a dedicated
transport mechanism to deliver the products on specified
time line.
4 The buyer and seller should be permitted to share and
rate their experience for each online transaction.
Technology issues for e-commerce
1 The online platform should provide secure transaction
facilities to prevent fraudsters from cheating a buyer or seller.
2 The payment gateway should be secure and be
available 24 × 7.
3 Reward points and redemption system should be provided
to encourage the buyer.
4 Broken Internet connection before completing a
transaction might result in loss of money to the buyer.
Types of E-Commerce web
sites
1 Transactional type sites: In transactional type, physical
stores provide an online alternative. Customers can either
visit the physical store or the online store to get a product.
2 Information delivery sites: Large manufacturers might
run websites simply to disseminate information about their
products. These sites might include online fora for
discussion on technical issues.
3 e-market place: This type of website permits registration
of buyers and sellers. The e-marketplace functions as the
facilitator between the buyer and the seller and takes
commission amount for the service.
Building business on the net
1 Building an online business requires the seller to create
visuals and descriptions for the products.
2 The seller should ensure that the description is
unambiguous.
3 The seller should keep the buyer updated about each stage
of the online transaction from purchase to eventual delivery
of product.
4 The seller should ensure that the buyer is provided a
pleasant experience through all stages of his transaction.
5 The buyer should have the service and support for the
online product.
6 The online business platform should provide an easy
interface to the users.
▶ Providing full description of a product sold online is called
the online catelogue.
▶ The online catelogue shoud describe all physical and
internal features.
▶ The online catelogue should provide clear instructions
for operating a product.
▶ Online catelogue should provide clear price tag for
each product.
▶ Online catelogue should describe defects, if any, in
the product.
Shopping cart

▶ The place for keeping all selected items before final


checkout from an online store is called a cart.
▶ Cart provides facility to add, remove or modify
products through online.
▶ Cart items are deleted when a purchase transaction is
made online.
Checkout
pages
▶ After adding items to the cart, the customer is provided
detailed list of items, quantities, rates and amounts for
each transaction.
▶ When the user provides confirmation that the items in
the cart are really meant to be purchased, the checout
page redirects the user to payment page.
Payment for e-commerce transaction
▶ Payment for an online transaction may be made through
the following methods:
(i) Cash On Delivery (COD): The buyer pays money when
the
product is delivered.
(ii) Credit card: A card bearing 16 digit number, expiry month &
year, name of card holder and a Card Verification
Value (CVV) and permitting permitting spending first and
collection on later date is called credit card.
This card permits payment of money for goods
and services. This amount should be paid up during
the credit card bill cycle. Credit card permits
conversion of large purchase amount to EMI (Equated
Monthly Installment) payment.
(iii) Debit card: A card bearing 16 digit number, expiry month &
year, name of card holder and a Card Verification Value (CVV)
is called and permits spending the money already debosited in
an account is called debit card. This card permits payment of
money for goods and services from prepaid deposits.
(iv) Internet banking: Internet banking permits logging in to a
Security issues for online
payment
▶ The user should ensure that green color lock icon
appears near the address bar of the browser.
▶ The user should ensure that the lock icon is not crossed
out.
▶ The user should ensure that the Internet connection is
stable for completing payment transaction in one go.
▶ The user should ensure that the payment transaction is
completed within the shortest possible time limit. Otherwise,
the session might expire and the money may remain unpaid
to the e-commerce site, but debited from the bank account
of the user.
▶ The user should ensure that the payment URL begins with
https, which is a secure communication protocol over
hyper text transmission protocol.
Payment
gateway
▶ A third party online payment system which receives money
from the buyer and transfers the same to the seller is called
a payment gateway.
▶ CCAvenue, PaySeal, PayPal, etc. are some of the
common payment gateways.
▶ For each successful transaction, the payment gateway takes a
commission and transfers the remaining amout to the
account of the beneficiary.
Cyber security
Overview of Information Security, SSL, HTTPS, Security
threats, information Security vulnerability and Risk
management. Introduction to Directory Services, Access
Control, Security, Privacy protection, Audit and Security.
Introduction to IT Act and penalties for cybercrimes.
Cyber security
1 Protecting computer users from online attacks aimed at
damaging the data, software, monetary loss or any
other damages is called cyber security.
2 The term cyber means interaction of computers
through Network.
3 Cyber crime is a malafide act happening inside the
networking domain.
4 Victims of cyber crimes might loose data or money.
Information security

▶ Information security is the practice of preventing


unauthorized use of information.
▶ Information Security is abbreviated to InfoSec.

▶ Under information security, any device having processor


and memory is categorised under computing device.
▶ Keeping the data of a device safe from unauthorized users
is called information security.
▶ CIA: CIA is the abbreviation for Confidentiality, Integrity &
Availability under information security.
Threats to information security
▶ Worms: Worms are little scripts sent through email
attachments. These enter the computer system when user
tries to open the attachment. Worms might result in
scare, loss of data from the system.
▶ Phising attacks: Creating a cheat URL resembling an
authentic website and making the victim to reveal login
credentials is called phishing attack. In most of the
cases, phishing victims innocently reveal bank login
details, which are misused by the attacker.
▶ Trojans: A normal looking program may have an
embedded malware. The malware might collect sensitive
data and transmit the same to the attacker.
▶ Computer virus: A malicious which becomes hooked to the
opearating system and keeps continuously working to
damage data stored in the device is called virus. Virus
spreads through Internet, storage media like pen drive, etc.
Vulnerability

▶ Sources of weakness in the IT infrastructure for potential


theft of information is called vulnerability.
▶ Vulnerabilities may be found in the operating system.
These vulnerabilities are targeted by hackers and exploited.
▶ The network connection might be insecure due to lack
of firewall, anti-virus and other online protection
software packages.
▶ An application software might include a vulnerability. When
this software runs, hackers may intrude the system and
cause damages.
▶ Failure to conduct periodic security audit of computer
systems might result in data vulnerability.
▶ Identifying sources of data disruption and ensuring
Risk management

▶ The likelihood of loss of data due to security vulnerability


is called risk.
▶ Risk management is the process of ensuring smooth
functioning of business without permitting any attack on
the information held by an organization.
▶ A team of people calculate the risk faced by an
organization based on existing vulnerabilities and sources of
threat. The team decides upon the safe practices, software
and hardware implementations to be adopted for complete
information safety.
▶ To ensure information safety, an organization should have
(i)security policy, (ii)organization of information security,
(iii)human resource security, (iv)access control, (v)physical
security, (vi)security incident management, (vii)safe disposal
of damaged hard copies, (viii)safe disposal of damaged
Introduction to Directory
Services
▶ Directory service is a single access point which could take
a user to sevel other services located at different URLs.
▶ The directory service simplies the job of security
administrator to the safe maintenance of directory service
alone.
▶ Directory service may store data in several computers.
But, the user should find that the directory is a single
point.
▶ The directory service should be able to include new
objects based on changes to network.
▶ Searching for information from various locations on
the network should be easy.
▶ The directory system should be independent of the
physical location of the user or the administrator.
Access control

▶ Access control is the selective permission to particular


individuals to access a computer and perform their
works.
▶ Access control may be physical security to the computer.
Users may be permitted to use the computer only if they are
authenticated through smart card, finger print, iris scan,
etc.
▶ Access control may be implemented through software.
Users may be required to provide a valid pair of identifier
(ID) and password.
▶ Access control may be implemented through a combination
of physical and software controls.
▶ The layout of the access control components is called
access control topology.
Software development security
▶ Security is implemented at the development stage of
a software.
▶ Security of software is designed to cover the entire life cycle
of software.
▶ Software Development Life Cycle (SDLC) is the planning of
the security measures to be incorporated in a software
throughout the life span of the software.
▶ Protection from disclosure: is the prevention of
disclosure of source code by any individual involved in the
development of a software product.
▶ Protection from alteration: The source code should not
be altered without appropriate authorization.
▶ Protection from destruction: Any individual should
not have the right to delete or destroy the entire
software.
Privacy protection

▶ Data relating to several types of individuals may be held


in the IT infrastructure of an organization.
▶ Protecting the data from unauthorized access is called
privacy protection.
▶ Breach of privacy protection might result in huge damage
to individuals and organizations.
▶ Medical records of patients, record of criminals, financial
data of companies, genetic material, address and contact
details of individuals, record of web surfing behaviour, record
of credit card, debit card or Internet banking creditials are
some of the privacy data which should not be
compromized.
Information security audit
▶ Information security is audited by a team of experts with
reference to vulnerabilities, threats and preventive
measures for data protection.
▶ The information security audit thoroughly analyses all
threat events of the past and formulates security measures
for the future.
▶ Information security audit should be performed in a
periodic manner, i.e., once every month, every quarter, etc.
▶ Seggregation of duties should be adopted to ensure that no
single employee has all the data needed to make a
fraudulant transaction.
▶ All segments of the organization should be protected
through physical and password security measures.
▶ The audit team should ensure that customers of the
organization can feel safe when their data is divulged
Introduction to I.T. Act

▶ Information Technology Act, 2000 was introduced to prevent


and punish cyber crimes.
▶ I.T. Act provides support for ecommerce.

▶ I.T. Act protects individuals from being victimized by cyber


frauds.
▶ A major amendment to the IT act was made in 2008.
Penalties for cybercrimes
Table: Cyber crimes and punishments

No. Section Cyber crime Max. Imprisonment Max. Fine Both imp’ a
1 65 Tampering with computer source documents
2 years 2Lakh Yes
2 66 Hacking
3 years 5Lakh Yes
3 66B Receiving stolen computer/ mobile
3 years 1Lakh Yes
4 66C Misuse of password
3 years 1Lakh Yes
5 66D Cheating with computer
3 years 1Lakh Yes
6 66E Publishing private images of others
3 years 2Lakh Yes
7 66F Cyber terrorism
Life − No
8 67 Publishing obscene content
5 years 1Lakh Yes
9 67A Publishing sexual content
7 years 1Lakh Yes

1Lakh;
10 67B Publishing child porn 5; 7 years
1Lakh
(subse- Yes
(subse-
quent)
quent)
11 67C Failure to maintain records by operator
3 years undefined Yes
12 68 Failure to comply with orders
3 years 2Lakh Yes
Syllabus
Benefits of cloud services, different categories. Resources
available in cloud. Identify Phases of the Application
Development Life Cycle. Describe Roles in each of phases
of the Application Development Life Cycle.
Cloud computing

▶ Cloud computing means storage and processing of data


on remote computers connected through the Intenet.
▶ Thin clients like Chromebooks can store data and
run programs in the remote cloud.
▶ Cloud services are offered by several companies,
including Microsoft, IBM, Apple Computer, Google,
DropBox, etc.
Categories of cloud
services
▶ Private clouds: Private clouds are services maintained
by large firms for their internal usage.
▶ Public clouds: Public cloud services are accessed over
the common Internet. The services may be paid or free.
OneDrive, iCloud, Google Drive, DropBox, etc. are examples
of public cloud.
▶ Hybrid clouds: Hybrid clouds provide some public services
accessible to everyone and some restricted services
accessible for internal use of employees.
▶ Community clouds: Some individuals or organizations
having common interests may share data and storage on a
cloud. For persons or organizations outside the particular
community, the cloud looks like a private cloud.
Resources available on
cloud
▶ Data storage: Photos and documents may be uploaded
to cloud server and accessed from any device.
▶ SaaS: Software as a Service (SaaS) provides for access to
software from any connected device. This has created
annual subscription and renewal model for software
packages.
▶ IaaS: Infrastructure as a Service (IaaS) provides access to
state of the art IT infrastructure through cloud computers.
Amazon Web Services (AWS), Google Cloud, IBM Cloud
and Microsoft Azure are some of the IaaS services for
enterprises.
▶ PaaS: Certain program development projects might
require specific platforms, which may be costly to acquire.
PaaS (Platform as a Service) provides complete
development platform for specific duration on rental over
Application Development Lifecycle

▶ Application development begins with the assessment of


customer demand, passes through planning, development
and testing.
▶ After testing, the software may be deployed.

▶ Deplyoment brings new bugs to light.

▶ Bug fixing and maintenance are the next phases in


software development lifecycle.
▶ Some software packages might require minor improvements
or complete revamping. New releases of the software should
be brought out to address such needs.
Application Development Lifecycle

Figure: Application Development Life Cycle[77]

▶ ADLC involves the following phases:


1. Gathering information
2. Analysis
3. Design
4. Coding and testing
5. User and system tests
6. Deploymet (Production)
7. Maintenance
Syllabus
Introduction to Python, History of Python, Features,
Setting up path, Basic Syntax, Comments, Variables,
Different Data Types, Casting, string, Boolean
Python Operators Conditional Statements, Looping Control
Statements, String Manipulation, Lists, Tuple, sets,
Dictionaries, Arrays, Iterators, date, math modules, Input
and Output.
Introduction to Python

▶ Python is a general purpose programming language created


by Guido van Rossum[12] in the year 1991.
▶ It supports dynamic data types, which means the
language decides the data type to be used for a variable.
▶ Python supports automatic garbage collection, which
means unused memory will be automatically released.
▶ Python uses indentation (aligning code to the right) for
defining blocks and inner blocks of code (no need to use
{ and }.)

Figure: Giodo Van Rossum, Creator of


Python[12]
History of Python

▶ Python was developed as a successor to ABC programming


language.
▶ Python was developed by Guido van Rossum in 1991 at
Centrum Wiskunde & Informatica (WCI) in
Netherlands.
▶ Python2 was released on 2000 and Python3 in 2008.

▶ Guido van Rossum relinquished all responsibilities relating to


Python in the year 2018.
▶ Python version 3.10, released in 2022, is the current release
of Python.
▶ Python language interpreter is available for several platforms
and the same may be downloaded from the URL
https://www.python.org/downloads/.
Features of Python
▶ Python supports both procedural programming (function
oriented) and Object Oriented Programming System (OOPS).
▶ Python support Aspect Oriented Programming (AOP) and
metaprogramming, which help to create special objects
called magic objects.
▶ Python is a dynamically typed language. Data types need
not be declared by the programmer.
▶ Python has an automatic garbage collector to reclaim
unused memory.
▶ Python supports late binding (otherwise called dynamic
linkage), which means that function names are looked up
only during execution.
▶ Late binding offers flexibility during development, where
programs may compile even when some functions are not
Setting up path for Python

▶ On installation of the latest version of Python, a folder


named
c:
python3x, where x is the release number, is available.
▶ To include Python from the command line, one may issue
the command PATH=%PATH%;c:
python3.
▶ To permenantly add the Python folder to PATH variable:
1. Open control panel or settings app.
2. Search for environment variables.
3. Choose either system variables or user variables.
4. Click upon variable named PATH. Press Edit button.
5. Add the line c:
python3 to the PATH variable.
6. Save the changes. Now, Python would run from command
line.
Basic
Syntax
▶ Python statements need not end with ;

▶ Each block of code is indented to the right.

▶ Fig. 73 shows a simple hello statement displayed


through print function in Python.
▶ Instead of running the code on the command line,
program code may be typed in a file (say hello.py) and
executed by invoking python interpreter with the file name
as argument, e.g., (python3 hello.py)
Basic
Syntax

(a) Command Line Execution

(b) Editing Python script (c) Executing Python script

Figure: Executing Python Code


Comments in Python

▶ Single line comments may start with # symbol. Any text


to the right of single line comment is ignored.
▶ Multiline comments may start with three double quote
symbols (”””). Any content till the occurrence of same
triplet of double quotes (”””) is ignored.
▶ Comments are ignored by Python.
Variables in Python

▶ A variable may start with any alphabet or underscore ( ).

▶ A variable name may contain alphabets, numbers


and underscore ( ). No special characters are
allowed.
▶ Variables are case sensitive. x=5 and X=10 will assign
values to x and X as different variables. (print(x,X) will
produce 5 10 as result.
▶ Variables come into existence on first assignment of value.

▶ Obsolete variables will be automatically removed


from memory (garbage collection).
Data Types in Python
1. byte: One byte of size of data. Stores values from -128 to
+127.
2. int: Integer data type. Occupies 2 or 8 bytes of storage.
3. float: Floating point number storage. Memory occupied
may be in the range of 2 bytes to 8 bytes.
4. complex: Contains a real part and imaginary
part, representing a complex number.
5. bool: Stores TRUE or FALSE as the value.
6. str: String data type.
7. None Variable does not belong to any data type.
8. list: A list is enclosed inside square brackets [].
9. tuples: Tuples are enclosed inside paranthises().
Data Types in Python
1. dict: Name value pairs are stored in dict. Dict is
enclosed inside curly braces{ }. Names and values are
separated by colon : symbol.
2. set: A list of items enclosed in curly braces{ } is called
a set.
3. frozenset: A list of items enclosed in curly braces{ },
which are themselves arguments for frozenset() function is
called a frozenset.
4. memoryview: Holds memory address of given variable.
5. bytearray: A series of byte values of given size.
Casting data to other
types
▶ Data belonging to one type (e.g. str) may be cast to other
types using casting functions which have the name of
target data type itself (e.g. int()).
▶ Following are the common data casting functions:
1. int(): Casts given data to integer type.
x=int(”12”)
will store integer 12 in variable x.
2. float(): Casts given data to float type.
x=float(”12.74”)
will store floating point number 12.74 in variable x.
3. str(): Casts given data to string type.
x=25
y=12
z=str
(x)
+str(
y)
print(
z)
Casting data to other
types

(a) Casting to int using


int()

(b) Casting to string using


Arithmetic operators in Python
Arithmetic operators are shown in Table 16.

Table: Arithmetic operators in Python

Sl. No. Operator Purpose Typical Usage


1 + Addition z = x+y
2 − Subtraction z = x−y
3 ∗ Multiplication z = x∗y
4 / Division z = x/y
Integer / modulo re-
5 % mainder after divi- z = x %y
sion
6 ∗∗ Power z = x ∗ ∗y
Quotient of division
7 // z = x//y
operation
Assignment operators in Python
Assignment operators are shown in Table 17.

Table: Assignment operators in Python

Sl. No. Operator Purpose Typical Usage


1 = Assigns right side result to left side identifier z = x+y
z = 5
2 + = Add and assign. z + = 12 # makes z value 17.
z = 5
3 − = Substract and assign z− = 12 # makes z value −7.
z = 12
4 ∗= Multiply and assign z∗ = 5 # makes z value 60.
z = 60
5 / = Divide and assign z/ = 5 # makes z value 12.
z = 3
6 ∗∗ = Calculate Power and assign z ∗ ∗ = 2 # makes z value to become 9
z = 13
7 %= Find modulo remainder and assign the same z % = 5 # makes z value 3
z = 13
8 // = Find quotient and assign the same z / / = 5 # makes z value 2
z = 13
9 // = Find quotient and assign the same z / / = 5 # makes z value 2
z = 5
10 & = Find bitwise AND and assign the same z & = 4 # makes z value 4
z = 5
11 |= Find bitwise OR and assign the same z| = 8 # makes z value 13
= z = 5
12 Find bitwise XOR and assign the same z =7 # makes z value 2
z = 5
13 >>= Find bitwise Right shift and assign the same z > > = 2 # makes z value 1
z = 5
14 <<= Find bitwise left shift and assign the same z < < = 2 # makes z value 20
Comparison operators in Python
Comparison operators are shown in Table 18.

Table: Comparison operators in Python


Sl. No. Operator Purpose Typical Usage
Equal to. Compares left and right
1 == sides. Returns TRUE only if both if (x == y )
sides are equal.
Not equal to. Compares left and
2 != right sides. Returns TRUE only if if (x ! = y )
both sides are NOT equal.
Greater than. Returns TRUE only
3 > if left side is greater than right side. if (z > 6)
Less than. Returns TRUE only if
4 < left side is less than right side. if (z < 6)
Greater than or equal to. Returns
5 >= TRUE only if left side is greater if (z > 6)
than or equal to the right side.
Less than or equal to. Returns
6 <= TRUE only if left side is less than if (z < 6)
or equal to the right side.
Logical operators in Python
Logical operators are shown in Table 19.

Table: Logical operators in Python

Sl. No. Operator Purpose T


Returns TRUE only
if both left side and if (x
1 and
right side expres- z)
sions are TRUE.
Returns TRUE if ei-
2 or ther left side or if (x
right side expression
is TRUE.
Returns TRUE if the
3 not right side expression if (n
is FALSE.
Identity operators in Python
Identity operators are shown in Table 20.

Table: Identity operators in Python

Sl. No. Operator Purpose Typical Usage


Returns TRUE of
1 in both variables refer if (xisy )
to the same object.
Returns TRUE of
both variables DO
2 is not if (xisnoty )
NOT refer to the
same object.
List Membership operators in Python
List membership operators are shown in Table 21.

Table: List Membership operators in Python

Sl. No. Operator Purpose T


Returns TRUE if a
1 in value is found in a if (x
list of items.
Returns TRUE if
2 a value is if (x
not in
NOT FOUND in a
list of
items.
Bitwise operators in Python
Bitwise operators are shown in Table 22.

Table: Bitwise operators in Python

Sl. No. Operator Purpose Typical Usage


z =5
1 & Bitwise AND. z &4
returns 4
z =5
2 | Bitwise OR z|8
returns 13
z=5
3 ˆ Bitwise XOR zˆ7
returns 2
z =5
4 >> Bitwise Right shift z >>= 2
returns 1
z =5
5 << k = z << 2
Bitwise left shift
makes k to assume a
Conditional Statements

▶ Python supports if ... elif ... else ... condition. The elif
and else parts are optional.
▶ Each block (if, elif or else) is denoted by a : and
appropriate indentation.
▶ Sample code for the three forms of if condition is
presented below:
1) if condition: x = int(input(”Enter your age:
”)) if(x<18):
print(”You are a kid!”)
Conditional Statements
2) if else condition:
x = int(input(”Enter your age: ”))
if(x<18):
print(”You are a kid!”)
else:
print(”You are not a kid!”)
3) if elif else condition:
x = int(input(”Enter your age: ”))
if(x<18):
print(”You are a kid!”)
elif(x<25):
print(”You are young!”)
elif(x<50):
print(”You are
middle aged!”)
else:
print(”You are a
Looping in Python
▶ Python supports 2 types of loops:
1. for loop: For loop can take a string, an array or a range
object as argument. Following is a for loop to print
numbers from 2 to 10:
for x in range(2,11,1):
print(x)
else:
print(”Finished for loop”)
Else part in the above loop is optional. The following for
loop prints one, two, three:
for x in [”one”,”two”,”three”]:
print(x)
The following for loop prints
Hello (string is split into
letters):
for x in ”Hello”:
print(x)
2. while loop: The while loop gets executed till given
condition is true. Following while loop prints
numbers from 2 to 10: i=2 while i <= 10:
Functions in Python
▶ Functions begin def keyword.

▶ Functions have a name and arguments (which may be blank).

▶ Return values can be specified using return statement.

▶ The folllowing function calculates factorial of given number. def fact(n):


f=1
for x in range(1,n+1,1):
f∗= x
return f
print(fact(6))
▶ Arbitrary number of arguments can be taken as argument to a function if
declared with ∗ before the argument name. Following function calcualtes
average of given numbers:
def avg(∗n):
s=1
for x in
n:
s += x
return s/len(n)
File handling in Python
▶ Files can be opened using open function.

▶ Permitted modes are: r - read, w - write, a - append, x -


write (error if file already exists.
▶ Calling close function on file object closes the file.

▶ Following function writes the string All the best


with Python programming! to a file named
copa.txt:
f = open(”copa.txt”,”w”)
f.write(”All the best with Python programming!”);
f.close()
▶ Following code reads the file copa.txt and displays
the content:
f = open(”copa.txt”,”r”)
print(f.read())
f.close()
Strings in Python
▶ Python supports single line strings and multiline strings.

▶ Single line strings begin and end with ” or ’ (double quote


or single quote).
e.g., x=”Good

y=”morning”
▶ Multiline strings begin and end with ””” or ”’ (3
consecutive double quotes or single quotes). e.g.,
x=”””Hello,
How are you?”””
▶ Parts of string may be printed using array symbol.
e.g., print(x[0:2]) would print He.
▶ lower, upper, strip (trim spaces), lstrip, rstrip, find, swapcase,
title, split, isupper, islower, istitle, isspace, isnumeric, isdigit,
isdecimal, isalnum, capitalize, endswith, startswith, splitlines,
Lists in Python

▶ Lists in Python are enclosed in [ ] (square brackets).e.g., x


= [”COPA”,”is”,”an”,”excellent”,”course”] is a valid list.
▶ Lists behave similar to arrays. List elements can be
accessed using their index (beginning in 0)
e.g.,
x = [”COPA”,”is”,”an”,”excellent”,”course”]
print(x[3])
prints the word excellent.
▶ append, clear, copy, count, extend, index, insert, pop, remove,
reverse and sort are some of the methods which can be
called upon given list.
▶ Lists allow duplicate values.
Tuples in Python

▶ Tuples in Python are enclosed in ( ) (parantheses).e.g., x =


(”COPA”,”is”,”an”,”excellent”,”course”) is a valid tuple.
▶ Tuples behave similar to arrays. List elements can be
accessed using their index (beginning in 0)
e.g.,
x = (”COPA”,”is”,”an”,”excellent”,”course”)
print(x[3])
prints the word excellent.
▶ Although tuples look similar lists, tuples elements cannot
be modified after declaration.
▶ Tuples allow duplicate values.

▶ count and index are the two methods which can be


called upon given tuples.
Dictionaries in Python

▶ Dictionaries are key value pairs sep-


arated by : symbol and enclosed in { } (curly brackets).e.g., x =
{”trade”:”COPA”,”name”:”Krish”,”year”:2022,”mark”,”100%”}
is a valid Dictionary.
▶ Dictionary does not permit duplicate entries of key
values. Newer values overwrite older values for the same
key. e.g. x[”name”]=”Ram” will change name from Krish
to Ram.
▶ Dictionary elements can be modified after declaration.

▶ New elements may be added to dictionary after


declaration.
▶ Dictionary does not allow duplicate values.

▶ clear, copy, fromkeys, get, items, keys, pop, popitem,


Arrays in Python

▶ Arrays in Python are enclosed in [ ] (square brackets).e.g., x


= [”COPA”,”is”,”an”,”excellent”,”course”] is a valid array.
▶ Arrays and lists share many similarities.

▶ Array elements can be accessed using their index


(beginning in 0)
e.g.,
x = [”COPA”,”is”,”an”,”excellent”,”course”]
print(x[3])
prints the word excellent.
▶ append, clear, copy, count, extend, index, insert, pop, remove,
reverse and sort are some of the methods which can be
called upon given arrays.
▶ Lists allow duplicate values.
Iterators in Python

▶ Iterators help to access all elements of lists, sets, tuples


and arrays sequentially.
▶ Calling next() method gives the next element of iterator.

▶ Iterator can be created using iter()


method. e.g.,
x = [”COPA”,”is”,”an”,”excellent”,”course”]
y=iter(x)
print(next(y))
print(next(y))
prints the word
COPA
followed by
is.
Datetime module in Python

▶ Datetime module provides date and time classes.

▶ Date class has three components, viz., year, month and day.

▶ Date class provides a constructor which takes year, month


and day values.
▶ Date class provides following functions: ctime,
fromisocalendar, fromisoformat, fromordinal, fromtimestamp,
isocalendar, isoformat, isoweekday, replace, strftime,
timetuples, today, toorinal and weekday.
▶ strftime may be formatted using %Y, %m, %d, %H, %M
%S, etc. for formatting date and time.
Math module in Python

▶ Math module provides several statistical, scientific


and trigonometric functions.
▶ Salient functions in math module are: math.acos.
math.acosh, math.asin, math.asinh, math.atan, math.atanh,
math.atan2, math.ceil, math.comb, math.copysign, math.cos,
math.cosh, math.degrees, math.dist, math.erf, math.erfc,
math.exp, math.expm1, math.fabs, math.factorial, math.floor,
math.fmod, math.frexp, math.fsum, math.gamma, math.gcd,
math.hypot, math.isclose, math.isinfinite, math.isinf,
math.isnan, math.isqrt, math.idexp, math.igamma, math.log,
math.log10, math.log1p, math.log2, math.perm, math.pow,
math.prod, math.radians, math.remainder, math.sin,
math.sinh, math.sqrt, math.tan, math.tanh, math.trunc.
▶ Math class provides the following constants: math.e, math.inf,
math.nan, math.pi, math.tau.
Input and output in Python

▶ Python provides a function called input for collecting


input from the keyboard.
▶ Output in Python can be provided through print function.

▶ The following code shows a simple program which


collects name of a person and offers a greeting:
name = input(”Enter your name: ”) print(”Hello
”+name+”, Have a pleasant day!”)
https://www.wikihow.com/Maintain-Lab-Computers
https://oakdome.com/k5/computer-lab-rules/

https://in.pinterest.com/pin/48554502225799381/?nic v3=1a5RdrJ

https://blogs.windows.com/windowsexperience/2021/06/24/introdu
windows-11/
https://www.plus2net.com/php tutorial/pdf-data-student.php
https://oracletutes.com/rdbms-relational-database-
management-system/
https://www.javatpoint.com/data-models
https://www.supraits.com/oracle-practice/oracle-application-
services/dba-services/

https://www.tutorialspoint.com/dbms/dbms data
https://www.javatpoint.com/mysql-join
https://support.microsoft.com/en-us/office/lookup-function-
446d94af-663b-451d-8251-369d5e3864cb
https://en.wikipedia.org/wiki/Python programming
language
https://www.excelcampus.com/charts/10-advanced-charts/
https://support.microsoft.com/en-us/office/about-power-
query-in-excel-7104fbee-9e62-4cb9-a02e-5bfb1a6c536a
https://en.wikipedia.org/wiki/History of computing
hardware.

http://www.tutorialspoint.com/computer fundamentals/computer se

http://www.tutorialspoint.com/computer fundamentals/computer th
http://www.tutorialspoint.com/computer fundamentals/computer fif

http://www.tutorialspoint.com/computer fundamentals/computer ty
http://bene.com/pics/office-furniture/workplaces/t-
workstation/t-workstation-03.jpg
http://www.apple.com/shop/buy-ipad/ipad-air-2
https://pixabay.com/en/photos/laptop/
http://www.samsung.com/us/explore/galaxy-s7-features-and-
specs/
https://www.raspberrypi.org/blog/raspberry-pi-2-on-sale/

https://en.wikipedia.org/wiki/Cloud
computing#/media/File:Cloud
https://blog.hostonnet.com/wp-
http://llg.cubic.org/docs/mouse.jpg

https://upload.wikimedia.org/wikipedia/commons/e/e3/Scanner.vie
http://cdn.makeuseof.com/wp-
content/uploads/2012/03/bambooconnect.png?b34c28

https://upload.wikimedia.org/wikipedia/commons/c/cd/HypertextEd

https://mrcenet.files.wordpress.com/2011/12/color monitor.jpg

http://static2.shop.indiatimes.com/images/products/additional/origi
tft/dell-tft-23-inch-monitor-s2330mx.jpg
http://images17.newegg.com/is/image/newegg/24-112-024-
TS?$S300$
http://us.aoc.com/images/monitors/E2476VWM6/large/E2476VWM
front.png
http://n3.sdlcdn.com/imgs/a/o/a/TVS-Electronics-MSP-430-
Printer-SDL209857912-1-7176b.jpg
http://s7.computerhistory.org/is/image/CHM/102630084p-
03-01?$re-zoomed$

http://common.ziffdavisinternet.com/encyclopedia images/CHAINP

https://upload.wikimedia.org/wikipedia/commons/5/52/IBM Selectr

http://www.jeffdwoskin.com/printers/img/character/daisywheel.jpg
http://static.electronicsweekly.com/news/wp-
content/uploads/sites/16/2015/04/01apr15LumeJet-v-
Inkjet.jpg
http://www.explainthatstuff.com/laserprinters.html
http://www.solopress.com/blog/wp-
content/uploads/2013/03/direct-thermal-printing-graphic.jpg
http://cdn2.hubspot.net/hub/108303/file-16282842-
jpg/images/c–users-stef-documents-front burner-front burner-
great lakes blog-plotter print-resized-600.jpg
http://images.pcworld.com/news/graphics/146957-8086-
chip b.jpg
http://www.us-trading-
center.com/assets/img/recycling/cpus/386-486Individual.jpg

http://www.activewin.com/reviews/hardware/processors/int
el/p422g

http://www.pcstats.com/articleimages/200703/c2de6600 frntrear.jpg
http://innoreviews.com/wp-content/uploads/2016/03/I3-
http://innoreviews.com/wp-content/uploads/2016/03/I3-
3220.jpg
http://techgage.com/wp-content/uploads/2013/12/Intel-
Core-i7-Haswell-500x362.jpg

http://www.amd.com/PublishingImages/photography/product/360p
opteron-4000.png

http://ebay.18004memory.com/ebaypics/SDRAM/PC133/DIMM/23
OX1.gif

https://upload.wikimedia.org/wikipedia/en/thumb/d/d3/Samsung d
Samsung displays first DDR4 module.jpg
http://www.informationq.com/wp-
content/uploads/2012/10/computer-Motherboard.jpg
http://s.hswstatic.com/gif/adding-a-hard-disk-1-1.jpg
http://www.zeppelincomputers.com/data/products/id1162/web tosh

https://upload.wikimedia.org/wikipedia/commons/7/7e/Floppy disk
https://images-eu.ssl-images-
amazon.com/images/I/41pS7kV8G2L.jpg
https://napa.i.lithium.com/t5/image/serverpage/image-
id/30360i84422B7A2F74F977?v=v2
http://ecx.images-amazon.com/images/I/41Yh-
ta6tUL.jpg

http://stevensoncaitlin.typepad.com/.a/6a015434c258c3970c0162fd2
pi

https://en.wikipedia.org/wiki/OS X#/media/File:OS X El Capitan s


https://en.wikipedia.org/wiki/Windows 10#/media/File:Windows 10

https://en.wikipedia.org/wiki/Windows 10 Mobile#/media/File:Win

http://allthingsd.com/files/2012/09/FXOS IconGrid.jpg

https://upload.wikimedia.org/wikipedia/commons/a/a1/Tizen scree
https://technet.microsoft.com/en-us/library/cc940018.aspx
http://networking.layer-x.com/p020000-1.html
http://computernetworkingsimplified.in/physical-layer/typical-
hardware-components-physical-layer-2/

https://btsadvancedcommunications.files.wordpress.com/
2011/11/st
https://fcit.usf.edu/network/chap4/pics/coaxial.gif
https://fcit.usf.edu/network/chap4/pics/fiberop.gif
https://www.techpluto.com/wp-
content/uploads/2009/10/tutorial-osi-7-layer-model.gif
http://cdn.ttgtmedia.com/rms/onlineImages/networking-
osi vs tcp-ip model table desktop.jpg
https://www.ibm.com/docs/en/zos-basic-skills?topic=zos-
application-development-life-cycle-overview
https://www.w3schools.com/js/js htmldom.asp
https://www.javatpoint.com/document-object-model
https://en.wikipedia.org/wiki/Visual Basic for Applications

You might also like