0% found this document useful (0 votes)
21 views190 pages

First Semister Finalist

The document provides an introduction to computers, detailing their history, advantages, hardware components, software types, and classifications based on structure and size. It explains the functional units of a computer, including input, processing, output, and storage units, as well as the evolution of computer generations from vacuum tubes to artificial intelligence. Additionally, it highlights various applications of computers across different sectors such as business, banking, education, and healthcare.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views190 pages

First Semister Finalist

The document provides an introduction to computers, detailing their history, advantages, hardware components, software types, and classifications based on structure and size. It explains the functional units of a computer, including input, processing, output, and storage units, as well as the evolution of computer generations from vacuum tubes to artificial intelligence. Additionally, it highlights various applications of computers across different sectors such as business, banking, education, and healthcare.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 190

NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

SUBJECT: INTRODUCTION TO INFORMATION COMMUNICATION TECHNOLOGY (ICT) Page | 1

MODULE 1 INTRODUCTION TO COMPUTERS

1.1 COMPUTER AND HISTORY OF COMPUTER

Q. Define Computer.
Ans. The computer is an electronic device that can accept input data. Process the data and
give the result of the process data according to instruction.and store the result.
History of Computers:
The history of computers is ancient; i.e., it goes back to some 500 years BC.
The Chinese used the first computing machine before the 15th century. The name of this
machine was Abacus. '
In 1812, an English mathematician from Cambridge University. Mr Charles Babbage
designed a machine called DIFFERENCE ENGINE.

Babbage also gave the idea of an ANAEYTICAE ENGINE


In 1946, John MaUchly and J, P. Eckert developed an Electronic, Numerical Integrator and
Computer (ENIAC).
John Vons Neumann‘s Electronic Discrete Variable Automatic Computer (EDVAC)
developed in 1950
Due to these improvements, we have now Computers, which can solve all types of
problems.
ADVANTAGES OF COMPUTERS
The following are advantage s/important of computer
Speed:-Computer works at a very high speed and are much faster than humans. Storage
computer can store large amount of data permanently user can use this data at any time.

Processing:-It can perform different type of processing like addition, subtract, division
Accuracy:-Accuracy means to provide result without any error. Computer can Process
large amount of data and generate accurate result.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Communication:-Most computers today have the capability of communicating with


other computer.
Versatile:-A computer can perform different type of task. We can use computer in
hospital, bank. Office or at home etc.
Cost reduction:-We can perform a difficult task in less time and less cost. Page | 2

1.2HARDWARE COMPONENTS:
BASIC COMPONENTS OF COMPUTER

Dig: (Block Diagram of computer)

FUNCTIONAL UNIT OF COMPUTER:


FOLLOWING ARE THE FOUR FUNCTIONAL UNIT OF COMPUTER SYSTEM

There are FOUR basic Functional Unit/elements of a computer.


1 Input Unit
2-Processing Unit (CPU)

3-Output Unit
4. Storage unit
1) Input Unit
The devices through which we enter data and instructions (Programs) into computer is called
input devices, e.g. keyboard—Mouse, Scanner, digital camera etc.
2) Central Processing Unit (CPU) -
Central Processing Unit (CPU) is the administrator section of computer. It is the brain
of computer. CPU is located on motherboard.
3) Storage Unit (Primary Memory)
NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746
NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

This memory is the place where the computer program and data are stored during processing
There is usually two type's primary storage.
RAM:-It stands for Random-Access-Memory or read/write Memory because
i n f o r m a t i o n can either be read from or written to the RAM. RAM is called volatile
or semiconductor memory. Page | 3

ROM:-It stands for Read-Only-Memory. Information can be read from ROM but
we cannot write information to it. This is the memory whose e information can be not
changed. The information stored in it cannot be lost if we turn off the Computer.
4) Output Unit
The device used to display information to the user is called output device. An output device
can be used to store, display or print the information, e.g. monitor, printer, speaker etc.

1.3 COMPUTER SOFTWARE

Software is a set of instructions that tells a computer what to do. Software is a written
computer program or a series of instructions. Software is a program that allows the
hardware to perform helpful work.
A. SYSTEM SOFTWARE
System Software is a group of programs that controls all computer operations. For
example. Operating System, utilities, device drivers.
B. Application Software.
Application Software is a type of software used to perform specific user tasks. St is used to
perform tasks such as word processor, spreadsheet, database, etc. An application is the job or
task a user wants the computer to do. Application software enables you to perform specific
tasks, solve problems, and perform work.

1.5 TYPES OF COMPUTER


There are three types of Computer concerning internal structure:

Digital Computers. b) Analog Computers, c) Hybrid Computers,


❖ Digital Computers:
In these Computers, information is represented by variables which having discrete values,I.e.,
it operates on the inputs that are ON-OFF switching. Digital computers process data. Which
is in the form of digits?
❖ Analog Computers:-
These machines process information that is continuous and which is not discrete or separate.
An Analog computer is used for measurement. Analogue computer measures Temperature
and pressure. Current Voltage and Depth etc.
❖ Hybrid Computer:-
NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746
NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Hybrid Computers combine the properties of both Digital Computers and analogue
Computers for solving problems e.g. Hybrid Computers have the speed of analogue
Computers and the accuracy of Digital Computers.

TYPES OF COMPUTER W.R.T SIZE Page | 4

❖ Super Computers: -
Super Computers are also called "Number Crunchers " because they are specialized
Computers for dealing with numbers, i.e., they can perform over 10 Mega flops (i.e., millions
floating point operations per second ). These Computers are very much expensive.
Two families of commercially available Super Computers are the CRAY-I and Cyber205
Area of Application:
weather prediction,
weapon design,
Preparing models of chemical and biological systems.
Studying the neural network of the brain.
Atomic reactor.

❖ Mainframe Computers:
. Mainframes have the facilities to communicate with large amounts of data and support
several input and output devices. A typical mainframe costs a million rupees and can
serve as many as 150 users.
These computers have a memory of several hundred Mbs and operate at a speed of
measurement in nanoseconds, e.g., IBM/360, IBM/3090, etc.
❖ Mini Computers:
These Computers are larger than PCs, both in size and other facilities such as “speed,
storage capacity, etc. These computers can serve many users at the same time. They are
costly as compared to PCs. Their speeds are rated between 1 and 50 MIPS. E.g.
Vax/11730. IBM/8370, etc.

❖ Micro Computers:
These are also called Personal Computers (PC). These are the most popular digital
Computers used in all fields of life. These are small in memory and have less processing
capability. These are also called chip computers because their entire circuitry is
fabricated on a single chip; today's microcomputer is equivalent to the main frame of
tomorrow, e.g., 1BM -PC, XT. A 1. Compatibles, 286. 386.486, 5 8 6 ,

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

GENERATION OF COMPUTER
Although the development of computers is a continuous process, it can be categorized into the
following generations based on the technology used for computer systems.
1. First Generation (1942-1955):-
All the computers developed in this generation were based on vacuum-tube technology. For example.
Page | 5
EN1AC (Electronic Numerical Integrator and Computer), Mark-1. Mark-11 etc.

Advantage
Vacuum tube technology made it possible to make electronic digital computers.
This computer could calculate data in milliseconds.
Disadvantage
These were very large.
It consumed a large amount of energy.
Very slow
Expensive.
Use machine language only.
It was heated very soon due to thousands of vacuum tubes.
2. Second Generation (1955-1964):-
The computers of this generation were based on transistor technology (Vacuum tube replaced by
transistor), and they opened the gateway to commercial development for the sale of computers.
The transistors -were tiny in size, fast in operation, and less expensive than vacuum tubes, e.g.,
EDVAC, IBM-14.
Advantages
Smaller in size than first-generation computers.
Less energy used
Produce less heat
Less costly.
The speed of these Computers was high.
Use of assembly language instead of machine language

3. Third Generation(l 964-1975)

The Computers of this generation were based on integrated circuits (ICs) technology (transistors
replaced by ICs). In the early 1960s, solid-state electronic technology was introduced. Developing
integrated circuits (ICs) is called solid-state technology or Small Scale Integration (SSI).
Integrated circuits (ICs) are the collection of many electronic devices like transistors on a single
silicon chip. This technology enabled computers to enter into the electronic revolution. IBM -360
etc.

Advantages
Smaller in size as compared to the previous generation
Less energy used
Produce less heat
More good speed, calculate data in Nano seconds.
Less expensive
It could use high-level language.
Disadvantage
Air conditioning was required

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

High technology i s required for the manufacture of IC Chips.


4. Fourth Generation Computer(1975-Present)
In this generation, microprocessors were used. The microprocessor is a small chip containing thousands
of ICs on it. It significantly reduced the size of the computer.
In this generation, a microprocessor was introduced, which caused microcomputers to be made. For
example, IBM-PC etc. Page | 6
Advantage
Very small in size
Less power consumption
Less heat generated
Best speed
General purpose
Commercial production Disadvantage
High advance technology is required for manufacturing microprocessor

5. Fifth Generation(AI)(1980-1990)
The rapid progress in computer technology is continued, and active research is going on in
different fields of computer technology
Hence, the Computers of this generation were based on the principles of AI, and also in this
generation, Software development was given more importance than Hardware, as a result of
which Artificial Intelligence was introduced, e.g., Robotics, Computer Vision etc
6.Sixth Generation(ANN’S)(Since 1990):-

The Computers of this generation are based on the principles of Artificial Neural Network Systems
(ANNS). As a result, now computers can think and decide how to solve different problems, e.g.,
character recognition.
Computer application:
Business
A computer has high speed of calculation, diligence, accuracy, reliability, or versatility, making it an
integrated part of all business organizations.it is used for:
Payroll calculations
Budgeting
Sales analysis
Financial forecasting
Managing employee database
Maintenance of stocks, etc.
Banking
Today, banking is almost dependent on computers.
Banks provide the following facilities −
Online accounting facility
checking current balance,
making deposits and overdrafts,
checking interest charges,
shares,
and trustee records.
ATMs
Insurance

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Insurance companies are keeping all records up-to-date with the help of computers.
Procedure to continue with policies
Starting date of the policies
The next due installment of a policy
Maturity date
Interests due Page | 7
Survival benefits
Bonus
Education
The computer helps provide many educational facilities.
The computer provides a tool in the education system known as CBE (Computer Based
Education).
CBE involves control, delivery, and evaluation of learning.
Computer education is rapidly increasing the number of computer students.
There are several methods in which educational institutions can use a computer to educate
students.
It is used to prepare a database about the performance of a student and analysis is carried out on
this basis.
Healthcare
Following are some significant fields of health care in which computers are used.
Diagnostic System.
Lab-diagnostic System −
Patient Monitoring System
Pharma Information System
Surgery.
Engineering Design
Computers are widely used for engineering purposes.
One of the major areas is CAD (Computer Aided Design)
Structural Engineering –
Industrial Engineering
Architectural Engineering
Military
Computers are primarily used in defense. Modern tanks, missiles, weapons, etc. The military also
employs computerized control systems. Some military areas where a computer has been used are −
Missile Control
Military Communication
Military Operation and Planning
Smart Weapons
Communication
. Some main areas in this category are −
E-mail
Chatting
Usenet
FTP
Telnet
Video-conferencing
Government

Computers play an essential role in government services. Some major fields in this category are −
NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746
NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Budgets
Sales tax department
Income tax department
Computation of male/female ratio
Computerization of voters lists
Computerization of PAN card
Weather forecasting Page | 8

Module 2 Computers - Motherboard

The motherboard serves as a single platform to connect all of the parts of a computer. It connects the
CPU, memory, hard drives, optical drives, video cards, sound card, and other ports and expansion cards
directly or via cables. It can be considered as the backbone of a computer.

2.1 Features of Motherboard


A motherboard comes with the following features −
Motherboard varies greatly in supporting various types of components.
The motherboard supports a single CPU and a few types of memory.
Video cards, hard disks, and sound cards must be compatible with the motherboard to function
correctly.
Motherboards, cases, and power supplies must be compatible to work correctly.
Popular Manufacturers
The following are the popular manufacturers of motherboards.
Intel
ASUS
AOpen
ABIT
Biostar
Gigabyte
MSI

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Description of Motherboard
The motherboard is mounted inside the case and is securely attached via small screws
through pre-drilled holes. The motherboard contains ports to connect all of the internal
components. It provides a single socket for the CPU, whereas one or more slots are normally Page | 9
available for memory. Motherboards provide ports to attach floppy, complex, and optical
drives via ribbon cables. The motherboard carries fans and a particular port designed for
power supply.
A peripheral card slot in front of the motherboard uses video cards, sound cards, and other
expansion cards to connect to the motherboard.
On the left side, motherboards carry several ports to connect the monitor, printer, mouse,
keyboard, speaker, and network cables. Motherboards also provide USB ports, which allow
compatible devices to be connected in a plug-in/plug-out fashion—for example, pen drives,
digital cameras, etc.

2.2 Central Processing Unit (CPU)


The Central Processing Unit (CPU) is the administrator section of the computer. It is
the brain of the computer. CPU is located on the motherboard. Data passes through the
CPU continually—Data comes from RAM and other units such as the keyboard a n d
drivers. CPU processes the data and sends it back to RAM and other units. CPU is
connected to all input, output, and storage devices and controls all their functions. CPU
receives the data from input .device, performs processing on data, and then sends the
result of the process data to output devices.

The CPU is the collection of two units.


❖ Control Unit (CU)
The Control Unit is the nerve center of the computer. It controls all the computer system
activities. The control unit directs and coordinates the entire Computer System in
Program instruction. It accepts data from the input device and sends it to the memory.
The data are transferred from the memory to ALU, and the result is sent to the output
unit.
❖ Arithmetic and Logic Unit (ALU)
This is the calculation section of the Computer. All arithmetic operations like addition,
subtraction, multiplication, and division, as well as some logical operations, are
performed in this section. It consists of two units: a - Arithmetic Unit b- Logic unit.
o Arithmetic Unit
The arithmetic unit of the ALU performs essential arithmetic functions as addition such as
addition, subtraction, multiplication, and division.
o Logic Unit
The logic unit of the ALU performs logical operations like comparing two data items to
find which data item is greater than, equal to, or less than the other.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

2.3 STORAGE DEVICES


Storage devices are The devices in which we store the data and information.
There are two types of storage devices
1) Main Memory /Primary memory /primary Storage Devices
Page | 10
2) Secondary Storage devices
Main or Primary Memory or Internal Memory'
The CPU's Main memory (Primary Memory) is where the computer program and data are
stored during processing. This storage unit is often called either main, internal, or
primary storage.
Primary memory is of two types:
a) RAM:-
It stands for Random-Access-Memory or read/write Memory because information can
be read from or written to the RAM. This is the memory whose information can Be
erased or changed. It is a temporary memory. Anything stored in RAM is lost when
computer is switched off.
b) ROM:-
It stands for Read-Only-Memory. Information can be read from ROM, but we can‘t write
it. This is the memory whose information cannot be changed. The information stored in
it can‘t be lost if we turn off the Computer. ROM is used to store permanent programs.
This information is available on small pieces of the memory called chips.
Secondary/Auxiliary/External Memory (Storage)
The devices of a computer that store information, such as software and data permanently,
are called secondary storage. The disk is a secondary storage device where we can store
a large amount of data and from where it can be retrieved. It has different types, e.g.,
hard disk, floppy disk, CD-ROM, magnetic tape, and magnetic drum. Following are
secondary storage devices.
a) Magnetic Disk
The magnetic Disk comprises one or more rotating platters on which data is stored
magnetically. It is made of plastic and coated on both sides with a special magnetic object
called iron oxide. There are two main types of magnetic disks, i.e., floppy disks and hard
disks.
b) Hard Disk
It comprises one or more rotating Platter. It is a circular metallic plate comparatively
thick in size and permanently sealed in a completely enclosed.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

c) Floppy Disk
It is a removable plastic Disk. It is not fixed in the computer. It is encoded with a magnetic
object, which is iron oxide. It has less storage capacity than a hard disk. You mustn't have
a floppy Disk drive to use a floppy Disk.
Page | 11
Capacity V
Size Density

5.25 '• Double 360 Kilobytes.

5.25 ― High 1.22 Megabytes

3.5 ― Double 720 Kilobytes

3.5 " High 1.44Megabyter,

d) OPTICAL DISK STORAGE


Optical Disk is a fast-growing storage medium. CD ROM is an optical disk. CD- ROM
stands for Compact Disk Read Only Memory. CD -ROM technology uses 12- a
centimeter (4.7- inch) compact disk similar to those used in stereo music systems. '

e) Magnetic Tape
Magnetic tape is a flexible plastic tape coated with magnetic iron oxide material on one
side. It is used when large amounts of data are to be processed sequentially. An advantage
NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746
NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

of magnetic tape is that it is a very cheap and economical storage medium that is very slow
in processing.
f) Magnetic Drum
It is a rotate able cylinder whose surface is coated with a magnetically sensitive iron
oxide compound. The surface is divided into several tracks, each with o n e or more fixed
Page | 12
reading and recording heads. Magnetic Drums are commonly used when very fast access
and transfer speeds are required. One disadvantage is that they cannot be removed from
a unit.
g) FLASH MEMORY
The latest and most modern storage device is a flash memory or USB, used as a secondary
storage device. It is semiconductor memory. It is the same as RAM and ROM in circuitry. It
is used as a secondary storage for moving data.

2.5 Computer – Ports


A port is a physical docking point that uses an external device to connect to the computer. It
can also be a programmatic docking point through which information flows from a program
to the computer or over the Internet.
A port has the following characteristics −
External devices are connected to a computer using cables and ports.

Ports are slots on the motherboard into which an external device cable is plugged in.
Examples of external devices attached via ports are the mouse, keyboard, monitor,
microphone, speakers, etc.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

❖ Serial Port
Used for external modems and older computer mice
Two versions: 9 pins, 25-pin models
Data travels at 115 kilobits per second
Page | 13
❖ Parallel Port
Used for scanners and printers
Also called a printer port
25 pin model
IEEE 1284-compliant Centroids port
❖ PS/2 Port
Used for old computer keyboard and mouse
Also called the mouse port
Most old computers provide two PS/2 ports for the mouse and keyboard.

IEEE 1284-compliant Centronics port


❖ Universal Serial Bus (or USB) Port
It can connect all external USB devices, such as hard disks, printers, scanners, mouse,
keyboard, etc.
It was introduced in 1997.
Most of the computers provide two USB ports as a minimum.
Data travels at 12 megabits per second.
USB-compliant devices can get power from a USB port.
❖ VGA Port
It connects the monitor to a computer's video card.
It has 15 holes.
Similar to the serial port connector. However, the serial port connector has pins, and the VGA
port has holes.
❖ Power Connector
Three-pronged plug.

It connects to the computer's power cable, plugged into a power bar or wall socket.
Firewire Port
Transfers large amounts of data at a breakneck speed.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Connects camcorders and video equipment to the computer.

Data travels at 400 to 800 megabits per second.


Invented by Apple.
It has three variants: 4-Pin FireWire 400 connector, 6-Pin FireWire 400 connector, and 9-Pin Page | 14
FireWire 800 connector.
❖ Modem Port
Connects a PC's modem to the telephone network.
Ethernet Port
It connects to a network and high-speed Internet.

Connects the network cable to a computer.


This port resides on an Ethernet Card.
Data travels at 10 megabits to 1000 megabits per second, depending upon the network
bandwidth.
❖ Game Port
Connect a joystick to a PC
Now replaced by USB
Digital Video Interface, DVI port

Connects Flat panel LCD monitor to the computer's high-end video graphic cards.
Very popular among video card manufacturers.

2.6 Power Supplies


The computer's power supply unit (PSU) converts the domestic alternating current (ac)
mains supply voltage (220-240 volts in Europe) into various regulated, low voltage direct
current (dc) outputs required by the components that make up the computer system.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Module 3 INPUT AND OUTPUT DEVICES INPUT DEVICES


The device we enter data and instructions into a computer is called an input device.
There are many input devices. Page | 15
❖ KEYBOARD:-
lt is a pervasive input device that helps key the required information into the computer.
The keyboard can effectively communicate with computers but is a prolonged input
device. The keyboard is just like a typical typewriter in shape but is more enhanced than
that. It consists of normal Alphabetic, n u m e r i c functions, and other special
characters or control keys, which are unavailable in a typewriter.
❖ MOUSE:-
A Mouse is a quick input device and is very small in size. The mouse is moved on a flat
surface to control the cursor's (pointer) movement on a screen. A mouse usually has two or
three buttons. These buttons are used to perform different tasks.
❖ THE TRACKBALL
Track Ball is a pointing device most often used in the place of the mouse. A trackball is a
stationary (motionless) device related to the mouse. It has a ball on the top, and you can
roll it directly with your hand. The trackball is used in laptop computers. There is no need
for a mouse pad for the trackball.
❖ TOUCH SENSITIVE SCREENS
A touch screen is a video display screen that receives input from the touch of a finger.
The screen is covered with a plastic layer. There are invisible beams of infrared light
behind the screen. The user enters data by touching icons or menus on the screen. Most
touchscreen computers use sensors to detect t h e touch of a finger.
❖ PEN-BASED COMPUTING (LIGHT PEN)
The pen-based devices use photoelectric circuitry to enter data into the computer
through a video screen. A user can write on the video display, and the light -sensitive pen
sends information to the computer when the user touches the pen on some regions of a
specially designed screen. Light pen is usually used by engineers, graphic designers,
and illustrators.
❖ VOICE RECOGNITION
Voice recognition is used to directly i convert spoken data into electronic form in a
computer system. Voice recognition and voice response is the most accessible data entry
and conversational methods.
❖ SCANNER
Scanner is Optical character recognition equipment that can read special-purpose
characters and codes. The scanner provides a method of directly inputting data from
source documents into a computer system.
❖ MICROPHONE

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

It is an input device used for voice input instead of the keyboard and mouse. Special software
is used to convert voice into text.
❖ VIDEO CAMERAS
Video cameras are an input devices that can capture images of any data.
❖ DIGITAL CAMERA. Page | 16
Digital Camera is used to take and store pictures in digital form. It does not use
traditional camera film. It save money and the photos can be customized using different
application software.
Digital Camera stores images using different techniques like floppy disk. Super Disk.
PC Card. Compact flash card, memory stick. Mini -CD and microdrive. The digital
camera can easily connect to a computer through a USB port.

3.5 OUTPUT DEVICES:


The output device is the device through which information is processed and brought to the
outside world. An output device can store, display or print the information (e.g. monitor,
printer, plotter, speaker etc.)
❖ MONITORS
A TV-like device that the Computer uses to display information to the outside world is
called a CRT, VDU, or Computer Screen. The different types of monitors are as
follows:
➢ MONOCHROME MONITOR:-
Monochrome means one color. Monochrome monitors display images in a single color,
usually white- or blue. Typically Monochrome is any monitor that cannot display
colors'.
➢ COLOR MONITOR:
Color monitor display output in different colors. Graphics, pictures, and colorful images
are best viewed in a color monitor.
❖ CRT monitor,
It is an old-fashioned monitor which is not used nowadays
❖ FLAT PANEL or LCD MONITORS:
Laptop PCs use flat-panel monitors. These monitors take less space. Flat panel monitors
use a variety of technologies. The most common is LCD (Liquid Crystal Display). LCD
monitor use much less power than manual monitor.
LCD monitors creates images with a special type of liquid crystal that is normally transparent
but becomes solid when charged with electricity.
❖ PRINTERS

A printer is an output device that prints characters, symbols, and graphics on paper. The
printed output is called a hard copy. Print resolution is commonly measured in dots per

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

inch (dpi). There are many types of printers, and their speeds and quality vary. Different
types of printers are as follows. i- Impact ii-Non-impact
➢ IMPACT PRINTER :
Impact printer works like a typewriter. It prints characters or images by striking a print
hammer or wheel against an inked ribbon. Impact printers are the following
Page | 17
DOT-MATRIX PRINTER
Dot Matrix printer produces printed images when tin pins on a print head strikes an inked
ribbon. When the ribbon presses against the paper, it creates dots that form characters
and graphics. The expensive p r i n t e r use 300 DPI and a speed of 3000 to 1000
character per minute.
DAISY-WHEEL PRINTERS
Daisy wheel is similar to type writer. They produce rather excellent letter quality
printout as compared the dot matrix printer. They work just like the typewriter and use a
hammer and a wheel to print something on paper. But they are very much noisy and
hence are not so popular.
➢ NON IMPACT PRINTER
Non-impact printer produces character without striking devices on paper. They are much
quieter than impact printer. The following are the non -impact printer.
LASER PRINTERS
The most expansive and quality bearer printers are the Laser printers, which produce
high-quality printout and are used for desktop publishing and graphics. A laser printer
works on the principles of a Photocopier. Simply a metal drum called TONER is filled
with special ink which, just sprinkle ink onto the paper and thus prints the character.
They are very fast and use multiple fonts for text and graphics.
INK-JET
It prints character and graphics by spraying tins drops of liquid, ink on paper. These Printers
can produce text and graphics in both black and-white and color. Inkjet printer is slower
than laser printers. They can print 1 to 6 pages per minute. Its print quality is higher than
dot matrix printer.
❖ PLOTTERS
A plotter is an output device that is used to produce image quality graphics in a variety of
colors. Plotters works by drawing lines on paper using pens held in a mechanical arm. They
are mostly used for Engineering and Maps drawing purposes.
❖ SPEAKER and HEADSET
A speaker is an output device that produces audio output. These devices produce music,
speech, or other sounds like beeps etc. Speakers and Headsets are two commonly used
audio output devices. It produces softcopy output. We use speakers to hear any type of
sound.

❖ Smart board
An interactive whiteboard, also known as a smart board, is an interactive display in the
whiteboard format that reacts to user input directly or through other devices.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

NOTE: MODULE 4 IS REPEATED ALREADY DISCUSS BEFORE

Module 5 Operating systems


Page | 18

5.1 Operating systems


An operating system (OS) is a set of programs that manage computer hardware resources
and provide common services for application software. The operating system is the most
important type of system software in a computer system. A user cannot run an application
program on the computer without an operating system, unless the application program is self-
booting.
Examples of popular modern operating systems include Android, iOS, Linux, Mac OS X, all
of which have their roots in Unix, and Microsoft Windows.

5.2 functions of an operating System.


Memory Management
Processor Management
Device Management
File Management
Network Management
Security
Control over system performance
Job accounting
Error detecting aids
Coordination between other software and users

❖ Memory Management
Memory management refers to management of Primary Memory or Main Memory. Main
memory is a large array of words or bytes where each word or byte has its own address.
Keeps tracks of primary memory, i.e., what part of it are in use by whom, what part
are not in use.
In multiprogramming, the OS decides which process will get memory when and how
much.
Allocates the memory when a process requests it to do so.
De-allocates the memory when a process no longer needs it or has been terminated.
❖ Processor Management
In multiprogramming environment, the OS decides which process gets the processor when
and for how much time. This function is called process scheduling. An Operating System
does the following activities for processor management −
Keeps tracks of processor and status of process. The program responsible for this task
is known as traffic controller.
Allocates the processor (CPU) to a process.
NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746
NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

De-allocates processor when a process is no longer required.


❖ Device Management
An Operating System manages device communication via their respective drivers. It does the
following activities for device management −
Keeps tracks of all devices. Program responsible for this task is known as the I/O
Page | 19
controller.
Decides which process gets the device when and for how much time.
Allocates the device in the efficient way.
De-allocates devices.
❖ File Management
A file system is normally organized into directories for easy navigation and usage. These
directories may contain files and other directions.
Decides who gets the resources.
Allocates the resources.
De-allocates the resources.
Other Important Activities
Following are some of the important activities that an Operating System performs −
Security − By means of password and similar other techniques, it prevents unauthorized
access to programs and data.
Control over system performance − Recording delays between request for a service and
response from the system.
Job accounting − Keeping track of time and resources used by various jobs and users.
Error detecting aids − Production of dumps, traces, error messages, and other debugging
and error detecting aids.
Coordination between other softwares and users − Coordination and assignment of
compilers, interpreters, assemblers and other software to the various users of the computer
systems.

5.3 Types of Operating Systems (OS)


An operating system is a well-organized collection of programs that manages the computer
hardware. It is a type of system software that is responsible for the smooth functioning of the
computer system.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Page | 20

1)Batch Operating System


In the 1970s, Batch processing was very popular. In this technique, similar types of jobs were
batched together and executed in time. People were used to having a single computer which
was called a mainframe.

Â
Backward Ski

Advantages of Batch OS
1.The use of a resident monitor improves computer efficiency as it eliminates CPU time
between two jobs.
Disadvantages of Batch OS
1. Starvation
2. Not Interactive
2)Multiprogramming Operating System
Multiprogramming is an extension to batch processing where the CPU is always kept busy.
Each process needs two types of system time: CPU time and IO time.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

In a multiprogramming environment, when a process does its I/O, The CPU can start the
execution of other processes. Therefore, multiprogramming improves the efficiency of the
system.

Page | 21

Advantages of Multiprogramming OS
Throughout the system, it increased as the CPU always had one program to execute.

Response time can also be reduced.


Disadvantages of Multiprogramming OS
Multiprogramming systems provide an environment in which various systems resources are
used efficiently, but they do not provide any user interaction with the computer system.
3) Multiprocessing Operating System
In Multiprocessing, Parallel computing is achieved. There are more than one processors
present in the system which can execute more than one process at the same time. This will
increase the throughput of the system.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

In Multiprocessing, Parallel computing is achieved. More than one processor present in the
system can execute more than one process simultaneously, which will increase the
throughput of the system.

Advantages of Multiprocessing operating system:


Increased reliability: Due to the multiprocessing system, processing tasks can be distributed Page | 22
among several processors. This increases reliability as if one processor fails, the task can be
given to another processor for completion.
Increased throughout: As several processors increase, more work can be done in less.
Disadvantages of Multiprocessing operating System
Multiprocessing operating system is more complex and sophisticated as it takes care of
multiple CPUs simultaneously.
4) Multitasking Operating System

The multitasking operating system is a logical extension of a multiprogramming system that


enables multiple programs simultaneously. It allows a user to perform more than one
computer task at the same time.
Advantages of Multitasking operating system
This operating system is more suited to supporting multiple users simultaneously.
The multitasking operating systems have well-defined memory management.
Disadvantages of Multitasking operating system
The multiple processors are busier simultaneously to complete any task in a multitasking
environment, so the CPU generates more heat.
5) Network Operating System

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Page | 23

An operating system that includes software and associated protocols to communicate with
other computers conveniently and cost-effectively via a network is called a network operating
system.
Advantages of Network Operating System
In this operating system, network traffic is reduced due to the division between clients and
the server.
This type of system is less expensive to set up and maintain.
Disadvantages of Network Operating System
In this type of operating system, the failure of any node in a system affects the whole system.
Security and performance are important issues. So, trained network administrators are
required to administer the network.
6) Real-Time Operating System
In Real-Time Systems, each job carries a specific deadline within which it is supposed to be
completed; otherwise, there will be a huge loss, or even if the result is produced, it will be
completely useless.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Page | 24

The Application of a Real-Time system exists in the case of military applications, if you want
to drop a missile, then the missile is supposed to be dropped with a certain precision.
Advantages of Real-time operating system:
Easy to layout, develop and execute real-time applications under the real-time operating
system.
In a Real-time operating system, the maximum utilization of devices and systems.
Disadvantages of Real-time operating system:
Real-time operating systems are very costly to develop.
Real-time operating systems are very complex and can consume critical CPU cycles.
7) Time-Sharing Operating System
In the Time Sharing operating system, computer resources are allocated time-dependent to
several programs simultaneously. Thus it helps to provide a large number of user's direct
access to the main computer. It is a logical extension of multiprogramming. In time-sharing,
the CPU is switched among multiple programs given by different users on a scheduled basis.

A time-sharing operating system allows many users to be served simultaneously, so


sophisticated CPU scheduling schemes and Input/output management are required.
Time-sharing operating systems are very difficult and expensive to build.

Advantages of Time Sharing Operating System


The time-sharing operating system provides effective utilization and sharing of resources.
NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746
NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

This system reduces CPU idle and response time.

Disadvantages of Time Sharing Operating System


Data transmission rates are very high in comparison to other methods.
Security and integrity of user programs loaded in memory and data need to be maintained as Page | 25
many users access the system at the same time.

5.3 Utility Software


Utility software is application software that assists OS in carrying out certain specialized
tasks. Let us look some of the most popular utility software.
❖ Antivirus
A virus can be defined as a malicious program that attaches itself to a host program and
makes multiple copies of it, slowing down, corrupting or destroying the system. Antivirus is
software that assists the OS in providing a virus-free environment to the users. An anti-virus
scans the system for any virus and if detected, gets rid of it by deleting or isolating it. It can
detect many types of virus like boot viruses, Trojans, worms, spyware, etc.
❖ File management tools
As you know, file management is an essential function of operating systems as all data and
instructions are stored in the computer in the form of files. Utility software providing regular
file management tasks like browsing, search, update, previewing, etc. are called file
management tools. Windows Explorer in Windows OS, Google desktop, Directory Opus,
Double Commander, etc. are examples of such tools.
❖ Compression tools
Compression tools are utilities that assist operating systems in shortening files to take less
space. After compression files are stored in a different format and cannot be read or edited
directly. It needs to be uncompressed before it can be accessed for further use. Some of the
popular compression tools are WinRAR, PeaZip, The Unarchiver, etc.
❖ Disk Cleanup
Disk clean-up tools assist users in freeing up disk space. The software scans hard disks to
find no longer used files and frees up space by deleting them.
❖ Disk Defragmenter
Disk defragmenter is a disk management utility that increases file access speeds by
rearranging fragmented files on contiguous locations. Large files are broken down into
fragments and may be stores in non-contiguous locations if contiguous ones are not
available.
Backup
Backup utility enables backing up of files, folders, databases or complete disks. Backups are
taken to restore data in case of data loss. Backup is a service provided by all operating
systems. Backup may be taken on the same or different drive in stand-alone systems. In case
of networked systems backup may be done on backup servers.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

5.5 Computer maintenance


1. Dust your keyboard using compressed air
2. Wipe down your monitor
3. Get rid of your mouse’s dust and particles
Page | 26
4. Clean your system thoroughly
5. Power down or reboot your device regularly

6. Defragment the hard drive


7. Backup data
8. Configure your start-up
9. Run disk clean-up
10. Install major computer updates
11. Update antivirus software

12. Change your passwords regularly


13. Check for firmware updates
14. Complete signature updates
15. Consider parental controls
16. Move similar files into folders
17. Delete unused programs

18. Clear out the Recycling Bin


19. Remove temporary internet files
20. Transfer files to the cloud
21. Avoid overheating your device
22. Keep your cords organized
23. Don’t overcharge your device

24. Keep food and drinks away


25. Avoid spam while browsing

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

For more info, visit our website:


www.ncmt.edu.pk

Or Page | 27

Contact us at Whatsapp:
03499614746

03305822150

NISAR COLLEGE OF MANAGEMENT AND TECHNOLOGY (NISCOM)


MINGORA SWAT

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

MODULE 6 Functions of Application Software


Application software programs are generally designed and developed to help with various tasks. Here
are a few examples: Page | 28

Software for healthcare applications for seamless connectivity and quick response

Managing information and data in an organization

Managing and checking documents across

Software for educational purposes, such as Learning Management Systems and e-learning
systems

Development of visuals and video for presentation purposes

Emails, text messaging, audio and video conferencing involved in the presentation

Management of accounting, finance, and payroll helping the HR department and other
businesses

Enterprise Resource Planning (ERP)

Customer Relationship Management (CRM)

Management of any small or large scale project

Management of smooth and efficient business processes

Examples of Application Software

The most frequent applications used by millions of people daily are listed below.

• A collection of Microsoft software including MS Office, PowerPoint, Word, Excel, and Outlook.

• Common Internet browsers like Google Chrome, Safari, Firefox, etc.

• Graphics and designing software such as Canva, Adobe Photoshop, CorelDraw, and AutoCAD.

• Real-time online communication tools like Skype, Hangouts, Google Meet, Zoom, and Whatsapp for
video and audio calls and messages.

• Multimedia and music streaming software such as Wynk, Gaana, MX Player, VLC Media Player,
Spotify, Pandora, etc. are used for entertainment purposes.

• Project management software like Teams, Asana, Zoho, Slack, Forecast, etc for official purposes.

Word processing:

Word processing describes creating or editing a document using a word processor, such as Microsoft
Word, Google Docs, or OpenOffice Writer. For example, a student could create a book report using a
Word processor application. Then, the student could print it, save it to a disk, display it on the screen, or
send it over e-mail. Also, a person looking for a job could create a résumé using a word processor, then
e-mail or print and mail it to job recruiters.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

spreadsheet
A spreadsheet is a computer program that captures, displays, and manipulates data arranged in rows and
columns. Spreadsheets are one of the most popular tools available with personal computers.A
spreadsheet is generally designed to hold numerical data and short text strings. In a spreadsheet
program, spaces that hold items of data are called spreadsheet cells. These can be renamed to better
reflect the data they hold and can be cross-referenced through row numbers and column letters.
Page | 29
Database Software

Database software is a program or utility used to create, edit and maintain database files and records.
This type of software allows users to store data in structured fields, tables, and columns, which can then
be retrieved directly and through programmatic access.

Presentation Software

Presentation software is a category of application software that is specifically designed to allow users to
create a presentation of ideas by stringing together text, images and audio/video. The presentation tells a
story or supports speech or the presentation of information.

Project Management Software

Project management software is used for project planning, scheduling, resource allocation and change
management. It allows project managers (PMs), stakeholders and users to control costs and manage
budgeting, quality management and documentation and also may be used as an administration system.
Project management software is also used for collaboration and communication between project
stakeholders.

Accounting Software

Accounting software is a computer program that assists bookkeepers and accountants in recording and
reporting a firm's financial transactions. The functionality of accounting software differs from product
to product. Larger firms may choose to implement a customized solution that integrates a vast amount
of data from many different departments. Small firms often choose an off-the-shelf product.

WHAT IS CAD/CAM

CAD (computer-aided design):


Computer-aided design is the integration of computers and graphics to aid in the areas of
design and drafting. Computer-aided design and drafting software are design for
mechanical designer and draftsmen, but also for the other fields.
Architectural firms use a form of CAD. Use of CAD architecture can draw different designs
like room plans and structural models. Computer-aided design, or simply CAD, is the
combination of hardware and software components providing the tool of planning,
designing, and modeling.
MCAD (mechanical CAD).
Engineers use it to design complex parts of different machines.
AEC (architecture engineering and construction)
It is used for creation of buildings and their system.
GIS (geographical information system)
to generate maps from topographic data. Automobile designers at large auto manufacturing plants
use cad to design many prototypes of different cars before creating solid models.
CAM (computer-aided manufacturing):
CAM is a form of automation where computers communicate work instructions d i r e c t l y
to the manufacturing machinery. Today a single computer can control banks of robotics
milling machine, lathes, and welding machine and other tools. Computer control of the
NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746
NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

factory machines in the manufacturing process is called computer-aided manufacturing


(CAM).
Computer Numerical Control (CMC):
- is the system in which the operator programs t h e computer that controls the milling
process apparatus. A human does not attend the actual machine. Unlike humans, a computer
controls difficult tasks. CMC devices make it possible to cut more difficult parts with greater
precision. Often a CNC machine is connected to a CAD workstation. By watching the Page | 30
monitor, the CNC operator can view the part as the machine is making it.
Typing tutor:

A typing tutor is a tool designed to help the user enhance their typing skills. This can be done by
repeatedly taking lessons, playing games, or giving a typing test.
Typing Master

Typing Master is a web-based platform. It is a complete package with real-time meter analysis that
analyzes the user's progress and then designs the tests according to the user's progress.

Features of Typing Master

o This software analyses and teaches typing skills to the user.


o Users can check how many words they can write in a minute.
o It also offers a pro version used by data entry companies to check their job applicants' typing
speed (words per minute).
o It offers typing games that also help the user improve their typing speed.

MODULE 7 INTRODUCTION TO WORLD WIDE WEB

The World Wide Web (WWW) is a collection of documents and other web resources that are
identified by URLs, interlinked by hypertext links, and can be accessed and searched by browsers via
the Internet. World Wide Web is also called the Web and it was invented by Tim Berners-Lee in 1989.

Client (Browser):

Web browser is a program used to communicate with web server on the Internet.

Each browser has three parts: a controller, client protocol, and interpreter.

The controller receives input from input device and use the programs to access the documents.

After accessing the document, the controller uses one of the interpreters to display the document on the
screen.

Server:

A computer that is available for the network resources and provides service to the other computer on
request is known as a server. The web pages are stored at the server. The server accepts a TCP
connection from a client browser. It gets the name of the file required.

Uniform Resource Locater (URL)

The URL is a standard for specifying any information on the Internet.

The URL consists of protocol, host computer, port, and path.

The protocol is the client or server program which is used to retrieve the document or file. The
protocol can be ftp or http.

The host is the computer's name on which the information is located.


NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746
NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

The URL can optionally contain the port number separated from the hostname by a colon.

The path is the pathname of the file where the file is stored.

❖ FTP (File Transfer Protocol)

• FTP is File Transfer Protocol. Page | 31


• It used to exchange files on the internet.
• To enable the data transfer FTP uses TCP/IP; FTP is most commonly used to upload and download
files from the internet.
• FTP can be invoked from the command prompt or some graphical user interface.
• FTP also allows to update (delete, rename, move, and copy) files on a server.
• It uses a reserved port no 21.

❖ DHCP

• Dynamic Host Configuration Protocol (DHCP) is used to assign IP addresses to computers in a


network.
• The IP addresses are assigned dynamically.
• Certainly, using DHCP, the computer will have a different IP address whenever it is connected to the
network.
• The IP address may sometimes change even when the computer is in the network.
• This means that DHCP leases out the IP address to the computer for some time.
• The clear advantage of DHCP is that the software can manage IP addresses rather than the
administrator.

❖ HTTP

• The Hypertext Transfer Protocol (HTTP) is used to access the data on WWW (World Wide Web).
• The functions of HTTP are the combination of FTP (File Transfer Protocol) and SMTP (Simple Mail
Transfer Protocol).
• HTTP is similar to FTP, because it uses only one TCP connection (data is transferred between Client
and Server).
• HTTP uses the services of TCP on well-known port 80.

❖ Telnet

• It is an application layer protocol that can be used on the internet or in a local area network (LAN).
• It provides a bi-directional interactive text-oriented communication service by using the virtual
terminal connection.
• Telnet is basically a client-server protocol, which is based on a reliable connection- oriented transport.
• It uses port 23 to establish the connection with TCP (Transmission Control Protocol).

❖ SMTP (Simple Mail Transport Protocol)

• It is an internet standard for e-mail Transmission.


• SMTP connections are secured with SSL (Secure Socket Layer).
• In SMTP, the messages are stored and then forwarded to the destination.
• SMTP uses a port number 25 of TCP.

What is ecommerce?
"Ecommerce" or "electronic commerce" is trading goods and services on the internet. It is your bustling
city center or brick-and-mortar shop translated into zeroes and ones on the internet superhighway. An
estimated 2.14 billion people worldwide buy goods and services online, and the number of Prime
members shopping Amazon stores globally now tops 200 million.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

What is an e-commerce website?


An e-commerce website is your digital storefront on the internet. It facilitates the transaction between a
buyer and seller. It is the virtual space where you showcase products, and online customers make
selections. Your website acts as your online business channel's product shelves, sales staff, and cash
register.

Businesses might create a branded store experience on a store like Amazon, build their own commerce
Page | 32
site on a dedicated domain, or do it all for a multi-channel approach.
What is an e-commerce business?
An e-commerce business is a company that generates revenue from selling products or services online.
For example, an e-commerce company might sell software, apparel, housewares, or web design
services. You can run an e-commerce business from a single website or through multiple online
channels like social media and email.
How does e-commerce work?
Ecommerce works by connecting buyers and sellers using various electronic channels. For example,
you need a channel, such as a website or social media, so customers can find products and services to
purchase. Then, a payment processor enables the exchange of the goods or services. Once the
transaction succeeds, the customer receives a confirmation email, SMS, and a printable receipt.

If the transaction is for goods, then the seller ships the items and sends the customer a tracking number
via email or SMS. If the transaction is for a service, the service provider can schedule and complete the
service.
Steps to starting an E-commerce Business
The steps to starting an e-commerce business can vary depending on factors like what you want to sell.
For example, if you're selling services, then there’s no need to manage inventory or fulfillment.
However, if you want to sell products online, then inventory and fulfilment will likely play a critical
part in your operations.

Here are some steps you can follow to get started:

1. Research business ideas

2. Make sure there’s demand for the products you want to sell

3. Determine how you'll sell and ship products to customers

4. Find suppliers and manufacturers

5. Choose which online channels you'll sell through (e.g., an Amazon store)

6. Create a website or online storefront and upload products

7. Create a plan for your fulfilment strategy

8. Begin attracting customers with promotions

What are the types of ecommerce?


Ecommerce takes as many different forms as there are various ways to shop online channels. A few
common business models that shape the world of ecommerce are:

• B2C – Businesses sell to individual consumers (end-users). The most common model with many
variations.

• B2B – Businesses sell to other businesses. Often the buyer resells products to the consumer.

• C2B – Consumers sell to businesses. C2B businesses allow customers to sell to other companies.

• C2C – Consumers sell to other consumers. Businesses create online marketplaces that connect
consumers.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

• B2G – Businesses sell to governments or government agencies.

• C2G – Consumers sell to governments or government agencies.

• G2B – Governments or government agencies sell to businesses.

• G2C - Governments or government agencies sell to consumers.


Page | 33

COMPUTER VIRUSES:
What is Virus?
Biologically, a Virus is defined as a tiny scrap of genetic code that attacks a living cell
and produces replications of it.

What is Computer Virus?


Computer Virus is a small program that attaches itself to another program and often
attacks software by making copies of it. Like biological viruses, they can also be spread
from one computer system to another while swapping disks or via computer networks. A
Computer Virus is a program that replicates itself by attaching itself to another
program. The latest count includes thousands of Viruses that have infected the
Computers.
ANTI-VIRUS SOFTWARE:-
Many companies in the US sell computer software to protect computer systems from
Virus infections. These include programs with names like Toolkit, Virus-Scan,
Vaccine, etc. Anti- Virus programs use Virus signatures to detect know computer
Viruses. A Virus signature is a series of hexadecimal codes that uniquely identify a
Virus. We can enable Anti-Virus to detect new Viruses by updating the signature file.
COMPUTER CRIME
Computer crime can be defined as any crime committed using the special knowledge or
expert use of computer technology. Computer crime became a serious problem in the
late 20lh century, since the first reported case of computer crime in 1958. Computer have
been involved in most types of crimes, including theft, burglary, larceny, fraud,
embezzlement, extortion, sabotage, espionage, kidnapping and murder. Computer
systems can be targets of attack, as when a computer virus is secretly introduced into a
system to alter or destroy data.
What is Virus Hoax?
Virus hoaxes are false reports about non-existent viruses, often claiming to do
impossible things. Some recipients occasionally believe a hoax to be a true virus
warning and may take drastic action such as shutting down their network.

IMPACT OF COMPUTER ON SOCIETY


The Computer and Society:- Computers increasingly affect our lives in many, ways ,
which benefit individual and society as a whole. In medicine, computerized Databases,
networks, diagnostic devices, and monitoring systems helps doctors and hospital
personnel to save lives.
Hence, there are two types of impacts of computers on people:
1-Positive Impacts.
2-Negative Impacts.
1. Positive Impact:-
Employment benefits
Greater efficiency
Higher quality products
Aid to the disabled
Improved Safety
NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746
NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Better information retrieval


Educational Benefits
Computer in the Banks
Computer in the Industries
Computer in Education Page | 34
Computer simulation for training
Computer-aided Design
Computer in Health Care
Computer and law
Computer in the Home

❖ MISCUSES OF COMPUTER
Hacking
Immorality
Security Problems
Wastage of Time
Cyber Crime
Others are
The excessive use of computers damages eye sight.
Playing movies.
Mostly the, students and teenage uses it for playing different games

THE END
OF

INFORMATION COMMUNICATION TECHNOLOGY (ICT)

PREPARED BY

ENGR.NISAR AHMAD

(B.SC (PAK) B.S (TURKIA) M.S (TURKIA)

CCNA, MCSE, MCDBA

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

SUBJECT: COMPUTER NETWOK NEW COURSE 2023


Page | 35

MODULE 1 BASIC TERMINOLOGIES

A computer network is a system in which multiple computers are connected to share information and
resources.

Characteristics of a Computer Network

• Share resources from one computer to another.


• Create files and store them in one computer,
• Connect a printer, scanner, or a fax machine to one computer.
Host:

A host is any hardware device that can permit access to a network via a user interface, specialized
software, network address, protocol stack, or any other means.

Sender: A sender is a computer or device capable of sending data over a network. It can be a computer,
mobile phone, smart watch, walkie- talkie, video recording device,

Receiver: A receiver is a computer or any such device capable of receiving data from the network.

Media :

There are two main types of transmission media in computer networks. These are guided and unguided
media. While guided media requires a physical medium, unguided media requires air for
communication.

Message:

Any data transmitted over a network that is intended for human interpretation.

Protocol:

In networking, a protocol is a set of rules for formatting and processing data. Network protocols are like
a common language for computers. The computers within a network may use vastly different software
and hardware; however, protocols enable them to communicate with each other regardless.

Receiver: A device that accepts a signal from the transmission system and converts it into a usable
form for the destination device.

Destination: Accepts the incoming data from the receiver. The destination device can be a telephone, a
computer, a network switch, etc.

Networks are often classified by their physical or organizational extent or their purpose.
NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746
NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Usage, trust level, and access rights differ between these types of networks.

Types of Network/Classification of Computer Network

1) Personal area network


Page | 36

A personal area network (PAN) is a computer network used for communication among
computers and different information technological devices close to one person. Some
examples of devices used in a PAN are personal computers, printers, fax machines,
telephones, PDAs, scanners, and even video game consoles. A PAN may include wired and
wireless devices.

2) Local area network


A local area network (LAN) is a network that connects computers and devices in a limited
geographical area such as a home, school, computer laboratory, office building, or closely
positioned group of buildings. Each computer or device on the network is a node.

1) Metropolitan area network


A Metropolitan area network (MAN) is a large computer network that usually spans a
city or a large campus.

A sample EPN was made of frame relay WAN connections and dialup remote access.

1) Wide area network


A wide area network (WAN) is a computer network that covers a large geographic area
such as a city, or country, or spans even intercontinental distances, using a
communications channel that combines many types of media such as telephone lines,
cables, and air waves. A WAN often uses transmission facilities provided by common
carriers, such as telephone companies. WAN technologies generally function at the lower
three layers of the OSI reference model: the physical layer, the data link layer, and the network
layer.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

2) Virtual private network


A virtual private network (VPN) is a computer network in which some of the links
between nodes are carried by open connections or virtual circuits in some more extensive
network (e.g., the Internet) instead of by physical wires.

3) Internetwork

Internetwork is the connection of multiple computer networks via a common routing


technology using routers. The Internet is an aggregation of many connected internetworks
spanning the Earth.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

MODULE 2 TOPOLOGY
The physical layout of a network is called network topology. The physical topology of a
network refers to the configuration of cables, computers, and other peripherals. Physical
topology should not be confused with logical topology, the method used to pass
information between workstations. Logical topology was discussed in the Protocol chapter

Main Types of Physical Topologies

The following sections discuss the physical topologies used in networks and other
related topics.

• Linear Bus
• Star
• Tree (Expanded Star)
• Ring topology
• Mesh Topology
• Hybrid Topology

1) Linear Bus
A linear bus topology consists of a main run of cable with a terminator at each end. All
nodes (file server, workstations, and peripherals) are connected to the linear cable.

Advantages of a Linear Bus Topology

• Easy to connect a computer or peripheral to a linear bus.


• Requires less cable length than a star topology.

Disadvantages of a Linear Bus Topology

• The entire network shuts down if there is a break in the main cable.
Terminators are required at both ends of the backbone cable.
• It is difficult to identify the problem if the entire network shuts down.
• It is not meant to be used as a stand-alone solution in a large building.

2) Star Topology

A star topology is designed with each node (file server, workstations, and
peripherals) connected directly to a central network hub, switch, or concentrator
(See fig. 2).

Data on a star network passes through the hub, switch, or concentrator before continuing
to its destination. The hub, switch, or concentrator manages and controls all functions of
the network. It also acts as a repeater for the data flow. This configuration is common with
twisted pair cable; however, it can also be used with coaxial cable or fiber optic cable.

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Advantages of star topology:

• Easy to install and wire.


• No disruptions to the network when connecting or removing devices.
• Easy to detect faults and to remove parts.

Disadvantages of a Star Topology

• Requires more cable length than a linear topology.


• If the hub, switch, or concentrator fails, the nodes attached are disabled.
• More expensive than linear bus topologies because of the cost of the hubs,
etc.

3) Tree or Expanded Star

A tree topology combines characteristics of linear bus and star topologies. It consists of
groups of star-configured workstations connected to a linear bus backbone cable (See fig.
3). Tree topologies allow for expanding an existing network and enable schools to
configure a network to meet their needs.

Advantages of tree topology:

• Point-to-point wiring for individual segments.


• Supported by several hardware and software vendors.

Disadvantages of a Tree Topology

• The overall length of each segment is limited by the type of cabling used.
• If the backbone line breaks, the entire segment goes down.
• More difficult to configure and wire

NISAR COLLEGE HAJI BABA ROAD MINGORA 0349-9614746


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

4) Ring topology?

A ring topology consists of a set of stations connected serially by cable. In other words,
it‘s a circle or ring of computers. There are no terminated ends to the cable; the signal
travels around the circle in a clockwise direction.

Advantages of ring topology:

• Growth of the system has minimal impact on performance


• All stations have equal access

Disadvantages of ring topology:

• Most expensive topology


• Failure of one computer may impact others
• Complex

5) MESH TOPOLOGY:
In mesh topology, every node is connected to every other node.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

MODULE 3 NETWORKING DEVICES

Computer network devices, also known as communication devices, constitute a data


communication network. These devices are routers, switches, hubs, LAN cards, gateway,
modems, hardware firewalls, CSU/DSU, ISDN terminals, and transceivers. In an Ethernet
or WAN network, data communication cannot be performed without these devices. You
must understand these devices well as an IT professional or a network administrator.

1. Node
2. Routers
3. Switches
4. Hubs
5. Modems
6. LAN Cards
7. Multiplexer
8. Bridge
9. NIC Card
10. Repeater
11. B-router
12. Gateways

1. Node

In communication networks, a node (Latin


nodus, ‗knot‘) is a connection point, either a
redistribution point or a communication
endpoint (some terminal equipment). The
definition of a node depends on the network
and protocol layer referred to. A physical
network node is an active electronic device
attached to a network, capable of sending,
receiving, or forwarding information over a
communications channel.

2. Routers

A router is a communication
device that is used to connect two
logically and physically different
networks, two LANs, two WANs
and a LAN with WAN. The main
function of the router is to sorting
and the distribution of the data
packets to their destinations based
on their IP addresses. Routers
provides the connectivity between
the enterprise businesses, ISPs and
in the internet infrastructure, router
is a main device. Cisco routers are
widely used in the world.

3. Switches

Like the router, a switch is an


intelligent device that maps the IP
address with the MAC address of
[Type text] [Type text]
NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT
the LAN card. Unlike the hubs, a
switch does not broadcast the data
to all the computers; it only sends
the packets to the destined
computer. Switches are used in the

4. Hubs

The central connecting device in a


computer network is known as a
hub. There are two types of a hub
i.e. active hub and passive hub.
Every computer is directly
connected to the hub.

5. Modems

A modem is a
communication device that
is used to provide
connectivity with the
internet. Modem works in
two ways i.e. modulation
and demodulation. It
coverts the digital data into
the analog and analog to
digital.

6. LAN Cards

LAN cards or network adapters are the building blocks of a computer network. No
computer can communicate without a properly installed and configured LAN card. Every
LAN card is provided with a unique IP address, subnet mask, gateway and DNS (if
applicable). An UTP/STP cable connects a computer with the hub or switch. Both ends of
the cable have the RJ-45 connectors one is inserted into the LAN card and one in the
hub/switch. LAN cards are inserted into the expansion slots inside the computer. Different
LAN cards support different speed from 10/100 to 10/1000.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

6) Multiplexer

A multiplexer is a device that is used to combine several electrical signals into one signal.

7) Bridge

A bridge is a network
communication device used to
connect one segment of the
network with another that uses
the same protocol. It operates at
the Data link layer of the OSI
layers model. In the Ethernet
network, the bridge is also
known as IEEE 802.1D. A
bridge processes the information at the data link layer of the OSI layers model. There are

8) NIC Card

NIC Stands for Network Interface card. It is one of the most important computer network
devices that are used for the
data communication and to
connect computers. It is
plugged inside the computer
either in the PCI slot or built
into the motherboard.

9) Repeater

Repeater is a communication device that retransmits the weak signals with greater power.
It receives the signals over the wireless, optical transmission, and network cable mediums
such as copper wire, UTP/STP and fiber optic cables and regenerates the analog or digital
signals. It can relay the data signals between the different subnetworks.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

MODULE 4 TRANSMISSION MEDIA

WHAT IS TELECOMMUNICATIONS MEDIA/CHANNEL. Discuss its different types.

Telecommunications Media/channels (also called communications lines or links) is


the path that connects sender and receiver to transfer data between sending and receiving
devices in a telecommunications network:
There are different types of telecommunication media/channels, which are the following.
1) BOUNDED guided medial:

1.1)TWISTED PAIR CABLE:


A twisted pair wire consists of two strands of insulated copper wire twisted around each other
in pairs. Another layer of plastic insulation then covers them. Twisted pair cabling is the same
system used for home and office telephone systems and local area networking.
Advantage: - It is expensive and easy to install.
Disadvantage: - It creates noise, and its transmission is quickly interrupted

1.2)COAXIAL CABLE
Coaxial cable consists of insulated copper or aluminum wire covered by insulating
material. The insulated copper wire is covered by copper mesh. It is widely used for
cable television and local area networks. Advantage: - The extra insulation makes
coaxial cable much better at resisting noise than twisted pair wiring. These can
transmit data much faster than twisted pairs.

1.3) FIBER OPTIC CABLE

A fiber-optic cable consists of hundreds or thousands of thin strands of glass that


transmit pulsating beams of light instead of electricity. It is thinner than a human hair.
The data transfer rate of fiber optics is high-speed. There is no chance of data loss. The
light pulse is not affected by random electromagnetic interference i n the environment.
They have much lower error rates than average telephone twisted pair or coaxial cable.
Advantage: -A final advantage is that it cannot be easily wiretapped or listened to, making
transmissions more secure.
Disadvantage: The main drawbacks until recently have been the cost of the materials
and the inability to bend around tight covers.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

2)UNBOUNDED/UNGUIDED MEDIA OR WIRELESS MEDIA

2.1) Terrestrial Microwave or Microwave


Microwaves are radio waves that provide high -speed •transmission. Microwave
systems transmit high-speed radio signals in a line-of-sight path between relay stations
located approximately 30 miles apart. Microwave antennas are usually placed on top of
buildings, towers, hills, and mountain peaks. They are still a popular medium for long-
distance and metropolitan area networks. There is no cable involved.
2.2) Communications Satellites
A communication satellite is a space station. It receives microwave signals from the
Earth station. It amplifies the signal and retransmits it back to earth. The communication
satellite is established in space about 23,300 miles above earth. The data transfer speed
of communication satellites is very high. The transmission from the earth station to the
satellite is called uplink. The transmission from a satellite to an earth station is called
downlink. There is no insight path problem.
2.3) Cellular radio
Cellular radio is a broadcast radio used for mobile communications. It is specially used in
wireless modems and cellular telephones. A cellular telephone is a device that uses high-
frequency radio waves to transmit voice and. digital data. Cellular radio has become an
important communication medium for mobile voice and data communications. The
integration of cellular and other mobile radio technology will accelerate in the next few
years.
2.4) Wi-Fi
stands for Wireless Fidelity
WiFi is based on the IEEE 802.11 family of standards and is primarily a local area networking (LAN)
technology designed to provide in-building broadband coverage.
Current WiFi systems support a peak physical-layer data rate of 54 Mbps and typically provide indoor
coverage over 100 feet.
WiFi has become the standard for last-mile broadband connectivity in homes, offices, and public
hotspots. Systems typically provide a coverage range of about 1,000 feet from the access point.

2.5) Beginners Guide to Bluetooth

Bluetooth is a wireless networking protocol (like WIFI) designed to quickly and


automatically connect devices like printers, PDAs, cameras, etc., to computers and each other without
wires.

Common Bluetooth applications are:

• Connecting mobile phones to exchange pictures, ring tones, music etc.


• Connecting computer peripherals like mice, keyboards, printers etc. to a computer.
• Connecting headsets to mobile phones for hands-free operation (Bluetooth car kits)

MODULE 5 NETWORKING MODEL


TCP/IP Reference Model is a four-layered suite of communication protocols. It was developed by the
DoD (Department of Defence) in the 1960s. It is named after the two main protocols used in the model,
namely, TCP and IP. TCP stands for Transmission Control Protocol, and IP stands for Internet
Protocol.

TCP/IP MODEL
The four layers in the TCP/IP protocol suite are −
[Type text] [Type text]
NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT
• The host-to-network layer is the lowest layer concerned with data's physical transmission.
TCP/IP does not explicitly define any protocol here but supports all the standard protocols.
• Internet Layer −It defines the protocols for logical data transmission over the network. The
primary protocol in this layer is Internet Protocol (IP), which is supported by the protocols
ICMP, IGMP, RARP, and ARP.
• Transport Layer − This layer is responsible for error-free end-to-end data delivery. The
protocols defined here are Transmission Control Protocol (TCP) and User Datagram Protocol
(UDP).
• Application Layer − This is the topmost layer and defines the interface of host programs with
the transport layer services. This layer includes all high-level protocols like Telnet, DNS, HTTP,
FTP, SMTP, etc.

The OSI Reference Model

OSI, or the Open System Interconnection model, was developed by the International Standards
Organization (ISO). It gives a layered networking framework that conceptualizes how communications
should be done between heterogeneous systems. It has seven interconnected layers. The seven layers of
the OSI Model are a physical layer, data link layer, network layer, transport layer, session layer,
presentation layer, and application layer, as shown in the following diagram −

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

The network support layers are physical, data link, and network layers. The layers manage the physical
transfer of data from one device to another. The Session, presentation, and application layers are the
user support layers. These layers allow communication among unrelated software in dissimilar
environments. The transport layer links the two groups.

The main functions of each of the layers are as follows −

• Physical Layer − its function is to transmit individual bits from one node to another over a
physical medium.
• Data Link Layer − It is responsible for the reliable transfer of data frames from one node to
another connected by the physical layer.
• Network Layer − It manages the delivery of individual data packets from source to destination
through appropriate addressing and routing.
• Transport Layer −It is responsible for the delivery of the entire message from the source host
to destination host.
• Session Layer − It establishes sessions between users and offers services like dialog control and
synchronization.
• Presentation Layer − It monitors syntax and semantics of transmitted information through
translation, compression, and encryption.
• Application Layer − It provides high-level APIs (application program interface) to the users

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

MODULE 6 INTERNET ADDRESSES

The Internet Protocol hierarchy contains several classes of IP addresses that can be used efficiently in
various situations as per the requirement of hosts per network. Broadly, the IPv4 Addressing system is
divided into five classes of IP Addresses. The first octet of IP Address identifies all five classes.
Internet Corporation for Assigned Names and Numbers is responsible for assigning IP addresses.
The first octet referred here is the left most of all. The octets numbered as follows depicting dotted
decimal notation of IP Address −

This formula can derive the number of networks and the number of hosts per class −

When calculating hosts' IP addresses, 2 IP addresses are decreased because they cannot be assigned to
hosts, i.e. the first IP of a network is network number, and the last IP is reserved for Broadcast IP.
Class A Address
The first bit of the first octet is always set to 0 (zero). Thus, the first octet ranges from 1 – 127, i.e.

Class A addresses only include IP starting from 1.x.x.x to 126.x.x.x only. The IP range 127.x.x.x is
reserved for loopback IP addresses.
The default subnet mask for Class A IP address is 255.0.0.0, implying that Class A addressing can
have 126 networks (27-2) and 16777214 hosts (224-2).
Class A IP address format is thus: 0NNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH
Class B Address
An IP address that belongs to class B has the first two bits in the first octet set to 10, i.e.

Class B IP Addresses range from 128.0.x.x to 191.255.x.x. The default subnet mask for Class B is
255.255.x.x.
Class B has 16384 (214) Network addresses and 65534 (216-2) Host addresses.
Class B IP address format is: 10NNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH
Class C Address
The first octet of a Class C IP address has its first 3 bits set to 110, that is −

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Class C IP addresses range from 192.0.0.x to 223.255.255.x. The default subnet mask for Class C is
255.255.255.x.
Class C gives 2097152 (221) Network addresses and 254 (28-2) Host addresses.
Class C IP address format is: 110NNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH
Class D Address
The very first four bits of the first octet in Class D IP addresses are set to 1110, giving a range of −

Class D has an IP address range from 224.0.0.0 to 239.255.255.255. Class D is reserved for
Multicasting. In multicasting, data is not destined for a particular host, so there is no need to extract the
host address from the IP address, and Class D does not have any subnet mask.
Class E Address
This IP Class is reserved for experimental purposes only for R&D or Study—IP addresses in this class
range from 240.0.0.0 to 255.255.255.254. Like Class D, this class is not equipped with any subnet
mask.

MODULE 7 NETWORK PROTOCOL


Types of Network Protocols
1) Hyper Text Transfer Protocol (HTTP)
is used by the application layer of the OSI model. The request is sent from the client to the server
until it responds. As it uses the final layer of the OSI model, it directly communicates with the
software applications like browsers. It is the most widely used protocol for using the Internet.
2) UDP
User Datagram Protocol is mainly used to transfer a small amount of data that does not need
acknowledgment from the receiver. It works mainly on fast data transmission rather than accurately
transferring it without errors. There are two fields in the UDP. They are header and data, respectively.
3) TCP
Transmission Control Protocol provides complete services in the transport layer. TCP is used to
transmit data between the client and the server securely. It is a connection-oriented service that carries
the data in the form of packets broken into smaller parts called segments.
4) BGP
Border Gateway Protocol follows the path-vector routing protocol. The Internet is composed of
networks, which are broken into smaller ones called autonomous networks (AS). BGP is implemented
on the Internet that works based on data routing. BGP finds the shortest path for data packet transfer.
5) IRC
IRC stands for Internet Relay Chat and is the protocol used to chat online using the installed software
and to transmit files and messages on time. One must install an IRC program in the system to use this
facility.
6) SNMP
In Simple Network Management Protocol, we can handle network devices such as servers, computers,
switches, and routers. SNMP is an application layer protocol whose basic components are an SNMP
manager, Management Information Base (MIB), Managed devices, and the agent. These components
are fond of monitoring the device using a network protocol.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT
7) ICMP
Internet Control Message Protocols are mainly used to determine and report errors in the network.
They are connectionless protocols. ICMP generates an error when any two devices cannot connect to
the Internet.
8) SSL
The responsibility of the secure Sockets Layer Protocol is to protect the system and sensitive data. It
provides communication between the client, the server, and two servers.
9) SFTP
In Secure File Transfer Protocol, the client and server are authenticated for encryption, and then only
the files or folders are transferred between the devices.
10) HTTPS
HTTPS stands for Secure Hypertext Transfer Protocol, providing a secure connection between the
browser and the server. Using this protocol, we can protect them from attackers.

THE END
OF

COMPUTER NETWORK NEW COURS 2023

PREPARED BY

ENGR.NISAR AHMAD

(B.SC (PAK) B.S (TURKIA) M.S (TURKIA)

CCNA, MCSE, MCDBA

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

SPECIALFEE DISCOUNTS FOR GROUP STUDENTS

FOR MORE INFO VISIT OUR WEBSITE:

WWW.NCMT.EDU.PK

Prepared by

Engr.Nisar Ahmad

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

SUBJECT INTORDUCTION TO MICROSOFT OFFICE

MICROSOFT OFFICE NEW COURSE 2023


Types of software:

1. Open-source Software: Open-source software is computer software whose source code


is available openly on the internet, and programmers can modify it to add new features and
capabilities without any cost.
The software can be used for any purpose
Allows to study how the software works
Freedom to modify and improve the program
No restrictions on redistribution
Some examples of open-source software include Android, Ubuntu, Firefox, and Open
Office.
2. Proprietary Software: Proprietary software is computer software with publicly
available source codes; only the company that has created them can modify it.
Number of installations of this software into computers
Restrictions on sharing of software illegally
The period up to which software will operate
Number of features allowed to use
Some examples of Proprietary software include Windows, mac OS, Internet Explorer,
Google Earth, Microsoft Office, etc.

Difference between Open-source Software and Proprietary Software:

S.No. OPEN-SOURCE SOFTWARE PROPRIETARY SOFTWARE

Open-source software is computer Proprietary software is computer


software whose source code is available software where the source codes are
openly on the internet, and programmers publicly not available. Only the
can modify it to add new features and company that has created it can modify
01. capabilities without any cost. it.

Here, the software is developed and


Here the software is developed and tested
tested by the individual or organization
through open collaboration.
02. that owns it, not the public.

In open-source software, the source code In proprietary software, the source


03. is public. code is protected.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

S.No. OPEN-SOURCE SOFTWARE PROPRIETARY SOFTWARE

Proprietary software can not be


Open-source software can be installed on
installed into any computer without a
any computer.
04. valid license.

Users need to have a valid and


Users do not need to have any
authenticated license to use this
authenticated license to use this software.
05. software.

Proprietary software is managed by a


An open-source community of developers
closed team of individuals or groups
manages open-source software.
06. that developed it.

It is not very flexible so there is a


It is more flexible and provides more
minimal innovation scope with the
freedom, which encourages innovation.
07. restrictions.

Users can get open software free of Users must have to pay to get the
08. charge. proprietary software.

In open-source software, faster fixes of In proprietary software, the vendor is


bugs and better security are available to entirely responsible for fixing
09. the community. malfunctions.

10. Limited Intellectual Property Protections Full Intellectual Property Protections

Usually Developed and Maintained by They are usually Developed and


11. non-profit organizations. Maintained by for-profit entities.

Examples are Windows, macOS,


Examples are Android, Linux, Firefox,
Internet Explorer, Google Earth,
Open Office, GIMP, VLC Media player,
Microsoft Office, Adobe Flash Player,
etc.
12. Skype, etc.

Introduction to Microsoft Office Suite 2016

Microsoft Office 2016 consists of five core programs: Word, Excel, PowerPoint, Access, and
Outlook, where each program specializes in manipulating different data. Word manipulates
text; Excel manipulates numbers; PowerPoint manipulates text and pictures to create a slide

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

show; Access manipulates organized, repetitive data such as inventories; and Outlook
manipulates personal information such as e-mail addresses and phone numbers.

Although each Office 2016 program stores and manipulates different types of data, they all
work similarly. First, you must enter data into an Office 2016 program by typing on the
keyboard or loading data from an existing file. Second, you must tell Office 2016 how to
manipulate your data, such as underlining, sorting, arranging it on the screen, or deleting it.
Third, you have to save your data as a file.

What is Microsoft Word?

Microsoft Word is a word-processing application that helps us design and create professional-
looking documents such as newsletters, reports, brochures, and letters.

In short, Word allows users to produce different types of documents depending on the
situation and need. With the help of MS Word, you can create professional-looking
documents for your Academic and Professional Careers.

Read: What is Microsoft Word?

Starting Microsoft Word

Click on Start Menu-> Programs-> Microsoft Office-> Microsoft Word. Or click on the
Microsoft Word icon on your desktop.

MS-Word Interface

The picture below shows the first screen you see when you open Word.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

1. Title Bar: It is topmost on the screen. It displays the name of the document on which
you are currently working.

2. Menu Bar: Generally found directly below the Title bar. The Menu bar displays the
menu. The Menu bar begins with the word File and continues with Edit, View, Insert,
Format, Tools, Table, Window, and Help.

3. Toolbars: Toolbars provide shortcuts to menu commands.

4. Text Area: You type your document in the text area. The cursor is the blinking
vertical line in the upper left corner of the text area. It marks the insertion point. As
you type, your work shows at the cursor location.

5. Getting Started Pane: You can create a new document or open an existing open to
start using Word. It can be closed because other options can do all the work.

6. Status Bar: The Status bar appears at the very bottom of the screen and provides such
information as the current page, current section, total number of pages, inches from
the top of the page, current line number, and current column number. The Status bar
also provides options that enable you to track changes or turn on the Record mode, the
Extension mode, the Overtype mode, and the Spelling and Grammar check.

7. Rulers: The ruler is used to change your document's format quickly.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Title Bar

It lies next to the Quick Access Toolbar. It displays the title of the currently open document
or application. It is present on almost all windows displayed on your computer. So, if several
windows are across the screen, you can identify each window by looking at the title bar. You
can also move a window in many graphical user interfaces by dragging the title bar.

See the image:

Quick Access Toolbar

Quick Access Toolbar lies next to the Microsoft Office Button. It is a customizable toolbar
that comes with a set of independent commands. It gives you quick access to commonly used
commands such as Save, Undo, Redo, etc.

See the image:

Ribbon and Tabs

The Ribbon is a user interface element that Microsoft introduced in Microsoft Office 2007. It
is located below the Quick Access Toolbar and the Title Bar. It comprises seven tabs: Home,
Insert, Page Layout, References, Mailing, Review, and View. Each tab has specific groups of
related commands. It gives you quick access to the commands you need to complete a task.

See the image:

Home tab:

The Home tab is the default tab in Microsoft Word. It has five groups of related commands:
Clipboard, Font, Paragraph, Styles, and Editing. It helps you change document settings like
font size, add bullets, adjust styles, and many other common features. It also helps you to
return to the home section of the document.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Cut
• Deleting unnecessary data from a document is called cutting.
• In Microsoft Word, you can cut text from one area of a document and paste that text
anywhere in the document.
• After you cut the text, it gets stored in the clipboard.
• If you want to cut any text or word from a document, it is advisable to highlight the
word first.
• To cut, Right Click → Cut.
• The shortcut key is "Ctrl + X".

Copy
• The copy option can be used when we need to retype the exact text, as it reduces time
and effort.
• You can copy the text from one location to another using the copy option.
• Information stored on the clipboard stays there until new information is cut or copied.
• Each time you cut or copy, you replace the old information on the clipboard with the
information you just copied.
• To copy, Right Click → Copy.
• The shortcut key is "Ctrl + C."

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Paste
• Select your text and then copy it.
• The mouse moves the cursor to the desired position to paste the copied text.
• Click paste to insert the copied text in its new place.
• You can paste clipboard information as often as you like.
• To paste, Right Click → Paste.
• The shortcut key is "Ctrl + V."

Font and Size selection


• To change the font size in the file or document, first select the text you want to
change.
• If you want to select all the text from the document, click "Ctrl + A."

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

• From home menu, click font size option.


• You can also change style of the font using "Font Style" feature.

Alignment of Text
• You can align text to Left, Right, Center, and Justify.
• By default, the content always appears on the left side of the document.
• Alignment can be done by using mouse or keyboard shortcuts.
• For center alignment, click on the "center align" icon or use the shortcut key "Ctrl +
E".
• For right alignment, click on the "right align" icon or use the shortcut key "Ctrl + R".
• For left alignment, click to the "left align" icon or use the shortcut key "Ctrl + L"
• If you click on "justify," it will align concerning both left and right margins. The
shortcut key used here is "Ctrl + J".

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Formatting Text
• A font refers to a set of characteristics that support the characters of Word.
• The process of formatting a document includes controlling the appearance of text and
the layout of text on the page.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

• Character formatting includes settings that control attributes of individual text


characters such as Fonts, Font Size, And Type Style.

Paragraph Indenting
• Indentation improves the readability of document.
• Options for indentation includes Left, Right, Center And Justify.

Bullets and Numbering


• Bullets and numbering are used to list important points and messages.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

• When a document is in the form of long paragraphs, the reader may not be able to
notice essential points or messages quickly. Bullets and numbering emphasize lists of
things.
• Bullets are used to list points or topics in a document.
• A numbered list works well for directions or other points.
• While typing a document, details should be given step-by-step for easy understanding.
MS Word’s feature "Bullets and Numbering" fulfills this purpose.
• You can use the word defaults for bullets and numbers or define your list.

Changing Case
We usually type the content of documents in different forms, such as Lower case, Upper case,
Sentence case, etc.
• Sentence Case → First character of the sentence is capitalized.
• Lower Case → The entire selected text will be changed to small letters.
• Upper Case → The entire selected text will be changed to capital letters.
• Title Case → First character of each word begins with a capital letter.
• Toggle Case → It changes lowercase to uppercase and vice-versa.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Opening New Document


A new, blank document always opens when you start Microsoft Word. Suppose you want to
start another new document while working on another document, or you closed an already
opened document and want to start a new one. Here are the steps to open a new document −
Step 1 − Click the File tab and select the New option.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Step 2 − Selecting the New option from the first column will display a list of templates in the
second column. Double-click on the Blank document; this is the first option in the template
list. We will discuss the other templates in the list in the following chapters.
You should have your blank document, as shown below. The document is now ready for you
to start typing your text.

You can use a shortcut to open a blank document anytime. Try using the Ctrl + N keys; you
will see a new blank document similar to the one in the screenshot above.
Opening Existing Document
There may be a situation when you open an existing document and edit it wholly or partially.
Follow the steps given below to open an existing document −
Step 1 − Click the File tab and select the Open option.

Step 2 − This will display the following file Open dialog box. This lets you navigate through
different folders and files, and also lets you select a file which you want to open.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Step 3 − Finally, locate and select a file you want to open and click the small triangle on
the Open button to open the file. You will have different options to open the file but simply
use the Open option.

This will open your selected file. You can use the Open Read-Only option if you are willing
just to read the file and you have no intention to modify, i.e., edit the file. Other options can
be used for advanced usage.

Create a Table
The following steps will help you understand how to create a table in a Word document.
Step 1 − Click the Insert tab, followed by the Table button. This will display a simple grid,
as shown below. Moving your mouse over the grid cells makes a table in the table that

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

appears in the document. You can make your table have the desired number of rows and
columns.

Step 2 − Click the square representing the lower-right corner of your table, which will create
an actual table in your document, and Word will go into table design mode. The table design
mode has many options, as shown below.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Step 3 − This is an optional step that can be worked out if you want a fancy table. Click
the Table Styles button to display a gallery of table styles. Moving your mouse over any of
the styles shows an accurate time preview of your actual table.

Step 4 − To select any of the styles, just click the built-in table style and you will see that the
selected style has been applied on your table.

Delete a Table
The simple step is to delete an existing table from a Word document.
Step 1 − Click anywhere in the table you want to delete.
Step 2 − Click the Layout tab and the Delete Table option under the Delete Table
Button to delete the complete table from the document along with its content.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

MS Excel
What is MS Excel?

1. Excel builds data in columns and rows, unlike a word processor such as Microsoft
Word. An Excel spreadsheet can be interpreted as a collection of columns and rows
that create a table. Rows and columns meet in a space termed a cell.
2. Alphabetical letters are generally allocated to columns, and numbers are ordinarily
allocated to rows. Each cell can contain a single piece of data, such as a numerical
value, text, or formula.
3. The address of a cell is furnished by the letter depicting the column and the number
symbolizing a row. Microsoft Excel is beneficial when we want to record, examine,
and save numeric data.
4. Microsoft Excel is a spreadsheet program that records and analyzes numerical and
statistical data. Microsoft Excel provides several features to perform various
operations like mathematical calculations, graph tools, pivot tables, macro
programming, etc. It fits with multiple OS like Windows, macOS, Android, and iOS.

How to Start MS Excel?

Click on the Start Menu–>Go to All Programs–>Click on MS Office–> choose the MS


Excel option.

Alternatively, if it has been added there, one can begin it from the start menu(by typing MS
Excel in the available search option). You can open it from the desktop shortcut if you have
created one.

Features of MS Excel

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

MS Excel processes data in tabular form and then performs mathematical functions to
analyze it. This is what the Excel window looks like (version 2007):

Excel is a tool for coordinating and performing calculations on data. It can examine data,
compute statistics, create pivot tables, and express data as charts or graphs. MS Excel
performs the following essential functions:

In MS Excel, there are rows and columns. The intersection of rows and columns makes a cell.
So, each of the cells is an individual unit of data. Each cell has a cell address, the number of
rows, and the column alphabet in which it appears. No two cells have the same address ever.

Home and Insert

The Home & Insert menu of MS Excel is similar to MS Word. Users can change the
formatting of the content from home & include pie charts, tables, and other files related to
data from the insert menu.

Font size, font color, font styles, alignment, background color, formatting options and styles,
insertion, deletion, and editing in the cells options are also available.

One can insert images, figures, headers, footers, charts, and sparklines and even attach
graphs, equations, and symbols.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT
Formulas

The unique functions that MS Excel has are Formulas & Data. Users can use the formula to
analyze data quickly. Users must select the cells; one cell becomes one data unit.

So if the user selects 10 cells and applies an average formula to them, the user will get an
average of the data output of those 10 cells.

The user must select a formula without space to apply a formula to any data. Then, in the
function bar, the user needs to type ‘=’ and the abbreviation of the formula the user wishes to
apply.

Data

The user can perform functions from the Data menu without changing the original data. Users
can filter, add external data from the web & sort data without changing it. For example, the
user can sort the data in alphabetical order.

From essential functions like addition & subtraction, the user can perform complex statistical
functions like correlation & t-tests. Moreover, users can convert them into Pie charts or
graphs within moments. This makes data analysis easy.

Page Layout

Users can apply themes and orientation and check the page setup through the layout option.

Review

Proofreading, like spell check, can be performed for an Excel sheet in the review section, and
a user can even add comments or remarks in this part.

View

Different views and layouts in which the user wants the spreadsheet to be displayed can be
selected here. Options to zoom in and out, full screen, and pane arrangement are available
under this section. Buy Testbook Pass

MS Excel Terminologies

1. Cell- A cell is a rectangle block/box present in a worksheet. Any data the user wants
to enter into the worksheet must be arranged in a cell.
2. Cells can be color-coded to show text, numbers, and the outcomes of calculations
based on the operations. An Active Cell is currently an open cell for editing.
3. Workbook- The workbook relates to an Excel spreadsheet record. It includes all the
data that have been listed/sorted/calculated. A workbook available to be seen and
edited by various users on a network is recognized as a shared workbook.
4. Worksheet- Inside the workbook, we get documents called worksheets. Also
recognized as spreadsheets, users can have multiple worksheets in a single workbook.
5. Workspace- Similar to worksheets in a workbook, a workspace enables users to open
numerous files simultaneously.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

6. Formula Bar- The Formula Bar displays the data of an active cell. In the case of
formulas, the formula bar will showcase all formula components.
7. Toolbar- The toolbar holds quick shortcuts like save, undo, and redo.
8. Chart- An object that displays data visually / graphically.
9. Data Validation- This feature of MS Excel helps to limit incorrect data from being
inserted into the worksheet. Data validation ensures consistency and precision in the
data to be entered.
10. Ribbon- Over the workbook is a section of command tabs named the Ribbon. Several
options are present behind every tab of the ribbon.

Advantages of Using MS Excel

1. There is no boundary to how much data can be saved in a spreadsheet, so MS Excel is


extensively used to save or analyze the data.
2. When working in pen-paper mode, data was stored in different files and registers.
This has become helpful as more than one worksheet can be attached to a single MS
Excel file.
3. Explaining data becomes more accessible when the data is collected as a table. Thus,
data stored in the spreadsheet is more readable and recognizable.
4. Performing various mathematical calculations such as addition, subtraction, average,
and other operations has become more manageable and less time-consuming with the
choice of the formula in MS Excel.
5. The information is drafted on a piece of paper, so finding something in it may take
longer, though this is not the case with Excel spreadsheets. Locating and recovering
data is accessible.

MS Excel Extensions

1. The default format for saving a Microsoft Excel workbook is .xlsx


2. For Excel Workbook (deprecated), the extension is .xls
3. For Excel macro-enabled workbook, the extension is .xlsm
4. For Excel binary workbook, the extension is .xlsb
5. For the Excel template, the extension is .xltx
6. For Excel macro-enabled template, the extension is .xltm

How to open MS PowerPoint


In Windows 8/above:
Step 1: Press Windows + c to open the search bar

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Step 2: Type PowerPoint & click on the MS Office version you have in your
system. MS Office window will pop up.
In Windows 7 or below:
Step 1: Go to the program section in the Windows start menu.
Step 2: Go to MS Office & click on it. A drop-down list is seen.
Step 3: Click on MS PowerPoint & MS PowerPoint window will pop up.
Creating a Presentation
Once your MS PowerPoint Window pops up, you can create & save the file
by:
Step 1: Click on the Microsoft button on the top left.

Step 2: Click on new, a new Presentation window will pop up.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Step 3: Click on Create & a new presentation will be created.


Note: Shortcut for New: Ctrl +n
Saving a Presentation
Once you have created a presentation, it can be easily saved with the help of
the following steps:
Step 1: Click on the Microsoft icon
Step 2: Click on the Save button

Step 3: A new Window for Save As will pop up.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Step 4: Select the drive (by clicking on it: Example: Local Drive (D)) where you
want to save the presentation. Then your drive will open up, select the folder in
which you want to save the presentation (Example: img folder here) & then give the
required name to your presentation (Example: MyPresentation here). Your
presentation is created & saved with the provided name.
Note: Shortcut for save: Ctrl + s
Essential Elements of a PowerPoint Window/Slide
You can see various bars in the presentation window. They are:
(i) Title Bar: This shows the name/title you gave for the current presentation. If the
user does not save the presentation by any name, the default name MS PowerPoint
gives appears in this bar.
(ii) Menu Bar: Contains menu items like insert, views, design, animations, etc.
(iii) Office Button: MS Office button on the left-most top.
(iv) Formatting Toolbar: Have tools like Bold, Italic, Underline, Font shape & size
etc. to format your data.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

(v) Zoom Slider: To zoom in or zoom out your presentation.


(vi) Slide Sorter Pane: This allows us to choose which slides will be shown in which
sequence during the slide show.
(vii) Notes Pane: This allows us to type notes that we may require later when
preparing for the presentation, but they will not be displayed during the slide show.
(viii) View Buttons: Provides different views of your presentation like usual, slide
show & slide sorter.
(ix) Slide Pane: This is where we type, format, and otherwise design the slide.
Concept of Slide Shows
After preparing the presentation, it’s time for the slide show. The steps for the slide
show are:
Step 1. Click on the View Option on the top Menu Toolbar
Step 2. Click on the slide show option.

Step 3. The slide show will start (Press Esc key (escape) to come out of slide show)
Note: Shortcut for the slide show is: F5
Step 1: Click on the Microsoft icon
Step 2: Click On Print & a window for Print & Preview the document will pop up.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Step 3: Click on Print. Then a window for Print will pop up.

Step 4: Select the printer by which you want to take out a print of the document.
Select the page range (Print of all or some or current page) & number of copies you
want.
Step 5: Click on OK.
You will get a print of your Presentation.
Note: The shortcut for print is Ctrl + p

What Is Microsoft Access?

Microsoft Access is a well-known database management system produced by Microsoft and


is part of the Microsoft 365 office suite. Microsoft Access combines Microsoft’s relational Jet
Database Engine with software development tools and a graphic user interface (GUI). It was
first released in November 1992, so it’s been around for a while. In the rapidly changing,
fast-paced IT world, we can best describe a 30-year-old program as "venerable."

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Microsoft Access also has the distinction of being the first mass-market database program for
Windows.

Microsoft Access enables business and enterprise users to manage data and analyze vast
amounts of information efficiently. The program provides a blend of database functionality
and programming capabilities for creating easy-to-navigate forms.

Microsoft Access is like Microsoft Excel in that you can store, edit, and view data. However,
Access has much more to offer, as we are about to see.

MS Access Features

Some of the key features of MS Access are:

User-Friendly Interface

MS Access provides a user-friendly interface that allows you to create and manage databases
using a drag-and-drop interface. This makes it easy to create tables, forms, queries, and
reports without requiring extensive technical knowledge.

Customizable Templates

MS Access includes a range of customizable templates that you can use as a starting point for
your database. This includes templates for inventory management, customer management,
project tracking, and more.

Powerful Query Designer

MS Access includes an influential query designer that allows you to extract specific data
from tables based on user-defined criteria. This includes sorting, filtering, and aggregating
data from multiple tables.

Integrated Reporting Tools

MS Access includes integrated reporting tools that allow you to create professional-looking
reports based on data from one or more tables. This includes the ability to create charts,
graphs, and summaries.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Customizable Forms

MS Access allows you to create custom forms with a user-friendly interface for entering and
viewing data in your tables. This includes adding controls like text boxes, drop-down lists,
and buttons.

Macros For Automation

MS Access includes macros that allow you to automate everyday tasks in your database, such
as opening forms and running queries. This can save time and increase efficiency.

Customizable Code

MS Access allows you to write custom code using the Visual Basic for Applications (VBA)
programming language. This allows you to create custom functions and automate complex
tasks.

Collaboration Features

MS Access allows you to share your database with other users and control their access to the
data. This includes the ability to assign specific permissions to individual users or groups.

Integration With Other Applications

MS Access integrates with other applications in the Microsoft Office suite, such as Excel and
Word. This allows you to import and export data and generate reports and charts using data
from multiple sources.

Overall, MS Access provides a range of features that make it easy to create and manage
databases, with a user-friendly interface, powerful query and reporting tools, and the ability
to automate tasks and collaborate with others.

How Microsoft Access is Used

Here are some of Microsoft Access’s most-used features:

• Importing data from Excel or other databases

• Creating forms for data entry or viewing

• Designing and running data retrieval queries

• Designing reports to be either printed or turned into a PDF

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

• Allowing users to interact with Access via SQL

The Components of Microsoft Access

Microsoft Access is composed of the following components:

• Tables: Access stores its data in tables using a row and column format. Users can create one
database that includes all the data of one project. This database is known as a “flat” database.
More on databases later.

• Relational Databases: Although users can place a project's data in just one database, creating
numerous tables dedicated to a different aspect of the project is typically easier. Fortunately,
each table can be connected and interrelated, an arrangement known as a relational database.

• Forms: Forms enable users to enter data into the database without relying on a spreadsheet.

• Macros: Macros are small programming constructs consisting of commands and processes and
are a huge time saver.

• Modules. Modules are procedures, also called functions, which users can write with Visual Basic
Applications.

• Queries: Queries find information in databases, which is a helpful tool, considering the size of
many access databases.

• Reports: Reports simplify the processes of sorting, labeling, summarizing, and grouping data to
easily share or print.

Microsoft Access Architecture

Microsoft Access is a relational database management system (RDBMS) that provides a


graphical user interface for creating and managing databases. The architecture of Microsoft
Access includes the following components:

Tables

Tables are the basic building blocks of any database. They store data in rows and columns
and are used to organize related information into groups. Tables in Microsoft Access can
have various data types, such as text, number, date/time, etc.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Forms

Forms are used to provide a user-friendly interface for entering data into tables. They can be
created using a drag-and-drop interface and customized using various tools and controls.

Queries

Queries are used to extract specific data from tables based on user-defined criteria. They can
be used to sort, filter, and aggregate data from multiple tables and can be created using a
graphical query designer.

Reports

Reports are used to present data in a visually appealing format. They can be used to create
summaries, charts, and graphs based on data from one or more tables.

Macros

Macros are used to automate everyday tasks in Microsoft Access. They can be used to
perform tasks such as opening forms and running queries and can be triggered by user actions
or by events in the database.

Modules

Modules are used to write custom code in Microsoft Access using the Visual Basic for
Applications (VBA) programming language. They can be used to create custom functions,
automate complex tasks, and interact with other applications.

Security

Microsoft Access includes built-in security features that allow you to control access to the
database and its objects. Access supports user-level security, which allows you to assign
specific permissions to individual users or groups.

Back-End Database Server

For larger databases with multiple users, Microsoft Access can be used as a front-end
application that connects to a back-end database server such as Microsoft SQL Server or
Oracle. This allows multiple users to access the database simultaneously and provides better
scalability and performance.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Overall, the architecture of Microsoft Access is designed to provide a user-friendly and


flexible environment for creating and managing databases, with a range of tools and features
that allow you to customize the database to your specific needs.

The Uses of Microsoft Access

Data Storage

MS Access is used to store large amounts of data in an organized and efficient manner. It
allows you to create tables, forms, queries and reports to manage your data.

Inventory Management

MS Access is commonly used for inventory management, where it can be used to track items,
their location, and other important details. It can also be used to create purchase orders and
track sales.

Customer Relationship Management (CRM)

MS Access can be used for customer relationship management (CRM), where it can be used
to store customer information, track interactions, and generate reports.

Project Management

MS Access can be used for project management, tracking tasks, milestones, and resources. It
can also be used to generate reports on project progress.

Personnel Management

MS Access can be used for personnel management, where it can be used to store employee
information, track performance, and generate reports.

Event Planning

MS Access can be used for event planning, managing guest lists, tracking RSVPs, and
generating reports on event attendance.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Small Business Management

MS Access is a popular choice for small business management, where it can be used to
manage finances, track inventory, and generate reports.

The Microsoft Access Database

Microsoft Access consists of two distinct types of databases:

• First, flat file databases store data in plain text and can't incorporate multiple tables.

• Secondly, relational databases store data in forms that relate to each other. For example,
relational databases support multiple tables, which arrange the text into columns and rows.

Additionally, the Microsoft Access database uses the following data types:

• Attachment: Stores files like digital images

• Auto Number: Either assigned by Access or the user when a new record is created

• Calculated: Creates an expression that uses data from one or multiple fields

• Currency: Stores currency values and numeric data featuring one to four decimal places

• Date/Time: Stores date and time information for a year range between 100 and 9999

• Hyperlink: Stores a combination of numbers and text, used as a hyperlink address

• Long Text: Typically used for lengthy alphanumeric or text data, up to 63,999 characters

• Numbers: Numeric data used for storing mathematical calculations

• OLE Objects: This data encompasses audio, video, and other Binary Large Objects

• Short Text: Stores text and numbers not used in calculations

The Benefits of Microsoft Access

Microsoft Access brings many advantages to the table, including:

• It gives users a fully functional, relational database management system in minutes

• It’s easy to import data from multiple sources

• It’s easily customized to fit any personal or company needs

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

• The online Microsoft Access works nicely with many development languages that work on the
Windows operating system

• It’s a robust and flexible utility that can perform any demanding office or industrial database task

• MS-Access lets users link to data in its current location and use the information for viewing,
querying, updating, and reporting.

• It’s simple to install and easy to understand

• It lets users create tables, forms, queries, and reports and connect with the aid of Macros.

• Macros in Access are simple programming constructs that help users add functionality to their
database.

• The graphical user interface (GUI) helps simplify its use

• Microsoft Access Online can perform heterogeneous joins between many data sets that are
stored across various platforms

The Drawbacks of Microsoft Access

Of course, no application is perfect. Every product has its downside, and Microsoft Access is
no exception. Its drawbacks include:

• If too many users attempt to gain access to the same database at once, this may negatively
impact the speed and efficiency. There is an apparent limit to how many people can
simultaneously work on the same database.

• Related to the first point, the Microsoft Access database is more beneficial for small-to-medium
businesses but not as much for large-sized organizations.

• There are better database systems available when working with confidential data.

• Microsoft Access lacks the robustness that is found in other DBMS systems such as MS SQL
Server or Oracle.

• Since all the information from a database is saved into one file, this can slow down reports,
queries, and forms.

• Although the technical limit is 255 concurrent users, the real-world limit ranges from only 10 to
80, depending on the application the organization is currently running.

• Microsoft Access requires considerably more learning and training than other Microsoft
programs.

Versions of MS Access

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Microsoft Access has been around for over 25 years, and many versions have been released.
Here are the major versions of Microsoft Access:

• Access 1.0 - Released in 1992 for Windows 3.0, Access 1.0 was the first version of Access.

• Access 2.0 - Released in 1993, Access 2.0 added several new features, including support for
importing data from Excel and Lotus 1-2-3.

• Access 95 - Released in 1995, Access 95 introduced support for VBA (Visual Basic for Applications)
and OLE Object Linking and Embedding.

• Access 97 - Released in 1997, Access 97 added support for replication and the ability to create
web-based applications using Active Server Pages (ASP).

• Access 2000 - Released in 1999, Access 2000 introduced support for the new Access project
(.adp) file format and support for XML.

• Access 2002/XP - Released in 2001, Access 2002/XP introduced a new user interface and
improved support for importing and exporting data.

• Access 2003 - Released in 2003, Access 2003 added support for new data types and the ability to
create and modify XML documents.

• Access 2007 - Released in 2007, Access 2007 introduced the ribbon interface and added support
for publishing to SharePoint.

• Access 2010 - Released in 2010, Access 2010 added support for web databases and introduced
the Navigation pane.

• Access 2013 - Released in 2013, Access 2013 introduced a new design interface and added
support for web apps

• Access 2016 - Released in 2015, Access 2016 added support for Large Number data type and
TempVar objects.

• Access 2019 - Released in 2018, Access 2019 added support for new data types, such as BigInt
and Attachments, and improved user experience.

Overall, each version of Access has added new features and functionality, making it easier to
manage and manipulate data. The most recent versions have added support for web-based
applications, mobile devices, and cloud-based services, allowing users to access their data
anywhere.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

www.ncmt.edu.pk

THE END
OF

OFFICE AUTOMATION NEW COURSE 2023

PREPARED BY

ENGR.NISAR AHMAD

(B.SC (PAK) B.S (TURKIA) M.S (TURKIA)

CCNA, MCSE, MCDBA

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

SUBJECT OPERATING SYSTEM NEW COURSE 2022

Module 1 OVERVIEW OF AN OPERATING SYSTEM

1 Operating systems
An operating system (OS) is a set of programs that manage computer hardware resources
and provide standard services for application software. The operating system is the most
critical software in a computer system. A user cannot run an application program on the
computer without an operating system unless the application program is self-booting.
Examples of popular modern operating systems include Android, iOS, Linux, and Mac OS X,
all of which have their roots in UNIX and Microsoft Windows.

Types of Operating Systems (OS)


An operating system is a well-organized collection of programs that manages the computer
hardware. It is a type of system software responsible for the computer system's smooth
functioning.

1) Batch Operating System


In the 1970s, Batch processing was very popular. In this technique, similar jobs were batched
together and executed in time. People were used to having a single computer, which was
called a mainframe.
%

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Â
Backward Ski

Advantages of Batch OS
Using a resident monitor improves computer efficiency by eliminating CPU time between
two jobs.
Disadvantages of Batch OS
1. Starvation
2. Not Interactive
2) Multiprogramming Operating System
Multiprogramming is an extension of batch processing where the CPU is always busy. Each
process needs two types of system time: CPU time and IO time.
In a multiprogramming environment, when a process does its I/O, The CPU can start
executing other processes. Therefore, multiprogramming improves the efficiency of the
system.

Advantages of Multiprogramming OS
Throughout the system, it increased as the CPU always had one program to execute.
Response time can also be reduced.

Disadvantages of Multiprogramming OS
Multiprogramming systems provide an environment in which various systems resources are
used efficiently, but they do not provide any user interaction with the computer system.
• Multiprocessing Operating System

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

In Multiprocessing, Parallel computing is achieved. There is more than one processor in the
system which can execute more than one process simultaneously. This will increase the
system's throughput.

In Multiprocessing, Parallel computing is achieved. More than one processor in the system
can execute more than one process simultaneously, increasing the system's throughput.
Advantages of Multiprocessing operating system:
Increased reliability: Due to the multiprocessing system, processing tasks can be distributed
among several processors. This increases reliability as if one processor fails; the task can be
given to another processor for completion.
Increased throughout: As several processors increase, more work can be done in less.

Disadvantages of Multiprocessing Operating System


Multiprocessing operating system is more complex and sophisticated as it take care of
multiple CPUs simultaneously.
3) Multitasking Operating System

The multitasking operating system is a logical extension of a multiprogramming system that


enables multiple programs simultaneously. It allows a user to perform more than one
computer task at the same time.
Advantages of Multitasking operating system
This operating system is more suited to supporting multiple users simultaneously.
The multitasking operating systems have well-defined memory management.

Disadvantages of Multitasking operating system

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

The multiple processors are busier simultaneously to complete any task in a multitasking
environment, so the CPU generates more heat.
4) Network Operating System

An operating system that includes software and associated protocols to communicate with
other computers conveniently and cost-effectively via a network is called a network operating
system.
Advantages of Network Operating System
This operating system reduces network traffic due to the division between clients and the
server.
This type of system is less expensive to set up and maintain.
Disadvantages of Network Operating System

In this type of operating system, the failure of any node in a system affects the whole system.
Security and performance are important issues. So, trained network administrators are
required to administer the network.
5) Real-Time Operating System
In Real-Time Systems, each job carries a specific deadline within which it is supposed to be
completed; otherwise, there will be a huge loss, or even if the result is produced, it will be
completely useless.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

The Application of a Real-Time system exists in the case of military applications; if you want
to drop a missile, then the missile is supposed to be dropped with a certain precision.

Advantages of Real-time operating system:


Easy to layout, develop, and execute real-time applications under the real-time operating
system.
In a Real-time operating system, the maximum utilization of devices and systems.

Disadvantages of Real-time operating system:


Real-time operating systems are very costly to develop.
Real-time operating systems are very complex and can consume critical CPU cycles.
6) Time-Sharing Operating System
In the Time Sharing operating system, computer resources are allocated time-dependent to
several programs simultaneously. Thus, it helps provide a large number of users with direct
access to the main computer. It is a logical extension of multiprogramming. In time-sharing,
the CPU is switched among multiple programs given by different users on a scheduled basis.

A time-sharing operating system allows many users to be served simultaneously, so


sophisticated CPU scheduling schemes and Input/output management are required.
Time-sharing operating systems are very difficult and expensive to build.
Advantages of Time-Sharing Operating System

The time-sharing operating system provides effective utilization and sharing of resources.
This system reduces CPU idle and response time.
Disadvantages of Time-Sharing Operating System
Data transmission rates are very high in comparison to other methods.
Security and integrity of user programs loaded in memory and data must be maintained as
many users access the system simultaneously.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Mobile Operating System

A mobile operating system is an operating system that helps to run other application software
on mobile devices. It is the same kind of software as the famous computer operating systems
like Linux and Windows, but now they are light and simple to some extent.

The operating systems found on smartphones include Symbian OS, iPhone OS, RIM's
BlackBerry, Windows Mobile, Palm WebOS, Android, and Maemo. Android, WebOS, and
Maemo are all derived from Linux. The iPhone OS originated from BSD and NeXTSTEP,
related to Unix.

It combines the beauty of computers and hand-use devices. It typically contains a built-in
cellular modem and SIM tray for telephony and internet connections. If you buy a mobile, the
manufacturer company chooses the OS for that specific device.

Popular platforms of the Mobile OS

1. Android OS: The Android operating system is the most popular operating system today. It
is a mobile OS based on the Linux Kernel and open-source software. Google developed the
Android operating system. The first Android device was launched in 2008.

2. Bada (Samsung Electronics): Bada is a Samsung mobile operating system that was
launched in 2010. The Samsung Wave was the first mobile to use the Bada operating system.
The Bada operating system offers many mobile features, including 3-D graphics, application
installation, and multipoint touch.

3. BlackBerry OS: The BlackBerry operating system is a mobile operating system


developed by Research In Motion (RIM). This operating system was designed specifically
for BlackBerry handheld devices. This operating system benefits corporate users by
synchronizing with Microsoft Exchange, Novell GroupWise email, Lotus Domino, and other
business software when used with the BlackBerry Enterprise Server.

4. iPhone OS / iOS: The iOS was developed by Apple Inc. for use on its devices. The iOS
operating system is the most popular today. It is a very secure operating system. The iOS
operating system is not available for any other mobile device.

5. Symbian OS: Symbian operating system is a mobile operating system that provides high-
level integration with communication. The Symbian operating system is based on Java. It
combines middleware of wireless communications and personal information management
(PIM) functionality. The Symbian operating system was developed by Symbian
Ltd in 1998 for the use of mobile phones. Nokia was the first company to release Symbian
OS on its mobile phone.

6. Windows Mobile OS: Windows Mobile OS is a mobile operating system that Microsoft
developed. It was designed for pocket PCs and intelligent mobiles.

7. Harmony OS: The Harmony OS is the latest mobile operating system that Huawei
developed for its devices. It is designed primarily for IoT devices.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

8. Palm OS: Palm OS is a mobile operating system that Palm Ltd developed for use on
personal digital assistants (PADs). It was introduced in 1996. Palm OS is also known as
the Garnet OS.

9. WebOS (Palm/HP): WebOS is a mobile operating system developed by Palm. It based on


the Linux Kernel. The HP uses this operating system in its mobile and touchpads

MODULE 2 FUNCTION OF AN OPERATING SYSTEM

Functions of an Operating System.


Memory Management
Processor Management
Device Management
File Management
Network Management
Security
Control over system performance
Job Accounting
Error detecting aids
Coordination between other software and users

1) Memory Management
Memory management refers to the management of Primary Memory or Main Memory. Main
memory is a large array of words or bytes where each word or byte has its own address.
Keeps track of primary memory, i.e., what parts are in use by whom and what parts
are not.
In multiprogramming, the OS decides which process will get memory when and how
much.
Allocates the memory when a process requests it to do so.
De-allocates the memory when a process no longer needs it or has been terminated.

2) Processor Management

In a multiprogramming environment, the OS decides which process gets the processor when
and for how long. This function is called process scheduling. An Operating System does the
following activities for processor management −
Keeps track of processor and status of the process. The program responsible for this
task is known as a traffic controller.
Allocates the processor (CPU) to a process.
De-allocates processor when a process is no longer required.

3) Device Management

An Operating System manages device communication via their respective drivers. It does the
following activities for device management −

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Keeps tracks of all devices. The program responsible for this task is known as the I/O
controller.
Decides which process gets the device when and for how much time.
Allocates the device in an efficient way.
De-allocates devices.

4)File Management

A file system is usually organized into directories for easy navigation and usage. These
directories may contain files and other directions.
Decides who gets the resources.
Allocates the resources.
De-allocates the resources.
Other Important Activities
Following are some of the essential activities that an Operating System performs −
Security − Passwords and other similar techniques prevent unauthorized access to programs
and data.
Control over system performance − Recording delays between request for a service and
response from the system.
Job accounting − Keeping track of time and resources used by various jobs and users.
Error detecting aids − Production of dumps, traces, error messages, and other debugging
and error detecting aids.
Coordination between other software and users − Coordination and assignment of
compilers, interpreters, assemblers, and other software to the various users of the computer
systems.

What are process states?


A process is a program in execution, and it is more than a program code called a text section.
This concept works under all operating systems because all the task performed by the
operating system needs a process to perform the task
The process executes when it changes the state. The current activity of the process defines
the state of a process.
Each process may be in any one of the following states −
• New − The process is being created.
• Running − In this state, the instructions are executed.
• Waiting − The process is waiting until an event occurs, such as an I/O operation
completion or receiving a signal.
• Ready − The process is waiting to be assigned to a processor.
• Terminated − the process has finished execution.
It is important to know that only one process can run on any processor at any instant. Many
processes may be ready and waiting.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Now let us see the state diagram of these process states −

Explanation
Step 1 − whenever a new process is created, it is admitted into a ready state.
Step 2 − If no other process is present at the running state, it is dispatched to running based
on the scheduler dispatcher.
Step 3 − If any higher priority process is ready, the uncompleted process will be sent to the
waiting state from the running state.
Step 4 − Whenever the I/O or event is completed, the process will be sent back to the ready
state based on the interrupt signal the running state gives.
Step 5 − whenever the execution of a process is completed in the running state, it will exit to
the terminate state, which is the completion of the process.

What is Thread?
A thread is a flow of execution through the process code. It has a program counter that tracks
which instructions need to be executed. Next, the system registers its current working
variables and a stack containing the execution history.
A thread shares little information like code segment, data segment, and open files with its
peer threads. When one thread alters a code segment memory item, all other threads see that.
A thread is also called a lightweight process. Threads provide a way to improve application
performance through parallelism. Threads represent a software approach to improving the
operating system's performance by reducing the overhead thread, equivalent to a classical
process.
Each thread belongs to exactly one process, and no thread can exist outside of a process. Each
thread represents a separate flow of control. Threads have been successfully used to

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

implement network servers and web servers. They also provide a suitable foundation for
parallel execution of applications on shared memory multiprocessors. The following figure
shows the working of a single-threaded and a multithreaded process.

Difference between Process and Thread

S.N. Process Thread

1 The process is heavyweight or resource intensive. Thread is lightweight and


takes fewer resources than
a process.

2 Process switching needs interaction with the operating Thread switching does not
system. need to interact with the
operating system.

3 In multiple processing environments, each process executes All threads can share the
the same code but has its own memory and file resources. same set of open files
child processes.

4 If one process is blocked, then no other process can execute While one thread is
until the first process is unblocked. blocked and waiting, a
second thread in the same
task can run.

5 Multiple processes without using threads use more Multiple threaded


resources. processes use fewer
resources.

6 In multiple processes, each process operates independently One thread can read, write
of the others. or change another thread's
data.

Advantages of Thread

• Threads minimize the context switching time.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

• The use of threads provides concurrency within a process.


• Efficient communication.
• It is more economical to create and context switch threads.
• Threads allow the utilization of multiprocessor architectures on a grander scale and
with greater efficiency.

MODULE 4 INTRODUCTION TO WINDOWS

Windows 10 system requirements

Here's what it takes to upgrade to Windows 10 on your PC or tablet:

▪ Latest OS: Make sure you're running the latest version—either Windows 7 SP1 or
Windows 8.1 Update.
▪ Find out which version you're running.
▪ Need the latest version? Download Windows 7 SP1 or Windows 8.1 Update.
▪ Processor: 1 gigahertz (GHz) or faster processor or SoC
▪ RAM: 1 gigabyte (GB) for 32-bit or 2 GB for 64-bit
▪ Hard disk space: 16 GB for 32-bit OS or 20 GB for 64-bit OS
▪ Graphics card: DirectX 9 or later with WDDM 1.0 driver
▪ Display: 800 x 600

Step 1Prepare: Download and Install

Find a usable computer and install the program on it after the download is completed. Launch
the tool when installation is done. The main user interface is shown up like this:
Step 2Insert USB and Load Windows ISO File

Plug a USB drive into the computer and click the "Burn" text in the main window. A new
window will be opened, and where you should load the Windows ISO file from the local hard
drive by clicking the 'Browse' button.

Step 3 Make Bootable USB from Windows DVD

Usually, the USB drive name should appear on the screen. If not, make sure the device is
well-connected. Then, leave the configuration in default settings, which are set based on the
Windows ISO file you just imported. Finally, click the 'Burn' button to start writing the
Windows ISO file to USB.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

There is a progress bar alongside the burning task. It displays the time it takes and the
percentage for the whole task. Please be patient and keep the USB well-connected.

Another popular open-source tool for making bootable USB flash drives from multiple
sources, including DVDs, is WinUSB. Like Rufus, WinUSB can also pick up ISO files from
various sources, including DVDs. The major advantage of WinUSB is that you can create a
multiboot USB containing different versions of Windows that you can use on the same
computer. With that, let's see how to use WinUSB to create a bootable USB pen drive from a
DVD with a Windows bootable ISO file:

Step 1: Launch the program after downloading from the link above and installing it on your
PC.

Step 2: Select your target USB drive after inserting it in the center panel.

Step 3: On the right, you'll see a Windows section. Under that, select the DVD icon after
inserting the disk with the ISO into the optical drive.

Step 4: Hit Next and then name your pen drive, and, finally, hit the Start button at the bottom.
Your bootable USB drive will be ready in a little bit.

WinUSB is extremely versatile, but it doesn't have formal tech support. You must depend on
public forums; veteran users typically ask you to read through old posts. That's a waste of
time, so if you have trouble using WinUSB for any reason, you can try this next method
showcased below.

RUFUS:

A Windows utility that formats and creates bootable USB drives for Windows, Mac, and
Linux (a LiveUSB drive). Rufus is typically used to turn an ISO image into a bootable USB.
See ISO image.

Want to install a fresh version of Windows 10 on your PC? If you're running another
operating system or setting up a new PC, you can easily install Windows 10 from an
installation disc or USB flash drive. Upgrading from an earlier version like Windows 7 or 8.1
is even easier—no flash drive or DVD required! This wikiHow article will walk you through
installing or upgrading to Windows 10 on any PC.

Creating an Installation Disc or Drive

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Connect a blank USB flash drive or insert a blank writable DVD. You can install
Windows 10 by creating a bootable USB flash drive or DVD that contains the Windows 10
installation files. You'll need a USB flash drive that's at least 8GB or any blank DVD to get
started.[1]

• If you already have Windows 10 installed on the PC and just want to reinstall it, it'll
be easiest to reinstall it from within Windows 10 instead of creating installation
media.
• If you want to upgrade from Windows 7 or 8.1, you won't need to create an
installation disc or drive. However, you will need to follow most of this method to
start the upgrade.

Make sure you have a product key. If you bought Windows 10 through Microsoft using
your Microsoft account, your product key is already linked to your account. If you bought
Windows 10 from another retailer, you'll have a 25-character product key that you'll need to
have handy to activate Windows.[2]

• If you don't have a product key or are installing Windows 10 on a new hard drive,
ensure you've linked your Windows 10 digital license to your Microsoft account
before you start the installation.[3] Head to Settings > Update &
Security > Activation from the current installation—if the activation status says
Windows is activated with a digital license, click Add an account and follow the
on-screen instructions to link your Microsoft account.
• If you upgrade from an earlier version and your PC qualifies for a free upgrade, you
won't need a product key.

Go to https://www.microsoft.com/en-us/software-download/windows10%20. This is the


official download site for Windows 10.

Click the Download tool now. This is a blue button in the middle of the page. This
downloads the Media Creation Tool, which you'll use to create your installation media (or
start your upgrade).

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Double-click the downloaded file. Its name begins with "MediaCreationTool" and ends with
".exe." You'll find it in your default download folder, called Downloads.

• Click Yes when prompted to allow the installer to run.

Click Accept to accept the license. It's in the bottom-right corner of the window.

Select "Create installation media" and click OK. This option lets you create a Windows
installation disc or drive that will work on any compatible PC, not just the one you're using
now.

• If you're updating your PC from an earlier version of Windows, select Upgrade this
PC now instead, and then follow the on-screen instructions to install Windows 10.
You're done!

Select your preferences and click Next. If you're installing Windows on the current PC, you
can keep the default options. If you need to install it on a different PC, make sure you choose
the language and edition for which you have a license and select the architecture (64-bit or
32-bit) that matches the PC you're going to install it on.

• If you're not sure about the architecture, you can choose Both from the menu.

Choose an installation type and click Next. An ISO file is a type of file that can be burned
to a DVD, so choose that option if you plan to create a DVD. Otherwise, choose the USB
flash drive option.

10

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Create your installation media. The steps are a little different depending on what you're
doing:

• Flash drive: Select your flash drive from the list, click Next, and wait for the
installation files to install. When the process is complete, click Finish.
• DVD/ISO: Click Save to save the ISO file to your computer—it may take a while
because the file is large and has to be downloaded. Once downloaded, you'll see a
progress screen that monitors the download. When the download is complete,
click Open DVD burner on the "Burn the ISO file to a DVD" screen, select your
DVD burner, and then click Burn to create your DVD.
Part2
Booting from Windows 10 Installation Media

Connect your Windows 10 installation media. If you created a flash drive, connect it to the
PC on which you want to install Windows 10. If you made a DVD, insert it into the drive
now.
2.

Boot the PC into the BIOS. If your PC is not already set up to boot from your flash or
optical drive, rebooting from your installation media won't work. You'll need to quickly
change your BIOS to change the boot order. There are a few ways to get in:

• Windows 8.1 or 10: From Windows, open Settings, select Update &
Recovery or Update & Security, and go to Recovery > Restart
now > Troubleshoot > Advanced Options > UEFI Firmware Settings > Restart.
• Any PC: Reboot the PC and immediately start pressing (over and over again) the
keyboard key required by your PC to enter "Setup" or the BIOS. The key varies by
computer, but here are some of the most common keys:
• Acer and Asus: F2 or Del
• Dell: F2 or F12
• HP: ESC or F10
• Lenovo: F1, F2, or Fn + F2
• Lenovo ThinkPads: Enter + F1.
• MSI: DEL
• Microsoft Surface Tablets: Press and hold the volume-up button.
• Samsung and Toshiba: F2
• Sony: F1, F2, or F3

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Go to the Boot tab. You'll use the arrow keys to select it.

• The Boot tab may instead say Boot Options or Boot Order, depending on your
computer's manufacturer.

Select a device from which to boot. You have a couple of options here:

• For a USB flash drive, select the Removable Devices option.


• For a disc installation, select the CD-ROM Drive or Optical Drive option.

Press the + key until your boot option is first. Once either Removable Devices or CD-
ROM Drive is at the top of the list, your computer will select your choice as its default boot
option.

• On some computers, you'll instead press one of the function keys (e.g., F5 or the
arrow keys to navigate an option up to the top of the menu. The key will be listed on
the right side of the screen.

Save your settings. You should see a key prompt (e.g., F10 at the bottom of the screen that
correlates to "Save and Exit". Pressing it will save your settings and restart your computer.

Wait for your computer to restart. Once your computer finishes restarting, you'll see a
window here with your geographical data. You're now ready to begin setting up your

Windows 10 installation.

Installing Windows 10

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Click Next when prompted. You can also change the options on this page (e.g., the setup
language) before continuing if need be.

Click Install Now. It's in the middle of the window.

Enter your Windows 10 key, then click Next. If you don't have a Windows 10 key,
click Skip in the bottom-right corner of the screen.

• If you've already installed Windows 10 on this PC and were signed in with your
Microsoft account, your key should be linked to your account. When prompted, just
sign in with your Microsoft account, and Windows will locate your key.[4]
• Suppose you've changed hardware in the PC, such as replacing the motherboard. In
that case, you can activate Windows after installing it by going to Settings > Update
& Security > Activation > Troubleshoot > I changed the hardware on this device
recently. When prompted, sign in with your Microsoft account, choose This is the
device I'm using right now, and then click Activate.

Follow the on-screen instructions to install Windows 10. You'll be asked to perform a few
tasks, such as connecting to Wi-Fi and choosing some preferences. Once the installation is
complete, you'll have a fresh new installation of Windows 10.

• If you're upgrading from an earlier version of Windows, you'll be asked if you want
to upgrade the current operating system or do a custom install. If you
choose Upgrade, you'll preserve existing apps and files.

Create and format a hard disk partition.

To create a partition or volume (the two terms are often used interchangeably) on a hard disk,
you must be logged in as an administrator, and there must be either unallocated disk space or
free space within an extended partition on the hard disk.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

If there is no unallocated disk space, you can create some by shrinking an existing partition,
deleting a partition, or using a third-party partitioning program.

To create and format a new partition (volume)

1. Open Computer Management by selecting the Start button. Select Control


Panel > System and Security > Administrative Tools, and then double-
click Computer Management.

2. In the left pane, under Storage, select Disk Management.

3. Right-click an unallocated region on your hard disk, then select New Simple Volume.

4. In the New Simple Volume Wizard, select Next.

5. Enter the volume size you want to create in megabytes (MB) or accept the maximum
default size, and then select Next.
6. Accept the default drive letter or choose a different one to identify the partition, then
select Next.

7. In the Format Partition dialog box, do one of the following:

8.

▪ If you don't want to format the volume right now, select Do not format this
volume, and then select Next.

▪ To format the volume with the default settings, select Next.

9. Review your choices, and then select Finish.

Note: When creating new partitions on a basic disk, the first three will be formatted as
primary ones. Beginning with the fourth, each one will be configured as a logical drive within
an extended partition.

To format an existing partition (volume)


Warning: Formatting a volume will destroy any data on the partition. Be sure to back up any
data you want to save before you begin.

1. Open Computer Management by selecting the Start button. Select Control


Panel > System and Security > Administrative Tools, then double-click Computer
Management.

2. In the left pane, under Storage, select Disk Management.

3. Right-click the volume that you want to format, and then select Format.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

4. To format the volume with the default settings, in the Format dialog box, select OK,
and then select OK again.

Notes:

▪ You cannot format a disk or partition currently in use, including the partition containing
Windows.

▪ The Perform a quick format option will create a new file table but will not fully
overwrite or erase the volume. A quick format is much faster than a normal format,
which fully erases any existing data on the volume.

Windows 10 - GUI Basics

Previous Page

Next Page

Once you get to the Windows Desktop screen, here are some basic features you will see.

One of the most important parts of your Desktop is the Taskbar. By default, it sits at the
bottom of your screen, giving you access to the Start Menu, several application icons, and the
Notification Area.
Windows
In Windows 10, if an application is active or opened, you will see a green line below its icon.
Clicking the icon will bring the application window up.

Every open window features three buttons in the upper-right corner. These are used to
minimize, maximize, or close the window −

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

• Minimizing means that the window will hide in the Taskbar.


• Maximizing will bring the window to a full-screen size.
Windows can be moved around or resized as you please −
• To move a window, just click on its Title Bar on the upper side of the window and
drag it.
• To resize a window, move your mouse to any corner until you see a double-sided
arrow. Then click and drag until you reach the desired size.
Icons
Most Windows versions will feature different icons on the background. An icon is simply a
graphic representation of an application or a file. To open or access an icon, just double-click
on it.

Although the amount and type of icons will vary, depending on the computer, you can add
more icons by following these steps −
Step 1 − Right-click on the Desktop Background.
Step 2 − Choose “New” and “Shortcut”.
Step 3 − Browse for the application or file you want to create a shortcut to.
Step 4 − Assign a name to the shortcut and click “Finish.”
Icons can also be moved around by clicking on them and dragging them to another place on
the screen.
Desktop Background
Another component of your Desktop is the Background. This is simply an image that appears
at the back of your screen. Most computers come with a pre-selected background, but you
can change it to any image you want.
To change the background, follow these steps −

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Step 1 − Right-click on the background and choose “Personalize.”

Step 2 − Choose from a series of pre-selected pictures from the Personalization window or
browse for your own.

After choosing a picture, the Background will change automatically.

Windows 10 - Taskbar

The Windows 10 taskbar sits at the bottom of the screen, giving users access to the Start
Menu and icons for frequently used applications. On the right side, the Taskbar features the
Notification Area, which informs the user of different things like the state of the Internet
connection or the laptop battery's charge.

The icons in the middle of the Taskbar are “pinned” applications, which is a way to have
quick access to applications you use frequently. “Pinned” applications will stay in the
Taskbar until you “unpin” them.
Pin an Application to the Taskbar

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Step 1 − Search for the application you want to pin in the Start Menu.
Step 2 − Right-click on the application.
Step 3 − Select the “More” option at the top of the menu.
Step 4 − Select the “Pin to taskbar” option.

This will attach or “pin” the application icon to your Windows Taskbar.
Unpin an Application from the Taskbar
To “unpin” it, just right-click the icon in the Taskbar and select “Unpin from the taskbar.”
You can “pin” it back again any time you want.

Notification Area
The Notification Area is located on the right side of the Taskbar. It shows different
notifications from your computer, such as your Internet connection or the volume level.
At first, the Notification Area shows a limited amount of icons. But you can also click the
upward arrow on its left side to see other icons.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Task View
Task View allows you to move within your open windows and applications quickly. You can
access it by clicking the “Task View” button from the Taskbar.

You can also press and hold the Windows key and then press Tab to achieve the same result.
By pressing the Alt+Tab keyboard shortcut also serves a similar purpose.

Windows 10 - Start Menu

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Previous Page

Next Page

The Start Menu is the main point of access to your applications. There are two main ways to
open it −
Step 1 − Use your mouse to click the Windows icon in the lower-left corner of the taskbar.

Step 2 − Press the Windows key on your keyboard.

The Windows 10 Start Menu features two panes.

The left pane resembles the traditional Start Menu from Windows 7 and earlier, while the
right pane features live tiles used in Windows 8.
Left Pane
Among the things you can do in the left pane are −
• Click the username at the top of the menu to change account settings or log in with
another user.
• Access the applications you use more frequently.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

• A small arrow next to an application will open a sub-menu with a list of recent
documents opened with that application.
• Open the “File Explorer” to navigate your folders and files.
• Change the settings of your computer, like your Internet connection, or change your
background.
• See different options to shut down your computer.
• See a list of all the applications installed in your computer.

Search Box
The “Search box” on the Taskbar will allow you to search for anything you write within your
documents and files or on the Web. The initial results will appear within the Start Menu
itself.
The results will be grouped according to the closest match (or matches) labeled “Best match”
at the top.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

The remaining results will be grouped according to what they are or their location −

• Web results
• Documents or folders
• Apps
• System settings
The icons on the left side of the menu do the following −

The Gear icon will allow you to configure your Search settings.

This icon will let you send Feedback to Microsoft on what you like or dislike about
Windows.

The Cortana icon will activate Windows’ new personal assistant.


Clicking “My stuff” or “Web” at the bottom will expand the Start Menu and limit your results
to the location you choose, as well as streamline the search.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Right Pane
The right pane features a varied array of tiles, similar to those seen on the Start Screen of
Windows 8.
These tiles can be moved and dragged to different places by holding the mouse button.

You can also configure them by right-clicking on them to see options to resize them or
“unpin” them (remove them) from the Menu.
The whole Start Menu can also be resized by dragging the borders with the mouse to the
desired size.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Windows 10 - Tablet Mode

Tablet Mode is a new feature in Windows 10 that allows the user to switch the system
interface whenever a tablet is detached from a base or dock. When the Tablet Mode activates,
the Start Menu goes full-screen. During Tablet Mode, many other windows, like the File
Explorer or the Settings window, also open at full screen.
How to Activate the Tablet Mode?
Step 1 − Open the Start Menu and select “Settings”.

Step 2 − Select the “System” option.


Step 3 − Turn the Tablet Mode switch from “Off” to “On.”

To install such hardware, follow the following steps.


1. Open Device Manager.
2. On the Action tab, click Add Legacy Hardware.
3. On the Welcome To The Add Hardware Wizard page, click Next.
4. Select one of these options: ...
5. Follow the wizard prompts to finish the hardware configuration and provide the driver when
requested.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Update the device driver.


1. In the search box on the taskbar, enter Device Manager, then select Device Manager.
2. Select a category to see the names of devices, then right-click (or press and hold) the one
you'd like to update.
3. Select Search automatically for updated driver software.
4. Select Update Driver.

MODULE 5 NETWORK CONNECTIVITY

What is a Windows workgroup?

According to Techopedia, a workgroup is a peer-to-peer network setup using Microsoft


Windows operating system. It’s a group of computers on a local area network that share
common resources and responsibilities. You can easily create a workgroup by connecting two
or more PCs without going through a separate server computer.

How does a workgroup in a small office or home office work?

Let’s take an example of a small three-person office. John, Amy, and Mark are three
employees of this small office. Every computer on this network will have its own database of
usernames and passwords.
A workgroup is “every man for themselves” without central control. Every PC in a
workgroup is a server and a client simultaneously. A PC will act as a client when it seeks to
access a resource in another PC. The PC that needs to provide access to its resources will act
as a server during the authentication and authorization process.

For instance, if Amy wants to use Mark’s computer, her username and password need to be
created on Mark’s computer. And if Mark wants to use Amy’s computer, his username and
password need to be created on her computer. If both Amy and Mark want to use John’s
computer, their usernames and passwords need to be created on John’s computer.

How to set up a Windows 10 workgroup?

Once you’ve set up your network in your small office, you can follow the steps below to
connect all your devices to a single Windows workgroup:

1. Navigate to the Control Panel > All Control Panel Items > System. You will get to
view basic information about your computer screen.
2. Click on Change Settings under Computer name, domain, and workgroup settings to
arrive at the System properties pop-up.
3. Click on Change to rename this computer.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

4. Under the Computer Name/Domain Changes pop-up, you can join the workgroup of
your choice. Ensure that all the devices you want in a particular workgroup are joined
to that workgroup. In this case, the workgroup is named My Workgroup. The
following image shows where you can enter the name of the workgroup you want to
join.

Setting up a Workgroup

How do I share files and folders in a workgroup?

Now that you’ve set up a workgroup for your small office let’s talk about how to share files
and folders with different users in a Windows 10 workgroup. Let’s assume that you want to
share the My Games folder under Documents.

Follow the steps below to share this folder:

1. Right-click My Games.
2. Click Properties.
3. Click the Sharing tab.
4. Click on Share
5. Choose the people you want to share the folder with and select the permission level.
The following image shows the screen where you can grant access to other users in
the workgroup.
6. While granting access to other users, you must create their usernames and passwords
on your own computer. This is the only way these users can be authenticated.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Sharing a folder with your workgroup

Workgroup challenges for large organizations and the need for Active Directory.

Workgroups are not suitable for larger work environments for two main reasons:

1. They don’t scale well: If the network is small, controlling a workgroup is fairly easy.
However, imagine a scenario in which there are more than 15 computers. Creating
usernames and passwords by visiting each computer would be time-consuming and
tedious. Now imagine a corporation with more than 5,000 computers. It would be next
to impossible to manage user accounts through a workgroup.
2. Passwords do not sync automatically: If a user has changed their password on their
own computer, the change won’t be reflected in the other computers they may try to
access on the network. When prompted to enter their username and password to
access other computers, they’ll need to input the old username and password to gain
access.

Workgroups are great for smaller networks but aren’t efficient for larger ones. For large
networks, it’s vital to keep all the usernames and passwords in sync with each other. To do
this, you need a centralized database that manages all usernames and passwords, called
Active Directory.
Note: A client PC cannot belong to a workgroup and a domain at the same time. If a client
joins a domain, its workgroup membership will be automatically removed. The reverse is also
true.

Workgroup vs domain

Workgroups are great for small office networks with 15 or fewer computers. However, they
aren’t ideal for larger companies with hundreds or thousands of users, as it will become
difficult to access files and folders of one computer with another computer. Simply put, AD
workgroups are fine for small offices, but they are not efficient in scaling to big
organizations.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

So, we need to set up a client-server network environment for big environments. In Windows,
this is achieved by setting up domains. The domain set up ensures better security as we can
give varying degrees of permissions for different users or groups of users. Furthermore, we
can deploy company-wide policies for easier administration in a domain than a workgroup.

How to change the workgroup in Windows 10?

To change a workgroup in Windows 10 and make your computer a part of another


workgroup, you can follow these steps:

1. Right-click on Start, and click on System.


2. Under the Computer name, domain, and workgroup settings, select Change
Settings.
3. Under the Computer Name tab in the System Properties window, click on
the Change button.
4. Under the Member Of tab, change the Workgroup name to the new one.
5. Click on OK to confirm your action.
6. Reboot your device when prompted.

, when using the D400e cameras is:


• Use a static or LLA in case the camera is connected directly to the NIC.
• For connections through a switch is better to use the DHCP type of address.

Dynamic (DHCP)

This is usually the default setting as long as no other configuration is performed.


Its important to highlight that a DHCP server providing these addresses should be available in
the network.

Configuration on Linux – Ubuntu 18.04


1. On the top right menu click on the networking symbol, select wired connected then click
on Wired settings. Finally press the settings button marked in the picture below

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

2. Go to the
IPv4 Settings tab and select under method “Automatic (DHCP)”

Configuration on Windows 10
1. Open the Control Panel from the Windows® icon in the lower left corner of your monitor.
In the Control Panel window, make sure View by is set to Category
2. Click Network and Internet. Then , Network and Sharing Center.
3. Click Change adapter settings in the left pane.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

4. Right click on the Ethernet connection then select properties

5. Select Internet protocol version 4 (TCP/IPv4) and then click on properties


6. In the properties window, select “Obtain an IP address automatically”

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

7. Finally click on “ok” and then close the windows

Link local Only (LLA)

Configuration on Linux – Ubuntu 18.04


1. Follow the step 1 as in the guide for Dynamic DHCP
2. Go to the IPv4 Settings tab and select under method "Link-local Only"

4. Finally, click on Apply to save the changes

Configuration on Windows 10
Windows will automatically set an LLA IP Address if it fails to obtain an IP Address from
the
DHCP server.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Manual

Configuration on Linux – Ubuntu 20.04


1. Follow the step 1 as in the guide for Dynamic DHCP
2. Go to the IPv4 Settings tab and select "Manual."
3. Input the IP settings for the static Address as follows:
4. Finally click on Apply to save the changes

Configuration on Windows 10
1. Follow the step 1-5 as in the guide for Dynamic DHCP
2 In the properties window, select "use the following IP address" and input a static address

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Share your network printer.

Windows 10

In Windows 10, you can share your printer with many PCs on your network. To share a
printer from the PC that the printer is connected to (the primary PC) with secondary PCs that
the printer is not connected to, you must set up sharing settings for the printer, connect the
printer to the primary PC (either wirelessly or by using a USB cable), and then turn on the
printer. Also, make sure the primary PC is turned on, connected to the printer, and connected
to the network.

Note: When sharing a printer, set up sharing settings on the primary and secondary PCs.
Also, make sure you know the name of the primary PC. For more info, see the Set up Sharing
settings and Find your PC name sections at the end of this topic.

Share the printer on the primary PC

There are two ways to share your printer: Settings or Control Panel.

Share your printer using Settings.

1. Select the Start button, then Settings > Devices > Printers & scanners.
2. Choose the printer you want to share, then select Manage.
3. Select Printer Properties, then choose the Sharing tab.
4. On the Sharing tab, select Share this printer.
5. If you want, edit the shared name of the printer. You'll use this name to connect to
the printer from a secondary PC.

Share your printer using the Control Panel.

1. In the search box on the taskbar, type Control Panel and then select Control Panel.
2. Under Hardware and Sound, select View devices and printers.
3. Select and hold (or right-click) the printer you want to share, select Printer properties,
and then choose the Sharing tab.
4. On the Sharing tab, select Share this printer.
5. If you want, edit the shared name of the printer. You'll use this name to connect to
the printer from a secondary PC.

Share your printer using Settings


Share your printer using the Control Panel

Connect the shared printer to another PC

There are two ways to connect a shared printer to another PC: using Settings or Control
Panel.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Connect a shared printer using Settings


Share a shared printer using the Control Panel

Set up Sharing settings

The settings you use to share devices are often turned on by default. If not, follow the steps in
this section to turn settings on using settings or Control Panel.

Turn on Sharing in Settings


Turn on Sharing in the Control Panel

Adding, Configuring, and Changing Windows 10 Accounts

Whether it’s a work computer, a personal computer, or a family PC, any given Windows 10
device may have multiple users with multiple levels of responsibility. The wide range of
options for configuring your Windows 10 accounts, privileges, and permissions addresses
this. Part of the purpose is to protect your system and your personal information—you
wouldn’t want a guest to have full administrative control of your Windows computer and its
security settings, etc. You can also set up accounts to protect users themselves. In a previous
article, we showed you how to set up a Child account using Family Safety which can be
used to do things like manage screen time or restrict Windows Store purchases and web
browsing activity.

Create Additional Accounts

You’ll create your first Windows 10 account when you first set up and configure a new
Windows 10 PC.
If you want to add another user to your computer, you can do so by opening Start > Settings
> Accounts > Family & Other People. Under Other People, click Add someone else to this
PC.

In the resulting dialog, enter a username, password, confirm the password then create a hint.
Click Next to complete the creation of the account.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Delete Accounts

If at any time you would like to delete an account, select the account, open Start > Settings >
Accounts > Family & other people, then click Remove.

Click Delete account and data.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Change Account Privileges

Your account type determines what you can and cannot do in Windows 10. By default, the
first account you set up in Windows 10 is known as a Standard Administrator. This account
can do most tasks, such as installing applications and drivers and adding different types of
users to the computer. When you want to change the privilege of an account, sign in to an
Administrator account and open Family & Other People in Settings. Select the account, then
click Change account type.

Click on the Account type list box, choose your privilege then click OK.

What about other account types in Windows 10?

So, we are aware of the two common account privileges Windows 10 offers by default:
Administrator and User. However, you can apply several types of account privileges to an
account.

You need to access the hidden user accounts control panel item to do that.

To do that, press Windows key + R, type: control userpasswords2, then hit Enter.
Please be aware this is a legacy interface, which Microsoft might one day remove in a future
release. But for now, you can still access it.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

In this dialog, you will see all the accounts available within the system. To change the
privileges of one of the accounts, select an account, then click Properties.
Select the Group Membership tab, then select the Other radio box. Within the list box, you
will find an array of account privileges. Some of these accounts have pretty much the same
functionality. The most common one you might find helpful is the Power Users privileges,
which is just a notch below Administrators. A Power User can create and modify local user
accounts on the computer and share resources such as a printer. The other accounts are more
useful in organizations with different types of users that are part of a large network and
authenticating on a domain.

For a detailed description of each, check out this Technet article.


Also, check out our previous article about creating a guest account in Windows 10 to
temporarily access your device.

Changing Passwords

Updating your password is a healthy security practice every Windows 10 user should do
occasionally. This and other strategies, such as two-factor authentication, can secure your
computer and information. Users can change their passwords after the administrator sets up
their accounts.

Changing passwords can be performed by opening Start > Settings > Accounts > sign-in
options. Under Password, click Change.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Enter your current password. Click Next.

Enter the new password, confirm it then create a hint. Click Next.

Click Finish.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

If you want to change the password for another user, you will have to use the old Control
Panel User accounts item.

To do that, press Windows key + R, type: control userpasswords2, then hit Enter.
Select the account, then click Reset Password. Enter the new password, confirm it, then
click OK.

Switching Between Microsoft and Local Accounts

There are many perks to signing in with a Microsoft account, including syncing your files
with OneDrive or syncing your favorites with Edge. But suppose you’d prefer logging in
the old way due to privacy concerns, internet connectivity issues, or personal preference. In
that case, you can easily switch back and forth between a local account and a Microsoft
account.
Switch from a Microsoft Account to a Local Account.
Open Start > Settings > A

Microsoft Windows Server 2016

What is Windows Server 2016?

Microsoft Windows Server 2016 is Microsoft's server operating system (OS). It was
specifically developed to serve as a platform for running networked applications. Windows
Server 2016 was released for general availability on Oct. 12, 2016, and was developed
concurrently with Windows 10. Mainstream support for Windows Server 2016 ended on Jan.
11, 2022.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Windows Server 2016 is part of the Windows NT family of OSes. Microsoft Windows Server
OS is a series of enterprise-class server OSes designed to share services with multiple users,
providing extensive administrative control of data storage, applications, and corporate
networks.

Microsoft Windows Server 2016 includes new features such as identity management and
enhanced security capabilities designed to help organizations access data safely if stored
locally, in the cloud or in a hybrid cloud. Microsoft Windows Server 2016 has had three
successors: Windows Server 2019, Windows Server 2022, and the Windows Server Semi-
Annual Channel. Windows Server 2016 is the successor to Windows Server 2012 R2.

This image shows the history of Windows Server OS releases from 1993 to 2021.

Notable features in Windows Server 2016

A highly anticipated feature of Windows Server 2016 was the inclusion of two
native containers: Windows Server and Hyper-V containers. Windows Server containers run
directly on the OS but are isolated. Hyper-V containers provide better isolation and run from
a Microsoft virtual machine (VM). Windows Server 2016 also provided built-in support
for Docker.

Other new and updated features in Windows Server 2016 include the following:

• Nano Server is a lightweight installation option designed exclusively for cloud- and
container-based scenarios. Nano Server does not include a graphical user interface or
traditional .NET framework; administrators manage Nano Server instances remotely
using PowerShell and Windows Management Instrumentation. There's also an updated
module for building Nano Server images.

• Network Controller is a new server role that provides a centralized, programmable point
of automation to configure, manage, monitor, and troubleshoot virtual and physical
network devices and services. Network Controller can be used with Microsoft System
Center products, including Virtual Machine Manager, Operations Manager, and
PowerShell.

• Storage Quality of Service (QoS) provides a way to centrally monitor and manage
storage performance for VMs. It automatically improves storage resource fairness
between multiple VMs using the same file server cluster.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

• Storage Replica, a feature new to Server 2016, enables storage-agnostic, block-


level synchronous replication between servers or clusters for disaster preparedness and
recovery.

• Storage Spaces Direct enables highly available and scalable software-defined storage for
servers in local storage. This simplifies the deployment and management of software-
defined storage systems.

• Rolling upgrades for Hyper-V and scale-out file server clusters enable users to add a
Windows Server 2016 node to a Hyper-V cluster with Windows Server 2012 R2 nodes.

• Hot add and remove of memory, officially known as Runtime Memory Resize, enables
administrators to add or remove virtual memory and virtual network adapters while the
VM is running.

• Just Enough Administration is a PowerShell toolkit that restricts users to only perform
tasks for which they are authorized as part of their role.

• Encryption-supported mode offers more protection for default VMs. But it does not
provide as much protection as Shielded mode.

• Identity and Access features include Active Directory Certificate Services, Active
Directory Domain Services, Active Directory Federation Services, Management and
Automation.

• Health Service helps to improve the monitoring, operations, and maintenance of cluster
resources.

Is Windows Server 2016 still being supported?

The first technical preview of Windows Server 2016 was released on Oct. 1, 2014. A second
and third preview were released in May and August 2015, respectively. Windows Server
2016 was officially released on Oct. 12, 2016.

However, mainstream support for Windows Server 2016 ended on Jan. 11, 2022. This means
that the OS only receives security updates but no improvements or bug fixes. The extended
support is set to end on Jan. 12, 2027. Currently, Windows Server 2016 will no longer receive
improvements or bug fixes.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Windows Server 2016 minimum requirements

Windows Server 2016 requires the following hardware:

• a 1.4 GHz processor;

• 512 MB of RAM;

• 32 GB of disk space; and

• an Ethernet adapter capable of 1 Gbps throughput.

Requirements depend on the user's system configuration and the features they choose to
install. Processor performance, for example, depends on the clock frequency of the processor
and the number of processor cores and cache.

What's the difference between the Standard and Datacenter editions?

Windows Server 2016 offers different editions, two of which are the Standard edition and
Datacenter edition. Both editions share many of the same features, but the Datacenter edition
is tailored to organizations with heavier workloads, larger virtual infrastructures and more IT
requirements. Although the Datacenter edition lacks many of the features associated with the
Standard edition, it also provides some extra features that are not included in the Standard
edition.

For example, in the Datacenter edition:

• Users can create unlimited VMs, but only one Hyper-V host is available per license.

• Users can create an unlimited number of Windows and Hyper-V containers.

• There are no limitations as to where a server needs to be hosted. Servers can be either
hosts or guests.

• Software-defined networking, a feature not available in the Standard edition, enables


users to configure and manage their physical and virtual network devices centrally.

• Shielded Virtual Machines, also available in the Standard edition, help provide secure
boot, trusted platform modules, and disk encryption.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

The end of the operating system


PREPARED BY

ENGR.NISAR AHMAD

(B.SC (PAK) B.S (TURKIA) M.S (TURKIA)

CCNA, MCSE, MCDBA

For more detail

Please visit our website

www.ncmt.edu.pk

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

SUBJECT: INTRODUCTION TO Computer programming

MODULE 1 INTRODUCTION TO PROGRAMMING

What is Programming?

Writing a set of instructions for a specific task to be done by the computer is known
as Programming.

What is a Programming Language?

Computers don't understand our languages like English, Hindi, French, Spanish, Chinese,
Japanese, etc. Computers only understand 0's and 1's. The vocabulary, which consists
of 0's and 1's, is called Machine Language. It's challenging to write instructions in 0's and 1's.
Therefore, we humans created a style to instruct the computers to complete specific tasks,
i.e., Programming Language. Programming languages, also known as High-Level
Languages, can be understood by humans. Additionally, machine language is also known
as Low-Level Language.

Some of the programming languages are C, Java, C++, etc.

Another language called Assembly Language converts our human-readable code, i.e.,
programming language, to an assembly-level language. Examine the pic for more clarity.

What is a Program?

A set of instructions that a computer executes is known as a Program.

Terminology

Every language, including Natural Languages, which we use in our daily conversations, has
rules to follow. Let's see them one by one.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

1. Alphabets

o Any language has a particular set of symbols to form words.


o English has Latin alphabets; Japanese has Kanji, and so on and so forth.
o Moreover, the Alphabet the building block of the language.
2. Lexis

o A collection of words that a language has to create sentences.


o Prepositions, Articles, etc. in English.
o In programming, we call them as keywords. Every programming language has a
set of predefined words that we need to use to write instructions.
3. Syntax

• A set of rules to examine whether the sentence is valid or not.


• We need to arrange the words of a language in a well-defined format to form correct
sentences.
• For example, "Are you how?" doesn't have valid syntax. Whereas the
sentence, "How are you?" does.
• Similarly, we need to write valid instructions for the computer that should be
understood by the computer.
• Moreover, the arrangement of words and phrases creates well-formed sentences.
• In the context of computers, it refers to the proper ordering of symbols and codes,
which, in turn, helps the computer understand what instructions are telling it to do.

4. Semantics

• A set of rules to examine whether a phrase is making any sense or not.


• We need to create sentences that make sense to use. For example, the sentence Statue
of Liberty is moving doesn't make any sense. However, the syntax of the sentence is
correct.
• Therefore, in programming, we must ensure our instructions are well-semantic.

What are Comments in Code?


Every programming language has a concept called comments. What are these comments?
And what's the use of these comments in the code?

Comments are the statements that are ignored by the interpreter or compiler at runtime. If
you have comments in the code, then the compiler ignores those statements. Moreover, every
coding language has syntax, differentiating a comment from actual code.

What is a Compiler in Programming?

• A compiler takes your written instructions and validates them according to the
language syntax. If everything is good, it will give you the output.
• The compiler will throw errors if the code is not valid.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

• Moreover, different programming languages have different compilers.


• Languages like C, C++, etc. , use the GCC compilers to execute the programs.
• We will have multiple compilers for one programming language. Users will choose
according to their needs.
• Additionally, the compiler will go through different stages in the execution process.
• Ultimately, it converts the instructions into Machine Language that the computer can
understand.
• It generates an executable file. Therefore, we don't have to execute the program every
time to see the result.
• See the below illustration.

What is Interpreter in Programming?

• An interpreter is also similar to a compiler. It validates the syntax and gives you the
result if everything is correct.
• For languages like Python, Perl, etc. , use the interpreter.
• It converts the source code into an intermediate form and then executes it.
• Additionally, we must run the program every time to see the result.
• See the illustration.

When both compiler and interpreter execute the programs, what's the difference? Let's
examine the differences between them.

Difference between Interpreter and Compiler

Attributes Interpreter Compiler


1. One Statement at a time.2. 1. All statements at once. 2.
Execution Compilation and Execution will occur Execution starts after the
simultaneously. compilation of the code.
Execution Speed Slower compared to the Compiler Faster than Interpreter

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Attributes Interpreter Compiler


Halt the program when it finds an Displays all errors at the end of the
Error Handling
error. program.
The compiler takes more memory
It requires less memory as it compiles
Memory than the interpreter for compilation
and executes at the same time.
and execution.
Error Correction Easy Hard compared to Interpreter.
Programming
Python, Perl, Ruby, Matlab, etc. C, C++ , C#
Languages

Features of Python

• Beginner Friendly

o Python is very handy for learning syntax. Anyone can quickly learn its syntax
without any difficulty. It's easy to teach. In addition to that, the time required
to learn Python is much less than that of other languages.
o Moreover, Python's syntax looks like that of general English.
• Portability

oYou can run your Python code anywhere, irrespective of the machine or
software you are using.
o Moreover, Python follows the statement "code once run everywhere".
o For example, you have written a program in Windows and can also use that
program to run in Linux.
• Dynamic

o You don't need to declare the type of an object in Python. In other words, it
automatically detects the type of object based on the value that we have given.
o For example, you can directly assign integers, floats, strings, etc., to variables
without bothering about the declaration like C. To clarify, let'

Open-source

• It's an open-source language. You can also contribute to the Python project.
• Standard Library
• Additionally, Python has a large set of standard libraries that help you in different
aspects.

MODULE 2 GETTING STARTED WITH PYTHON

1. Install Python

o Linux
o Windows

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

o Mac OS X

Install Python
We need to install Python to start coding in it. It's open-source. So, we don't need to pay for
anything. Therefore, let's see how to install it on your PC. We will see the installation guide
for both Linux and Windows.

Install Python on Linux


Most probably, Linux distributions have already installed Python. As a result, you don't need
to worry about the installation.

Check your Python version by typing the Python --version command in the terminal. If you
run the command, it will return the Python version.

Additionally, if your PC doesn't have Python installed, run the following command to install
it.

• sudo apt-get install python3.8

Install Python on Windows


Go to the Python Official website and download the file by clicking the Download Python
[lastest version] button. I highly recommend you to download the latest version of Python.

Note: If we click on the download button, the latest Python version of the .exe file will
automatically download.

Firstly, double-click on the file to start the installation. A dialogue box will open as follows.

After that, leave the default option Install launcher for all users (recommended) to install it
for all the users. Check the Add Python 3.8 to the PATH option to install it globally. After
this, click on Install Now. Permit to install it when it asks.

Additionally, you can see the progress of the installation in the above picture.

Consequently, you have successfully installed the Python on your PC. Run the
Python command in the command line to start Python's interactive mode.

Install PyCharm for Python


PyCharm is a JetBrains IDE for Python. It's one of the most popular IDE for Python. We
are going to use the PyCharm IDE in this course. You can skip installation if you have
PyCharm already on your PC.

Install PyCharm on Windows

1. First, go to the PyCharm official page to download the package.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

2. Secondly, scroll down to the download section.

3. Thirdly, choose Windows(.exe) from the drop-down menu in the community section.

4. Fourthly, click the download button.


5. After downloading the file, double-click it to start the installation process.

6. After this, click the Next button. You will see the following screen.

7. Finally, select the installation folder. I recommend you to leave the default folder for
installation. Click Next. In the next step, you will see installation options.

8. After that, select a 64-bit launcher for the Desktop shortcut. Additionally, add launchers
dir to the PATH for environment variable setup. Click Next.

9. After that, click the Next button.

10. Finally, click the Install button to start the installation.

11. If it asks for the reboot, then restart the PC. And you finished the most boring part of the
coding.

What is IDE?
IDE [Integrated Development Environment] is a software application that generally has a
source code editor, builds automation tools, and a debugger. In other words, it makes the life
of programmers easy.

Python IDE
There are several Python IDEs on the market. Some of the important ones are as below:

• PyCharm
• IDLE
• Sublime Text 3
• Visual Studio Code
• Atom
• Spyder

IDE saves developers much time. Let's see some benefits of using an IDE.

• Firstly, they do faster coding compared to other normal text editors. IDEs
autocomplete the syntax for us.
• Secondly, they help in managing the projects. We bundle everything necessary for the
project.
• Thirdly, they provide debugging tools for correcting the code.
• Finally, IDE (e.g., PyCharm) prompts us to follow the PEP8 - Pytho's style guide.

PyCharm - Best Python Editor


We have installed the PyCharm in the previous tutorial. Now, let's see how to work with
PyCharm.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

1. First, open the PyCharm. A screen will appear like the following image.

2. Second, click on the Create New Project button.

3. Third, choose the directory and name of your project (e.g., toolsqa). Leave the below part
as it is.

4. Fourth, click the Create button.

5. Finally, you will get the welcome screen as it is the first time. Select the option Show tips
on startup to get some helpful advice whenever you open the PyCharm.

6. After that, click the Close button to close the Tip of the Day window.
7. Your project screen will look like the below image.
8. Your project folder (toolsqa) doesn't have anything now. The External Libraries folder
will contain Python3.8 (based on the version you are on)

9. Right-click on the project folder (toolsqa) to create a Python file and go to New.

10. A window will appear that asks you to name the Python file.

11. After this, type the name and hit Enter to create the Python File in the project folder
(toolsqa). Now, your project folder will contain a Python File

12. Double-click on the Python File to open it in the PyCharm editor.

13. Write the following code into the file and press Ctrl + S to save it. Don't worry
about print(). For now, remember that it takes a value and prints it. We are going to talk
about this in future lectures.

print('Hello, World!')
14. After this, to run the file for the first time, go to the Run menu and click the Run button.
Additionally, you can also use the shortcut Alt+Shift+F10 to run the file.

15. You will get a window and hit Enter.

16. You will see the output at the bottom of the PyCharm.

17. Next time onwards, click the Run button at the top right corner to run the current file.
You can also use shortcut Shift + F10 to run the program.

Several types of errors can occur in Python. Each type indicates a different kind of problem
in the code, and comprehending these error types is crucial in creating effective Python
applications.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

The most common types of errors you'll encounter in Python are syntax errors, runtime
errors, logical errors, name errors, type errors, index errors, and attribute errors. Let's go
through each with examples.

1. Syntax Errors

A syntax error occurs in Python when the interpreter is unable to parse the code due to the
code violating Python language rules, such as inappropriate indentation, erroneous keyword
usage, or incorrect operator use. Syntax errors prohibit the code from running, and the
interpreter displays an error message that specifies the problem and where it occurred in the
code. Here's an example of a Python syntax error:

x = 10
if x == 10
print("x is 10")

When the above code is executed in an IDE, we get the following output message that
describes the error and the location in the code where it occurred:

2. Runtime Errors

In Python, a runtime error occurs when the program executes and encounters an unexpected
condition that prevents it from continuing. Runtime errors are also known as exceptions and
can occur for various reasons such as division by zero, attempting to access an index that is
out of range, or calling a function that does not exist.

3. Logical Errors

A logical error occurs in Python when the code runs without any syntax or runtime errors but
produces incorrect results due to flawed logic in the code. Incorrect assumptions, an
incomplete understanding of the problem, or the incorrect use of algorithms or formulas often
cause these types of errors.

Unlike syntax or runtime errors, logical errors can be challenging to detect and fix because
the code runs without producing error messages. The results may seem correct, but the code
might produce incorrect output in certain situations. Here is an example of a logical error in
Python:

def calculate_factorial(n):
result = 1
for i in range(1, n):
result = result * i
return result

print(calculate_factorial(5))
Output:

24

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

MODULE 3 VARIABLE IN PYTHON


What is a Variable in Programming?
We use Variables to store the values. Why do we have to save the values? The answer is
simple- for future purposes. In other words, if you want to write a program that counts the
number of even and odd numbers in a range, then you need to store the count to display it to
the users.

Variables contain mainly two parts: one is a name, and the other one is a value. Moreover,
Values may be of different data types.

Python Variable Syntax


We use an assignment operator(=) in Python to assign or store the values into a variable.
Additionally, an assignment operator is nothing but equal to (=) symbol. The left side of the
assignment contains a name. In the same way, the right side of the assignment includes a
value.

variable_name = value
The variable_name is the name of the variable. Moreover, the value is the information or
data to be stored in the variable. Subsequently, you will get to know the different types of
data stored in variables.

We have special rules for naming the variables in Python. We have to follow those rules to
name the variables. Let's see how to call the variables in Python.

Python Variable Naming Convention


Python has some rules to define the names of variables. We can't call the variables however
we want. Therefore, we should follow the rules below when naming the variables.

• Firstly, Python allows using only alphabets, digits, and underscores (_) for the
naming of variables.
• Secondly, Variable names must start with _ or alphabets. Moreover, the alphabet may
be lowercase or uppercase.
• Thirdly, we cannot use Python keywords as a variable name. Keywords are reserved
words of Python, which has unique functionality.
• Lastly, variable names in Python are case-sensitive, i.e., uppercase letters are
different from lowercase letters. For example, NISCOM is different from niscom.

So, we now know the rules of naming variables in Python. Let's see some valid and invalid
variables. Additionally, we will learn to detect the error of invalid variables in code.

• _3 is a valid variable name, as it follows all the above rules.


• NISAR COLLEGE is also a valid name.
• Moreover, 3NISAR COLLEGE is an invalid variable name, as it starts with a digit.
We can't begin the variable with a figure.
• Tools@A is an invalid name, as it contains a unique character @.
• Similarly, NISAR COLLEGE is an invalid name, as it contains a space.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Now you know the naming rules of a variable in Python. Answer whether False is a valid
variable name or not.

If you follow the tutorials from the first, you will know that False is one of the keywords in
Python. Additionally, we can't use keywords as variable names. Hence, False is not a valid
variable name in Python. Let's see other keywords.

Python Keywords
Keywords are the reserved words in Python. Moreover, these keywords have different
meanings for various purposes. See the list of keywords.

['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue',
'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is',
'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']

We can't use the above keywords to name variables in our code. However, we can use them
by changing the case of any letter in the keyword. For example,

Python Literals - Boolean


Python literal Boolean has two values. One is True, and the other is False. In any
programming language, Booleans have only two values. In the same vein, Python language
also exhibits the same properties. Any non-zero value is True, and the value zero is False.
Additionally, 1 and 0 represent True and False, respectively.

In addition to the above, Python has a method called bool() to convert any object into a
boolean value. Let's examine the process in detail.

bool()
Based on the argument, the function bool() returns either True or False . Moreover, it takes
one or zero arguments. That is to say, if we don't pass anything to the bool(), then it will
return false. Moreover, for any non-zero value bool() returns True. Let's see some examples.

# boolean value of a non-zero


print(bool(5))
The output of the above code is True. We have passed a non-zero value. Therefore, it returns
True.

Guess what the output of the following code will be.

# boolean value of zero


print(bool(0))

Some quick examples where the function bool() returns True.

# float

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

print(bool(7.59))

# strings
print(bool("ToolsQA"))
print(bool('ToolsQA'))
We have different situations where the function bool() returns False. Let's see some quick
examples.

Python Arithmetic Operators


Python Arithmetic operators take numeric values as operands and return a single value as a
result. Additionally, we have the following arithmetic operators in Python.

Symbol Operator

** Exponentiation

* Multiplication

/ Division

// Floor Or Integer Division

% Modulo

+ Addition

- Subtraction

Let's discuss these in detail.

Precedence and Associativity


Let's understand it with a simple example.

Compute the expression 2 + 5 * 7

Based on which operator you evaluate first, you will either get 37 or 49 as an answer. So let's
understand some rules around it.

Precedence
The correct answer for the expression 2 + 5 * 7 is 37. We got the result by performing
multiplication first, and then the addition operation. The expression evaluates as 2 + 5 * 7 =>
2 + 35 => 37.

Run the same example in IDE and check the answer.

So why is multiplication evaluated before addition?

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

It's because Python has already defined the precedence of the operators based on which the
expression evaluation happens. This precedence is the same across all the other languages as
well.

What are Shortcut Operators?


Let's take an example of variable assignment and increment

count = 1;

count = count + 1;

If we look at this operation, we have got the count variable on both sides of the expression. In
addition to that, it is a time-consuming and less efficient way of writing code.
Most programming languages have a more efficient way to write this. Python follows the
same path.

With Python's shortcut operators, we can write the same expression as

count += 1;

# normal operation
count = 0
count = count + 1
print(count)
In the statement count = count + 1, we have the same variable on the operation's left and
right sides. So we can use shortcut variations for the addition operation. Let's see the same
example with the shortcut addition operator.

# shortcut operators
count = 0
count += 1
print(count)

• The variable count has a value 0 in the first line.


• In the second line, we have added 1 to the count.

What's the output? You can say it as 1. And it's perfect.

If you see the output of the above program and the previous one, both are the same. There is
no difference. And this is how we reduce the length of the expressions using shortcut
operators.

Similarly, see the following example with the integer division.

# shortcut operators
toolsqa = 100
toolsqa //= 2

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

print(toolsqa)
We can use all the arithmetic operators as shortcut operators. Here are some more examples

We can represent a = a3 as a*=3*

We can represent b = b/4 as b/=4

• What are python comparison operators?


• Python Comparison Operators
o Equal To Operator in Python.
o Not Equal To Operator in python.
o Greater Than Operator in Python.
o Less Than Operator in python.
o Greater Than Equal To Operator in python.
• Less Than Equal To Operator in python.
• Reference for Python comparison operators.

Operator Description Example

a = 20, b = 20 a == b
Equal-To (== ) Decides whether the values are equal or not.
returns True

a = 10, b = 12a != b
Not-Equal-To (!= ) Decides whether the values are unequal or not.
returns True

a = 25, b = 10 a > b
Greater-Than (> ) Decides whether the left value is greater or not.
returns True

a = 10, b = 25 a < b
Less-Than (< ) Decides whether the left value is lesser or not.
returns True

Greater-Than-Equal- Decide whether the left-value is greater or a = 10, b = 10 a >= b


To (>= ) equal to the right value or not. returns True

Less-Than-Equal-To Decides whether the left value is lesser or equal a = 34, b = 34 a <= b
(<= ) to the right value or not. returns True

MODULE 4 STRING

Python Literal - Strings

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Text with single or double quotes at the start and end is a string. Examples of strings
are "NISCOM," '759', etc. Moreover, Python does not have a particular representation of
strings. We can use the examples directly in Python programs. Let's practice some coding.

Write the following code in the IDE and run it.

# string
print("NISCOM")
Consequently, the output of the above code is ToolsQA. Let's see the same example with
single quotes.

# string
print('NISCOM')

Can we print strings without any content?


Of course, Yes! They are called empty strings. We can use them in coding as well. Moreover,
they neither represent anything nor print anything. In addition to this, you will learn how to
use empty strings when you have good programming knowledge.

For now, let's see what happens when we print empty strings.

# empty strings
print("")
print('')
We got nothing in the output console. That's what we expected.

What if we want to print a string with double or single?


For example, I want to print the text "ToolsQA" is one of the great websites to learn
programming. We have two ways to achieve the result. First, as we have already seen a
method using the escape character, let's see the second way to accomplish this.

Another method is to use other quotes that haven't applied to enclose the string. In other
words, whenever you want quotes in the output string, use the quotes inside the string that
haven't been used to enclose the same string. Let's see the example to get clarity.

# string with quotes


print('"'NISAR COLLEGE OF MANAGEMENT AND TECHNOLOGY SWAT.')
Additionally, if you want single quotes in the output, then swap the quotes in the above code
as follows.

# string with quotes


print("'NISAR COLLEGE OF MANAGEMENT AND TECHNOLOGY SWAT.")
As mentioned in the examples, play with the strings using single and double quotes.
Subsequently, we will learn a lot about the strings in the upcoming tutorials. It is to get you
started with the concepts.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

str()
str() is similar to the functions int and float. Additionally, it helps to convert objects into a
string. And it takes one or zero arguments. In other words, if we don't pass anything to
the str() function, then it returns an empty string. Let's see what happens if we don't pass
anything to the str function.

# str without any arguments


print(str())
As a result, the function str without any arguments returns an empty string.

See an example of converting the integer to a string. We can directly pass the integer to
the str function.

We got the output as 1234. But how do you confirm that it is a string? Let's see some more
examples to ensure that the str function's result is a string.

Execute the following program in your IDE.

print(1234 + 1)
Consequently, we will get the number 1235 as output.

Now, run the following program.

print(str(1234) + 1)
Did you get the output? No! But why? First, let's see the error and the reason behind it.

The error Python threw on us is that we can only concatenate str (not "int") to str. In other
words, we can't add an integer to a string. Remember that we can't add a string to an integer
in Python. That is the reason why it shows us an error. Conclusively, we can say that the
result of the str function is a string.

How to get rid of that error? We can solve it by knowing the meaning of concatenate in
Python.

Search and see the general meaning of concatenate. In simple words, concatenate means link
together. That is to say, Python links one string at the end of another string using the
operator +. Let's see how to rectify the above error using it.

Firstly, modify the code of the previous program as follows.

print(str(1234) + "1")
After that, guess the output. And check it with the actual output.

Code_11Finally, we didn't get any errors. Moreover, Python links the second string to the end
of the first string. We will talk about it in detail in the later tutorials.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Remember, the + operators act as a concatenator only if both the operands are strings.
Additionally, if anyone of them is not a string, we will get an error, as seen in the previous
tutorials. Let's recap it by executing an example.

# concatenation
name = "ToolsQA" + 2020
print(name)
Got an error, as we expected.

Can we use the concatenation operator directly in the print() function? Yeah! We can. We
have already used it in the previous tutorials. For example, see the below:

# string concatenation in print


print("Tools" + "QA")

We can use concatenation in the print () function.

What is concatenation? The meaning of the word concatenation tells everything about the
functionality. It links in a chain or series. In other words, the concatenation operator
connects one string at the end of the other.

For example, let's have a look at some expressions:

• "Tools" + "QA" => "ToolsQA"


• "Hi, " + "I'm from ToolsQA" => "Hi, I'm from ToolsQA"

MODULE 5 LIST IN PYTHON

In Python, lists are used to store multiple data at once. For example,

Suppose we need to record the ages of 5 students. Instead of


creating 5 separate variables, we can create a list:

Lists Elements

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Create a List

A list is created in Python by placing items inside [] , separated by commas


. For example,
# a list with 3 integers
numbers = [1, 2, 5]

print(numbers)

# Output: [1, 2, 5]
Run Code

Here, we have created a list named numbers with 3 integer items.


A list can have any number of items and may be of different types (integer,
float, string, etc.). For example,

# list with mixed data types


my_list = [1, "Hello", 3.4]

# empty list
my_list = []

# list with duplicate elements


my_list = [1, "Hello", 3.4, "Hello", 1]

Access List Elements

In Python, lists are ordered , and each item is associated with a number.
The number is known as a list index.
The index of the first element is 0, the second element is 1 , and so on. For
example,
languages = ["Python", "Swift", "C++"]

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

# access item at index 0


print(languages[0]) # Python

# access item at index 2


print(languages[2]) # C++
Run Code

In the above example, we have created a list named languages .

List Indexing in
Python

Here, we can see each list item is associated with the index number. We
have also used the index number to access the items.

Note: The list index always starts with 0. Hence, the first element of a list is
present at index 0, not 1.

Negative Indexing in Python

Python allows negative indexing for its sequences. The index of -1 refers to
the last item, -2 to the second last item and so on.
Let's see an example,

languages = ["Python", "Swift", "C++"]

# access item at index 0


print(languages[-1]) # C++

# access item at index 2


print(languages[-3]) # Python
Run Code

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Python Negative
Indexing

Note: If the specified index does not exist in a list, Python throws
the IndexError exception.

Slicing of a List

In Python, it is possible to access a portion of a list using the slicing


operator : . For example,
# List slicing in Python

my_list = ['p','r','o','g','r','a','m','i','z']

# items from index 2 to index 4


print(my_list[2:5])

# items from index 5 to end


print(my_list[5:])

# items beginning to end


print(my_list[:])
Run Code

Output

['o', 'g', 'r']


['a', 'm', 'i', 'z']
['p', 'r', 'o', 'g', 'r', 'a', 'm', 'i', 'z']

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Here,

• my_list[2:5] returns a list with items from index 2 to index 4.


• my_list[5:] returns a list with items from index 5 to the end.
• my_list[:] returns all list items

Note: When we slice lists, the start index is inclusive, but the end index is
exclusive.

Add Elements to a List

Lists are mutable (changeable). Meaning we can add and remove


elements from a list.
Python list provides different methods to add items to a list.

1. Using append()
The append() method adds an item at the end of the list. For example,
numbers = [21, 34, 54, 12]

print("Before Append:", numbers)

# using append method


numbers.append(32)

print("After Append:", numbers)


Run Code

Output

Before Append: [21, 34, 54, 12]


After Append: [21, 34, 54, 12, 32]

In the above example, we have created a list named numbers . Notice the line

numbers.append(32)

Here, append() adds 32 at the end of the array.


2. Using extend()

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

We use the extend() method to add all the items of an iterable


(list, tuple, string, dictionary, etc.) to the end of the list. For example,
numbers = [1, 3, 5]

even_numbers = [4, 6, 8]

# add elements of even_numbers to the numbers list


numbers.extend(even_numbers)

print("List after append:", numbers)


Run Code

Output

List after append: [1, 3, 5, 4, 6, 8]

Here, numbers.extend(even_numbers) adds all the elements of even_numbers to


the numbers list.
3. Using insert()
We use the insert() method to add an element at the specified index.
numbers = [10, 30, 40]

# insert an element at index 1 (second position)


numbers.insert(1, 20)

print(numbers) # [10, 20, 30, 40]


Run Code

Change List Items

Python lists are mutable. Meaning lists are changeable. And we can
change list items by assigning new values using the = operator. For
example,
languages = ['Python', 'Swift', 'C++']

# changing the third item to 'C'


languages[2] = 'C'

print(languages) # ['Python', 'Swift', 'C']


Run Code

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Here, initially, the value at index 3 is 'C++' . We then changed the value
to 'C' using

languages[2] = 'C'

Remove an Item From a List

1. Using del Statement


In Python we can use the del statement to remove one or more items from
a list. For example,
languages = ['Python', 'Swift', 'C++', 'C', 'Java', 'Rust', 'R']

# deleting the second item


del languages[1]
print(languages) # ['Python', 'C++', 'C', 'Java', 'Rust', 'R']

# deleting the last item


del languages[-1]
print(languages) # ['Python', 'C++', 'C', 'Java', 'Rust']

# delete the first two items


del languages[0 : 2] # ['C', 'Java', 'Rust']
print(languages)
Run Code

2. Using remove()
We can also use the remove() method to delete a list item. For example,
languages = ['Python', 'Swift', 'C++', 'C', 'Java', 'Rust', 'R']

# remove 'Python' from the list


languages.remove('Python')

print(languages) # ['Swift', 'C++', 'C', 'Java', 'Rust', 'R']


Run Code

Here, languages.remove('Python') removes 'Python' from the languages list.

List Methods

Python has many useful list methods that make it really easy to work with
lists.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Method Description

append() add an item to the end of the list

extend() add all the items of an iterable to the end of the list

insert() inserts an item at the specified index

remove() removes item present at the given index

pop() returns and removes item present at the given index

clear() removes all items from the list

index() returns the index of the first matched item

count() returns the count of the specified item in the list

sort() sort the list in ascending/descending order

reverse() reverses the item of the list

copy() returns the shallow copy of the list

Iterating through a List

We can use a for loop to iterate over the elements of a list. For example,
languages = ['Python', 'Swift', 'C++']

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

# iterating through the list


for language in languages:
print(language)
Run Code

Output

Python
Swift
C++

Check if an Element Exists in a List

We use the in keyword to check if an item exists in the list or not. For
example,
languages = ['Python', 'Swift', 'C++']

print('C' in languages) # False


print('Python' in languages) # True
Run Code

Here,

• 'C' is not present in languages , 'C' in languages evaluates to False .

• 'Python' is present in languages , 'Python' in languages evaluates to True .

List Length

We use the len() function to find the size of a list. For example,
languages = ['Python', 'Swift', 'C++']

print("List: ", languages)

print("Total Elements: ", len(languages)) # 3


Run Code

Output

List: ['Python', 'Swift', 'C++']


Total Elements: 3

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

List Comprehension

List comprehension is a concise and elegant way to create lists. For


example,
# create a list with value n ** 2 where n is a number from 1 to 5
numbers = [n**2 for n in range(1, 6)]

print(numbers)

# Output: [1, 4, 9, 16, 25]


Run Code

Here, this code

numbers = [n**2 for n in range(1, 6)]

is equivalent to

numbers = []

for n in range(1, 6):


numbers.append(n**2)

MODULE 6 CONDITIONAL STATEMENTS

• What is a Conditional Statement in Python?


o If Conditional Statement in Python.
o Else Statement in Python.
o Elif Conditional Statement in Python.
o Python Cascaded If Statements
o Switch Case in Python.
o Python Pass Statement.

What is a conditional statement in Python?


A conditional statement in Python, also called a condition constructs, is a statement that
accommodates a condition inside itself. This condition is constructed using the bitwise,
boolean, and comparison operators in Python. A conditional statement always generates a
boolean output that is either true or false. (Note that true is represented as True in Python and
false as False). After generating the output, the statement decides whether to move inside the

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

conditional block or leave it as it is. The code inside the conditional block is executed if and
only if the conditional statement returns true. (from expressions inside the construct)

If Conditional Statement in Python


The most straightforward and most used conditional statement in Python is the "if
" statement. A lot of the times, you have to decide whether to do "A " or do "B ". The "if
" statement, as its name suggests evaluates the expression. Moreover, it executes the
conditional block only when the statement is true. You can remember the statement as:

if (something is True)

//execute the statements

For example, I have a variable age whose value is 40. Then, with the code given below, the
print statement will be executed only if the age is 40.

age = 40
if(age == 40):
print("The age is 40")
To refresh your memories, recall that Python does not use braces to represent the code blocks
and uses colon instead. All the code intended to be inside the conditional statement should b
indented properly and in alignment. Misalignment of even one space can lead to exceptions
and errors.

Else Statement In Python


Otherwise, a conditional statement is a simple response to the "if " conditional statement. For
example, if this does not happen, what else would? Therefore, whenever the "if " statement
returns False and the conditional block from "if " skips, the conditional block from "else "
executes.

Continuing from the previous example, I am now 35 and have an "if " statement that prints
the age. If my age is 40, it will print; otherwise, another print statement will be executed,
telling me that my age is not 40.

age = 35
if(age == 40):
print("The age is 40")
else:
print("Age is not 40")
The above execution would return the following results:

All right! We now know how to execute some code based on certain conditions. In other
words, if the condition is true (execute if block) otherwise, execute else block if the condition
is false. However, there is one more use case in conditional statements. What if we want to
put up one more check once the "if " condition fails and not execute the else statement
directly?

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Elif Conditional Statement in Python


Elif is a rather unique term, as other programming languages don’t use it. Other programming
languages use "else if " to put up one more condition. While Python combines "else and if
" and makes it an "elif " conditional statement. The usage of the "elif " statement will
become clearer through the code given below.

Continuing on the same example, we will try to put up one more check in case the "if
" conditional statement fails. Guess the output for the following code:

age = 35
if(age == 40):
print("The age is 40")
elif(age == 35):
print("Age is 35")
You are right if you guessed the following output:

Since the indentation in Python is similar to the "{ " in other programming languages, we can
skip the indentation if we have to execute only a single statement. We follow the same
practice in other languages, too! So, writing the "if " statement as follows:

if(condition): print("If statement Executed")


is equivalent to the following:

if(condition):
print("If statement Ecxecuted")
In addition, you can combine various "if-elif-else " statements, giving rise to a cascading
conditional block, which we will discuss in the next section.

Python Cascaded If Statements


"cascade " means a waterfall-like structure where we follow one step after another. To use
cascade statements in Python, we use "if-elif-else " statements that we have discussed above
in great detail.

if(condition):
#code
elif(condition):
#code
elif(condition):
#code
else:
#code
Note: In the above statement, I have used two "elif" statements. Practically, you can use as
many as you want, although we always recommend fewer numbers.

Python cascaded statements are a good way to build up your logic in minimum lines keeping
in mind the consistency of the structure maintained. The "if " block works as an "entry
" gate of the complete conditional block in Python. The "if " block will always test first when

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

we run the condition block. If the condition is satisfied, the code within "if " is executed, and
we exit the conditional block. If the condition is not satisfied, we move ahead to the first "elif
" block and the same process follows until the end.

Therefore, only one of the code block executes, when any of the "if-elif" statements
satisfies, we execute the code and skip the rest of the conditional block.

The else block is the last block that will execute when no other statement satisfies. This is
totally optional and if your code does not require the execution of a statement necessarily,
you don't need to put up an else statement.

The following code snippet prints the range of the age of the user. Try to understand the code
with respect to the cascading conditional statements (conditional statement inside another
conditional statement).

age = 35
if(age > 60):
print("Senior Citizen Benefits Applicable")
elif(age > 21):
if(age > 40):
print("Benefits Renewed Automatically")
else:
print("Your Benefits Have Lapsed, Please Renew")
else:
if(age > 13):
print("Benefits Covered Under Parental Scheme")
else:
print("Benefits Covered Under Government Childcare Scheme")
Run the above code and verify your guessed output with the console output. Always
remember that the indentation of the statements should be proper otherwise Python would
mix up the structure and the output would not be as expected. Also, try to change the variable
values and see what output generates. Feel free to extend the code and share it with us for
other learners.

Switch Case In Python


If you have a C++ or Java background like mine, this statement is going to look a bit
odd. Python does not have a switch statement. Suppose Python is your first language and
you have no idea about the switch statement. In that case, you can learn more about the
conventional switch case statement, by visiting the Switch Case Implementation. I know it
feels odd because even though Python has been around for a long while now, "switch case in
Python " is still a popular search term on Google. So, if Python does not have a switch
statement, what do we have for replacement?

The intuitive way that comes to mind is to use a series of "if-elif-else” statements and
implement the logic. However, "if-elif-else” is prone to errors since more conditions lead to
more complex nested statements. If you are comfortable, you can achieve the same using
the "if-elif-else " statements.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Another way is to go for the dictionary switcher method. In this, we can create a function
with a dictionary called switcher. Moreover, we can construct the dictionary using the key
and value pairs just like a case statement in the conventional switch method. The explanation
of the same is there using the code below:

def season(i):
switcher={
0:'Winter',
1:'Summer',
2:'Spring',
3:'Autumn',
4:'Monsoon',
5:'Fall',
}
return switcher.get(i,"Invalid Season")

print(season(2))
Just like case (i), we can put the function name in place of the case. With the same intentions,
we will get the following output:

And hence, you can use the switch statement with some minor tweaks. This was just to widen
your knowledge spectrum in Python, which is not a part of the PCEP certification course.

MODULE 7 LOOPS IN PYTHON


Python Pass Statement
The final section for our conditional statements in Python is the pass statement. Just like the
switch statement in Python, the pass statement is also specific to it. Other programming
languages don’t use it.

The Pass statement in Python resolves the problem of an empty code block or a stub code.
In programming, we often leave some functionality blocks empty without any
implementation. Because, at that point, we are not sure what would come in those blocks.
Since other programming languages use "{ " or such delimiters to determine the start and end
of a code block under conditional statements, Python does not have this construct.

With predefined delimiters, we can just leave the code part and we should understand it
implicitly. Doing the same results in an error in Python. For example, in the below code I
have left the if conditional block without any implementation:

age = 40
if(age == 40):

print("If Statement Executed")


Executing the above code gives the following error:

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

This error means that Python needs something inside that is indented if it is a conditional
statement and cannot be left empty. To resolve this issue, we use the "pass " keyword. Using
the "pass " keyword is equivalent to leaving the code blank. Additionally, it symbolizes that
from the point of "pass " till the end of the indented block, we don't want any executions.
Let's put "pass " in our code as follows:

age = 40
if(age == 40):
pass
print("If Statement Executed")
Execute the above code and verify whether the error is resolved.

• What is Python "for" Loop?


• How to implement "for" loops in Python?
o Implementing "for" loop in Python.
o Implementing "for" Loops using "range" function.
o Flowchart for Python "for" loop.
o Nested "for" loops in Python.

What is Python "for" loop?


The "for" loop in Python is a way to run a repetitive block of code traversing over any
sequence. The sequence can be a list, a Python dictionary, a string, a range of numbers, etc. If
you are pondering over "when should I use "for" loops in Python" now or during
your PCEP exam, think the before-said statement as your answer. When you are thinking
about iterations and running a block of code repeatedly, a loop is your way to go!

The "for" loop will run until all the items in the sequence (or any other iterable object) are
not traversed completely. However, there is an exception of the "break" statement which can
terminate the loop mid-way. But naturally, it will traverse the sequence completely.

The structure of the python "for" loop is very simple:

for var in sequence:

//
The "var" in the structure is the variable name that will take the current item's value from the
sequence. The "sequence" is the variable denoting the sequence name. Don't worry if things
are not clear now; they will be when we practically implement the "for" loop in Python.

It is important to note that the Python "for" loop is a bit different than the "for" loop of
other programming languages. In other programming languages, a "for" loop initiates a
variable with a value (although this is optional but standard ), performs condition checks,
and then performs a specified operation on every iteration of the loop. The operation is more
commonly used as "var++" denoting an increment in var value by 1.

In Python though, the "for" loop works more like an iterator that iterates over a given
sequence or iterable object and the variable takes value from that sequence. In the next
section, we shall implement the "for" loop to help clear the picture.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

How to implement "for" loops in Python?


To implement the "for" loop in Python, we will pick up the same structure and use that as our
skeleton in the program. In this section, we will go through two examples: one by
implementing the "for" loop using a list as a sequence and the other by implementing the
"for" loop in range.

Implementing "for" loop in Python


Before writing our loop code, we need to create a sequence. Let's use a list which contains the
name of the days in the week. The initialization of the list is as follows:

days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]


Note: The above code uses "Lists in Python," which will be covered in later chapters.

Now that we have our sequence ready, we can iterate over it. No prior declaration is required
for the variable we use inside the "for" loop. The following Python "for" loop program
iterates over the list and prints the list elements as output:

days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]


for day in days:
print (day)
In the above program, the variable "day" will take values from "days" one by one until the
whole list is not traversed. Like other programming languages, there is no need to subscript
the variable as days[day]. Python takes care of that itself.

Execute the above code to produce the following output:

I hope it was easy enough! We will take one more example, a little bit different, to
understand the basics of "for" loop more deeply.

Implementing "for" loops using the "range" function


In this example, we will iterate over a series of numbers using the "range" method. The
"range" method defines a range of numbers in a continuous or non-continuous fashion. The
"range" method in Python can also work backward and its working closely resembles the
"for" loop of other languages. Since the "range" method works as an iterator over numbers, it
can accept only integers as a parameter.

The syntax of the python "for" loop with range method is as follows:

for var in range(min, max, step):


//code
The loop above will run from the min value to the max - 1 value with an increment of step to
the variable "var". So the following would be the iteration:

iteration 1: var = min

iteration 2: var = min + 1 (since step = 1)

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

iteration 3: var = min + 2

....

iteration max - 1: var = min + max - 1


The following example will print the numbers from 1 to 10 with an increment of 2.

for i in range(1, 10, 2):


print (i)
The above code will produce the following output:

The following points will come in handy while working with the range method:

• A negative step means a decrement in range. Therefore, step as -2 will decrement the
value by 2.
• If the minimum value is 0, you can omit the min value part and write the maximum
value directly as the default min value is 1.
• If the step is 1, there is no need to write the step value as the default step value is 1.

Python "range" function with a single parameter


In the wake of the above-said bullet points, a small example will help you understand how
python "for" loop works with the "range" function with a single parameter.

The following code uses a single parameter in the "range" function:

for i in range(5):
print(i)
With a single value, the range function takes it as a "max" value considering 0 as the default
minimum and 1 as the default step value. The "for" loop would execute as follows:

The output is in accordance with our assumptions, and we consider 0 to be the minimum
value, with 1 as the default step.

Python "range" function with two parameters


Similar to the above section, the Python "for" loop will run with the default step as 1 when
we have given only two parameters. They will be considered as a minimum value and
maximum value, respectively.

The following for loop in Python uses a range function with two parameters:

for i in range(5,10):
print(i)
The output of the above code is as follows:

You must have observed how Python skipped the "max" value inside the range function.
Therefore, remember that python "for" loop with the range function executes from min to
max - 1 value.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Flowchart for Python "for" loop


The "for" loop in Python can also be visualized with a flowchart, creating a better picture of
the overall flow. The following image describes the flowchart for the same.

I hope it comes in handy while practicing for the "for" loop in Python. As a next step, we will
try to run one "for" loop inside another. This is also termed "nested looping".

Nested "For" Loops in Python


The word "nested" denotes one thing inside another. Similarly, nested loops mean when we
code a loop inside another loop in any programming language. They are a simple concept
where the inside loop can be considered the code block of the outside loop as follows:

for i in range(1,10):
for j in range(1, 10):
//code
Can you determine the output after implementing the above code?

In the above code, the outside "for" loop runs from 1 to 9, while the inside loop will run 9
times for each iteration of the outer loop. So, for example:

Iteration 1:

i = 1, j = 1

i = 1, j = 2

i = 1, j = 3

...

i = 9, j = 9

Edit the above-given code as follows:

for i in range(1,10):
for j in range(1, 10):
print("i = " + str(i) + " j = " + str(j))

Run the above code to see the following output:

Note: The above screenshot is the partial output as the printed list is very long.

Also, the nested loops do not necessarily be two loops. You can implement any number of
nested loops one inside another but as a programmer, I must suggest that nested loops
should be the last option in programming as they increase the time complexity of the program
by the power.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Alright, this was all about the "for" loop in Python. In some programming languages, you
might find another sister loop of the "for" loop known as "for each" loop. We do not have the
for-each loop in Python, but all its traversal functionalities are covered only through the "for"
loop. Therefore, it is easier to loop things in Python.

Another important loop in Python from programming as well as PCEP point of view is the
"while" loop. In the next section, we shall review the "while" loop and see how it differs from
the "for" loop in Python.

In the last post about Python "for" loops, we got introduced to Python's concept and how
does Python handle loop. With different variations and methods introduced in loops, we are
all set to move ahead to the next and probably the only other important loop in
Python: python while loop. Since this is also a loop, the work needs no introduction in this
post. If you are unaware, I highly recommend going through the python "for" loops and brief
yourselves with the basics.

What is the Python "While" loop?


The while loop in python is a way to run a code block until the condition returns true
repeatedly. Unlike the "for" loop in python, the while loop does not automatically initialize
or increment the variable value. As a programmer, you have to write this explicitly, such as "i
= i + 2". It is necessary to be extra cautious while writing the python "while" loop as these
missing statements can lead to an infinite loop in python. For example, if you forgot to
increment the value of the variable "i" , the condition "i < x" inside "while" will always return
"True". It is, therefore advisable to construct this loop carefully and give it a read after
writing.

The syntax for Python while loops


The syntax for python while loop is more straightforward than its sister "for" loop. The while
loop contains only the condition construct and the piece of indented code, which will run
repeatedly.

while(condition):
//Code Block
The conditions can be as simple as (i < 5) or a combination of them with the boolean
operators' help in python. We shall see them steadily into the post.

How to implement a while loop in Python?


To implement the while loop in Python, we first need to declare a variable in our code as
follows (since initialization is not like the for loop):

i=1
Now I want "Good Morning" to be printed 5 times. Therefore, the condition block will look
as follows:

i <= 5

The indented code will be the code I would like to execute when the condition returns True.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

print("Good Morning")
i=i+1
Combining my code, it will look as follows:

i=1
while(i <= 5):
print("Good Morning")
i=i+1
When we compile and run the code, the following iterations occur during the loop execution:

Iteration 1: i = 1; i <= 5 return True; Good Morning printed

Iteration 2: i = 2; i <= 5 return True; Good Morning printed

....

Iteration 5: i = 5; i <=5 return True; Good Morning printed

Iteration 6: i = 6; i <= 5 returns False; Loop Exit

Can you guess what would happen if I skip the line i = i + 1? Run it and find out!

If the code block inside the while loop is a single statement, the programmer can also write
the while loop. Moreover, the statement in a single line as follows:

while(condition): Single Statement

Flowchart for Python While loops


Now that we know the working and construction of the while loop, we can visualize the
loop's flow through a flowchart. The flowchart of python "while" loop would look as follows:

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

I hope it comes in handy while practicing for the “while” loop in python.

Python "do while" loop


In case you are coming from another programming language such as C++, you might have
used a "do while" loop and would be interested in knowing how to implement the same in
python. Unfortunately, for "do while" fans, python does not support this loop. I feel the "do
while" loop is redundant as it is similar to the "while" loop except for the first iteration, which
is bound to run necessarily in "do-while."

Leaving the standard textbook facts aside, can you try to build a do-while loop in python by
yourself? The "do-while" loop always executes the first iteration and then checks the
condition to decide whether another iteration would run. To understand it using another loop,
let's dissect this statement and construct a "do-while" loop ourselves.

Statement 1: The "do-while" loop always executes the first iteration.

This statement tells us that we do not need to check the condition while entering the code
block. Does that ring any bells? Yes!!, we need a "while true" statement since it is always
true. So we start with the following statement:

while (True):
Statement 2: After that, check the condition to decide whether another iteration would run.

Since we need to check the condition after the code block has executed once, we can put a
simple if statement with a break as follows:

while(True):
//Code Blocks
if(condition):
break
The above code works exactly similar to the following do-while loop:

do {

//code block

} while(condition);
It brings us to the end of this post. I hope we addressed all your queries in this post. If you
have any questions, you can raise them in the FAQ section or email me
at [email protected]. I would be happy to help you out!

Python runs on two main loops discussed in the previous posts; the "for" loop and the
"while" loop. These loops check the conditions and run multiple iterations until our sequence
consumes or the condition satisfies. With the knowledge acquired in the previous posts, we
can control the loop from its beginning: the condition and the sequence. This post will help us
enforce control in the Python loops from within the loop code body. By the end of this post,
we will write a code that can break a loop between or skip some code-based. The concepts

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

used to achieve these actions are the loop control statements: the python break statement,
control statement and pass statement. This article will revolve around the same loop control

MODULE 8 FUNCTION IN PYTHON


What is Python Print Function?
The word print is a Function in Python.

What is a function?
A function is a block of code that can perform a specific action. In addition to this, these
block of code doesn't execute until you call or invoke the function. There are two types of
Functions in Python

• Built-in functions - The pre-defined functions in Python are known as Built-


in functions.
• User-defined functions - The functions created by the programmers or developers in
Python are called User-defined functions.

We will discuss functions in detail in later articles. For now, you must have figured out that
print is a Built-in function!

Empty print() Statement


What will we get when we call the Python print function without any arguments? Do we get
any errors? No ! We won't get any error with an empty print() statement. It simply prints a
new line.

Let's see it practically. Open the IDE and run the following code:

# empty print statement


print()
Did you see any results? No? Look closely. Did you realize that there is a new line? We will
demonstrate the presence of a new line in the next section with three print statements in the
latter part of the article.

Single Argument
We had already seen a single argument when we used print function to print "Hello World".
It displays or outputs the data that you pass to the print() function. Moreover, the syntax is
print(data). If we pass a single argument with quotes, it prints that value, as we saw in
the hello_world program.

Let's see another example.

# argument with quotes


print("ToolsQA")
Note: You can also use single quotes in place of double quotes. In other words, both work the
same in Python.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

What are Data Types?


A specific kind of data item defined by its value is known as Data Types.

As we already saw the values are literals. Moreover, Python divided the literals into four
different types of data. Data types are the building blocks for any programming language.

Python Data types are integers, floats, strings, and booleans. Additionally, they play a vital
role in programming. Therefore, one should possess a strong knowledge of them. In this
tutorial, we will learn about the integers and floats.

Python Data Type - Integer


The numbers that don't have any fractional parts are known as Integers. Additionally, it can
be positive, negative, or zero. See the integers number line.

Some examples of integers are 759, -759, 123, 4, -5, etc. In addition to this, integers don't
make up a fraction of the population. Let's see how to represent integers in Python.

We can use the integers directly as we use it generally. In other words, there is no special
notation for the integers in Python. Subsequently, let's try running the following example
code.

# integers
print(759)
print(2020)
The numbers that we passed to print statements are integer literals.

You will get the same output as you see in the program.

What if we want to store large numbers like 123,456,789? We can't write as it is. That is to
say, Python doesn't allow us to put commas between the digits of a number. Let's see what
happens if we write them in the print statement?

# integers
print(123,456,789)
I think you know the output for the above code. Consequently, run the code and see whether
your output matches the real output.

We didn't get any errors. In other words, the print statement takes them as three different
numbers and prints them to the console. But that's not what we want. We want the entire
number as 123456789. Let's explore other ways to write long integers.

Can we write the number as 123 456 789? No, it's not correct, according to Python. So, what
do we get as the output for 123 456 789? Let's check it with the following code.

# integers
print(123 456 789)

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Python Data Type - Floats


Floats contain values with fractional parts. Additionally, it has values both before and after
the decimal point. Moreover, they have a unique name in programming called floating-
point numbers.

Examples of floating-point numbers are 7.59, -95.7, .7, 7., etc.

We can write the 7.0 as 7. and 0.7 as .7. In other words, we can delete the zero if it is the only
digit in the integer or fractional part of the floating-point number.

Open the IDE and write the following code.

# floating-point numbers
print(7.59)
As shown above, we are printing the floating-point number.

Try to print different floating-point numbers to see the behavior of the floats in Python.

float() function
The float() function works similar to the int() function. That is to say, it takes an object as an
argument and returns the value as a float-point value. Run all the int() section examples
using float() function. See the code examples for the conversion in the code below.

# converting to float
print(float("123.0"))

print(float(759))

print(float(7.59))

If we have given a string with characters other than digits to the float() function, it will throw
an error similar to the int() function.

What is the Python Input function?


We have already seen the print function in Python, which sends data to the console. Python
Input function does the reverse of it. In other words, it takes user data from the console so
the program can act based on that input.

The input function indicates the user to enter the data on the console. Moreover, the program
executes further only when the user has entered the data. This data can then be stored in a
variable and can use it in the program wherever we need it.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Note - Input function always takes the input data as String. So if you are asking the user to
enter age, and he enters age as 25, this will be considered a string. Additionally, you need to
convert it to int before you take any action on it.

Write the following in IDE and run it.

# taking input from the user


name = input()
print(name)

If you run the above program, you will see a blinking cursor in the output console, as shown
in the below snap. It is waiting for the data. Moreover, the program won't execute the further
steps until we give the input.

Now, enter anything in the console.

After entering any text hit Enter, consequently, you will get what you entered as output.

The data that we have given is stored in the variable name. And we have printed the variable
in the last line of the code. That's the output we have seen in the above image and your IDE.

How to pass an argument to the Python Input function?


How does a user know he has to enter a number or name or any other data? To tell what type
of data user has to enter, we can pass a message to the input() function that displays to the
user.

For example, your program needs the name of the user to print a welcome message. You can
write the input statement as input("Enter your name:- "). It displays the message to the
user. Subsequently, try the following code in IDE.

# getting name of the user


user_name = input("Enter your name:- ")
print("Hi,", user_name, "\b!")
We have given a message to the user that Enter your name:-. User will read the message and
enter the data accordingly.

You can see that we have stored the user input in a variable user_name, and while printing it,
we have added "Hi" to it.

What happens when you pass multiple arguments to the input() function? Will it show
everything like print() function?

Let's see what happens with the following code.

# input() -> multiple arguments

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

num = input("Enter a number", "greater than 0 and less than 100")


print(num)
We got an error. Why is it? The input() function takes at most one argument, but we passed
two arguments to the input function. As a result, we got an error. Remember , the python
user input() function takes only one argument. In other words, if we don't pass anything,
then the input function won't show any message to the user, as seen in the first section of the
tutorial.

What is the Return Type of Python Input function?


We have mentioned that the python user input takes the information as a string type. Let's
check by an experiment.

# getting input from the user


number = input("Enter a number:- ")
result = number + 2
print(result)

What do you expect the output to be? Run the code and enter a number. See what you get.

We got the error. Why? The data that we got from the console is a string. And we try to add a
string to a number. So, we got the error.

What if we want to take a number as input? Is it possible? Let's jump into the next section to
find the answers.

Type Casting
Converting one type of data to another is known as typecasting. We are already familiar with
such kind of conversions.

What if we want to take an integer, or float as input. Is it possible in Python? The answer
is NO. However, we can use typecasting (type conversion) and built-in data type functions.

Let's try to convert the python string to python integer. You still remember the int function,
don't you?

# getting input from the user


# and converting it to an integer
# int() function
number = int(input("Enter a number:- "))
result = number + 2
print(result)
We have converted the input data to an integer when taking the input itself. Another option
was first to consider the number as a string, store it in a variable, and then convert it to int.
While this will work perfectly fine, it will increase the lines of code and memory usage. It's
always best to write efficient code!!

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

We will get an error if we try to convert a string that contains alphabets or other special
characters. Run the above code and give the 2020ToolsQA as input.

We are trying to convert a string that is not a number. So, Python throws an error.

Similar to converting strings to integers, we can also convert them to floats. You can
use int or float functions for the conversion based on your needs.

That's it for this tutorial.

We have seen how to perform arithmetic operations on integer and floats. We can
use + and * operators on a string as well. However, it behaves differently. Let's have a quick
look at various types of Python String Operator :

• First is Python String Operator - Concatenation Operator


• Second is Python String Operator - Replication Operator

Python String Operator - Concatenation Operator


The addition operator + is also known as a concatenation operator when applied on
two python strings.

• "Learning " + "Python" => "Learning Python"

The general expression of the concatenation operators is.

string + string
Let's get into the coding.

# concatenation two strings


name = "Tools" + "QA"
print(name)
Subsequently, run the code and compare the result with the expected output.

If you look at the output, the addition of the string "QA" happened at the end of the string
"Tools." Yeah! We got what we expected.

We know that both expressions 2 + 3 and 3 + 2 produce the same result when we do the
arithmetic operation. What about "Tools" + "QA" and "QA" + "Tools"? Did they give the
same output? No! We don't get the same output. Let's see why.

• Firstly, Concatenation operators join the second operand (string) at the end of the
first operand (string).
• Therefore, the expression "Tools" + "QA" give "ToolsQA" whereas the expression
"QA" + "Tools" gives "QATools".
• And the results are not the same.
• Moreover, the arithmetic addition operator is commutative while string concatenation
is not.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Let's see it by executing the following code.

# String concatenation is not commutative


name_one = "Tools" + "QA"
name_two = "QA" + "Tools"
print(name_one)
print(name_two)
We can see that they are not the same.

Note:- If we pass an expression to the print() function, then it gives the output after
evaluating that expression.

The following program helps avail the child benefit scheme to government employees having
a child younger than 20 years of age:

parent_occupation = "Government Emp"


number_of_children = 2
child1_age = 15
child2_age = 25
benefit = 0
if(parent_occupation == "Government Emp"):
if(number_of_children > 0):
if(child1_age <= 20):
benefit += 1000
if(child2_age <= 20):
benefit += 1000
else:
print("There is currently no policy for people with no children")
else:
print("This facility is only for government employees")
print("Total Benefit Availed :" + str(benefit))
Can you guess the answer by reading the program?

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

MODULE 9 WORKING WITH GRAPHICS


Introduction

Turtle is a pre-installed library in Python that is similar to the virtual canvas that we can draw
pictures and attractive shapes. It provides the onscreen pen that we can use for drawing.

The turtle Library is primarily designed to introduce children to the programming world.
With the help of Turtle's library, new programmers can get an idea of how we can do
programming with Python in a fun and interactive way.

It benefits the children and the experienced programmer because it allows designing unique
shapes, attractive pictures, and various games. We can also design the mini-games and
animation. The upcoming section will teach us about the various turtle library functionalities.

1. import turtle
Programming with turtle

First, we need to learn to move the turtle all directions as we want. We can customize the pen
like turtle and its environment. Let's learn the couple of commands to perform a few specific
tasks.

Turtle can be moved in four directions.

o Forward
o Backward
o Left
o Right

Turtle motion

The turtle can move forward and backward in the direction that it's facing. Let's see the
following functions.

o forward(distance) or turtle.fd(distance) - It moves the turtle in the forward direction


by a certain distance. It takes one parameter distance, which can be an integer or
float.

Example - 3:

1. import turtle
2. # Creating turtle screen

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

3. t = turtle.Turtle()
4. # To stop the screen to display
5.
6. t.forward(100)
7. turtle.mainloop()

Output:

o back(distance) or turtle.bk or turtle.backward(distance) - This method moves the


turtle in the opposite direction the turtle is headed. It doesn't change the turtle
heading.

Example - 2:

1. import turtle
2. # Creating turtle screen
3. t = turtle.Turtle()
4. # Move turtle in opposite direction
5. t.backward(100)
6. # To stop the screen to display
7. turtle.mainloop()

Output:

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

o right(angle) or turtle.rt(angle) - This method moves the turtle right by angle units.

Example - 3:

1. import turtle
2. # Creating turtle screen
3. t = turtle.Turtle()
4.
5. t.heading()
6. # Move turtle in the opposite direction
7. t.right(25)
8.
9. t.heading()
10. # To stop the screen to display
11. turtle.main loop()

Output:

o left(angle) or turtle.lt(angle) - This method turn the turtle left by angle units. Let's
understand the following example.

Example -

1. import turtle
2. # Creating turtle screen
3. t = turtle.Turtle()
4.
5. t.heading()
6. # Move turtle in left
7. t.left(100)
8.
9. t.heading()
10. # To stop the screen to display
11. turtle.mainloop()

Output:

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

The screen is initially divided into four quadrants. The turtle is positioned at the beginning of
the program is (0,0) known as the Home.

o goto(x, y=None) or turtle.setpos(x, y=None) turtle.setposition(x, y=None) - This


method is used to move the turtle in the other area on the screen. It takes the two
coordinates - x and y. Consider the following example.

Example -

1. import turtle
2. # Creating turtle screen
3. t = turtle.Turtle()
4. # Move turtle with coordinates
5. t.goto(100, 80)
6. # To stop the screen to display
7. turtle.mainloop()

Output:

the background color of the screen using the following function.

Drawing the shapes :

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Forward() and Left() are two functions that we can utilise to draw squares and rectangles.
The fundamental characteristics of each shape must be understood before we can draw it.

Square :

Let's begin by using a square. An equal number of sides make up a square. And there is a 90°
angle between the two adjacent sides. Parallel sides are situated next to one another.

Explaining the code :

We now know the square's fundamental characteristics i.e. all sides are equal. Python
Turtle needs a square drawn now. Assume that a square's side is 200 units long.

1. import turtle
2. ttl = turtle.Turtle()

We imported? The turtle module here?at this time. After then, a new drawing board was
made and given to an object named?ttl.

1. ttl.forward(150)
2. ttl.left(90)

The turtle has advanced by 150 units in the forward direction as a square's side is 150 units
long. As the angle between neighboring sides is 90°, we then turned the turtle
90°. The square's one side is now complete.

1. ttl.forward(150)
2. ttl.left(90)
3. ttl.forward(150)
4. ttl.left(90)
5. ttl.forward(150)
6. ttl.left(90)

Here we repeated the last step three times to construct the remaining three sides of the
square in a similar way as we did for the first side. To draw the remaining three sides, the
same statements were reiterated three more times.

Complete Code :

1. # Python program for drawing a square


2. # using the Turtle Programming in Python
3.
4. import turtle
5.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

6. ttl = turtle.Turtle()
7. ttl.forward(150) # moving the turtle Forward by 150 units
8. ttl.left(90) #Turning the turtle by 90 degrees
9. ttl.forward(150)
10. ttl.left(90)
11. ttl.forward(150)
12. ttl.left(90)
13. ttl.forward(150)
14. ttl.left(90)

Output :

Creating a square in Turtle using loops :

As we can see, we repeated the same statements (forward(150) and left(90)) four times in
the code above. So, rather than writing them repeatedly, we may use a loop that runs four
times.

Complete Code :

1. #Using the loop for drawing a square in Python Turtle


2. import turtle
3.
4. ttl = turtle.Turtle()
5. # Creating a for loop that will run four times
6. for j in range(4):
7. ttl.forward(150) #Moving the turtle Forward by 150 units
8. ttl.left(90) #Turning the turtle by 90 degrees

Output :

The output of the code mentioned above will be same as that of the previous code.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Explanation :

In this program, instead of using the forward(150) and left(90) function four times, we used
it only once but executed it four times by the help of a for loop to get the same desired output
as that in the previous program.

Rectangle :

We are very well aware of the fact that the rectangle's diagonals are equal. Moreover,
the opposite sides of a rectangle are of equal lengths. A rectangle's neighbouring sides
meet at a 90° angle. We shall draw the rectangle bearing in mind these characteristics. Let's
say the rectangle has a length of 140 units and a width of 70 units. Using the code below
we will get a rectangle in turtle.

Explaining the code :

1. import turtle
2. ttl = turtle.Turtle()

We imported? The turtle module here? At this time. After then, a new drawing board was
made and given to an object with the name?ttl.

1. ttl.forward(140)
2. ttl.left(90)
3. ttl.forward(70)
4. ttl.left(90)

The turtle has advanced 140 units in our direction because a rectangle's length is 140 units.
As the angle between neighbouring sides is 90°, we then turned the turtle 90°. The
rectangle's one side is now complete. The turtle was then turned 90 degrees and advanced
70 units. The rectangle's second side is now complete.

1. ttl.forward(140)

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

2. ttl.left(90)
3. ttl.forward(70)
4. ttl.left(90)

To draw the final two sides, the same arguments are repeated once again in both directions.
Ultimately, completing the code to create a rectangle in Turtle Python.

Complete code :

1. #Python Program for drawing a rectangle in Turtle


2. import turtle
3.
4. ttl = turtle.Turtle()
5. ttl.forward(140) #Moving the turtle Forward by 140 units
6. ttl.left(90) #Turning the turtle by 90 degrees
7. ttl.forward(70) #Moving the turtle Forward by 70 units
8. ttl.left(90) #Turning the turtle by 90 degrees
9. ttl.forward(140) #Moving the turtle Forward by 140 units
10. ttl.left(90) #Turning the turtle by 90 degrees
11. ttl.forward(70) #Moving the turtle Forward by 70 units
12. ttl.left(90) #Turning the turtle by 90 degrees

Output :

Drawing a rectangle in Turtle using loops :

Using a for loop for drawing is pretty much similar to how we used it for drawing a square.
In a for loop, we'll put forward(140), left(90), forward(70), and left(90) and execute it
twice.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Code :

1. #Using a for loop for drawing a rectangle in Turtle in Python


2. import turtle
3.
4. ttl = turtle.Turtle()
5.
6. for j in range(2):
7. ttl.forward(140) #Moving the turtle Forward by 140 units
8. ttl.left(90) #Turning the turtle by 90 degrees
9. ttl.forward(70) #Moving the turtle Forward by 70 units
10. ttl.left(90) #Turning the turtle by 90 degrees

Output :

Explanation :

In this program, instead of using the forward(140), left(90), forward(70) and left(90) ?
function two times, we used it only once but executed it two times by the help of a for
loop to get the same desired output as that in the previous program.

Drawing a square and a rectangle together :

As the heading suggests, we will be drawing a square and a rectangle in one single program
altogether with the help of various functions of the turtle python library. The code for the
following is given below :

Code :

1. # Python programme for drawing a square and a rectangle together in # Turtle - Python
2. import turtle
3. ttl = turtle.Turtle()
4.
5. #SQUARE

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

6.
7. for j in range(4):
8. ttl.forward(60)
9. ttl.left(90)
10. ttl.up()
11. ttl.goto(80,0)
12. ttl.down()
13.
14. #RECTANGLE
15.
16. ttl.forward(120)
17. ttl.left(90)
18. ttl.forward(80)
19. ttl.left(90)
20. ttl.forward(120)
21. ttl.left(90)
22. ttl.forward(80)
23. ttl.left(90)

Output :

Explanation :

We first imported the turtle library to our program in the program above. Then we used a for
loop to draw a square first. The loop consisted of the forward(60) and left(90)
methods and executed four times to complete a square. Then we used the up() method to
lift up the turtle pen and moved the pen to the new coordinates using the method
goto(80,0). Then we used the down() method to use the turtle pen again. Next, we drew
a rectangle, using the methods forward(120) and left(90) to draw the first side of
rectangle and the methods forward(80) and left(90) to draw the second side of the
rectangle. We then repeated the last two steps to draw the remaining two sides of the
rectangle.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Polygon in Turtle - Python :

This lesson will teach us how to use a turtle in Python turtle library to draw a polygon.

We should know a little bit about polygons before continuing. A polygon is a type of
geometric figure that has two dimensions. It has a definite number of sides which are
joined together to form a polygonal shape.

Because the triangle is a plane figure, we named it a polygon. Similar to the triangle,
the circle does have a plane figure, but we don't refer to it as a polygon since it is curved
and lacks sides.

When everything is ready, we move on to the idea we'll use to use Turtle to create a polygon
of any shape. We must first determine a polygon's outer angle. If we are aware of
the polygon's number of sides, finding this is rather simple.

Exterior angle of a polygon = 360/number of sides.

Using an illustration, comprehend it :

The exterior angle of a square is equal to 360/4 if the number of sides is 4 (i.e., a square).
Therefore, a square's outer angle is 90 degrees.

Moreover, all we have to do in this situation is ask a user for the total number of sides. To
determine a polygon's external angle, divide the total sides by 360 degrees. To draw the
necessary form, utilize the for loop, forward(), and right() functions from the Turtle
module. So lets get started.

1. from turtle import *


2. import turtle as turt
3.
4. tr = turt.Turtle()

This piece of python code is used in order to import the turtle library into our python
program.

1. # Total No. of sides of the polygon to be drawn


2. side = int(input("The number of sides the Polygon should have is : "))
3.
4. # Total Length of each side of the polygon to be drawn
5. lngth = int(input("The length of each side the Polygon should have is : "))

Here, the user will have to input the "side" and "lngth". Where, side is the parameter for
the polygon's number of sides and lngth is the measure of each side of Polygon. These
values are necessary for drawing the Polygon.

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

1. for j in range(side):
2. tr.forward(lngth)
3. tr.right(360/side)

Here, we used a for loop, for drawing the Polygon based on the values provided by the user.
The for loop causes a certain set of instructions to run "side" times.
tr.forward(lngth) moves the turtle "lngth" pixels forward and draws them in the direction it
is facing. It then turns in position by 360/side degrees by calling tr.right(360/side). For
instance, it would rotate 90 degrees for a square. Hence, results in the Polygon being drawn.

Complete Code :

1. # Drawing a Polygon in turtle - Python


2.
3. from turtle import *
4. import turtle as turt
5.
6. tr = turt.Turtle()
7.
8. # Total No. of sides of the polygon to be drawn
9. side = int(input("The number of sides the Polygon should have is : "))
10.
11. # Total Length of each side of the polygon to be drawn
12. lngth = int(input("The length of each side the Polygon should have is : "))
13.
14. for j in range(side):
15. tr.forward(lngth)
16. tr.right(360/side)

Output:

The number of sides the Polygon should have is : 3


The length of each side the Polygon should have is : 60

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Output: For 5 sides-

The number of sides the Polygon should have is : 5


The length of each side the Polygon should have is : 70

Output: For 8 sides

The number of sides the Polygon should have is : 8


The length of each side the Polygon should have is : 60
NUMPY

NumPy is a Python package. It stands for 'Numerical Python'. It is a library consisting of


multidimensional array objects and a collection of routines for processing of array.
Numeric, the ancestor of NumPy, was developed by Jim Hugunin. Another package
Numarray was also developed, having some additional functionalities. In 2005, Travis
Oliphant created NumPy package by incorporating the features of Numarray into Numeric
package. There are many contributors to this open source project.
Operations using NumPy
Using NumPy, a developer can perform the following operations −
• Mathematical and logical operations on arrays.
• Fourier transforms and routines for shape manipulation.
• Operations related to linear algebra. NumPy has in-built functions for linear algebra
and random number generation.
NumPy – A Replacement for MatLab
NumPy is often used along with packages like SciPy (Scientific Python)
and Mat−plotlib (plotting library). This combination is widely used as a replacement for
MatLab, a popular platform for technical computing. However, Python alternative to MatLab
is now seen as a more modern and complete programming language.
It is open source, which is an added advantage of NumPy.
Pyplot

Most of the Matplotlib utilities lies under the pyplot submodule, and are usually imported
under the plt alias:

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

import matplotlib.pyplot as plt

Now the Pyplot package can be referred to as plt.

ExampleGet your own Python Server

Draw a line in a diagram from position (0,0) to position (6,250):

import matplotlib.pyplot as plt


import numpy as np

xpoints = np.array([0, 6])


ypoints = np.array([0, 250])

plt.plot(xpoints, ypoints)
plt.show()

Result:

Try it Yourself »

Python provides various options for developing graphical user interfaces (GUIs). Most
important are listed below.
• Tkinter − Tkinter is the Python interface to the Tk GUI toolkit shipped with Python.
We would look this option in this chapter.
• wxPython − This is an open-source Python interface for
wxWindows http://wxpython.org.
• JPython − JPython is a Python port for Java which gives Python scripts seamless
access to Java class libraries on the local machine http://www.jython.org.
There are many other interfaces available, which you can find them on the net.
Tkinter Programming

[Type text] [Type text]


NISAR COLLEGE OF MANAGEMENT&TECHNOLOGY SWAT

Tkinter is the standard GUI library for Python. Python when combined with Tkinter provides
a fast and easy way to create GUI applications. Tkinter provides a powerful object-oriented
interface to the Tk GUI toolkit.
Creating a GUI application using Tkinter is an easy task. All you need to do is perform the
following steps −
• Import the Tkinter module.
• Create the GUI application main window.
• Add one or more of the above-mentioned widgets to the GUI application.
• Enter the main event loop to take action against each event triggered by the user.
Example
#!/usr/bin/python

import Tkinter
top = Tkinter.Tk()
# Code to add widgets will go here...
top.mainloop()

Kotlin libraries

provide interfaces that use language features like null safety, default and named arguments,
and DSL (Domain Specific Language).

Pygame

is a Python wrapper for the SDL library, which stands for Simple DirectMedia Layer. SDL
provides cross-platform access to your system's underlying multimedia hardware
components, such as sound, video, mouse, keyboard, and joystick. pygame started life as a
replacement for the stalled PySDL project.

For more info please visit our website

www.ncmt.edu.pk

Prepared by

Engr.Nisar Ahmad

End of DIT 2023 course

According to new syllabus of

KP-BT&CE Peshawar.

Stay safe stay bless

Long live Pakistan

[Type text] [Type text]

You might also like