Dr. Wael M. Alenazy
Dr. Wael M. Alenazy
Alenazy
22
Aim
This chapter focuses on the basics concepts of ICT and its applications. It emphasis about the
peripheral devices and software concepts of the computer systems. The chapter delivers
theoretical and practical skills, introduces the best ICT practices in computer applications.
Furthermore, it provides practical exposure on text processing tools and spreadsheets program.
Learning outcomes
Upon successful completion of this chapter, the student will be able to understand:
Contents
Computer Applications
Word Processing
Spreadsheets
23
Session Introduction to Computing
Session
Introduction to Computing
24
Goal
Learning objectives
Dear Student
By the end of this Session, you should be able to:
1 2 3 4
Be prepared
To understand computer as a machine, we must know the working process and various
components within since it involves hardware and software. This session focuses on the basic
concepts as well as on hardware that shows the tangible working process of computer.
List of Acronyms
Computer Electronic device
25
Session Introduction to Computing
Learn
Introduction
Throughout history, technology has been the driving force of change. In present time
of the 21st century, which is known as a digital era, Information & Communication
Technology (ICT) plays a vital role and been embraced and incorporated into our daily
lives. This is the time where Computers are the primary means of communication in
the world. Computers are ubiquitously available at office, homes etc. It becomes an
easy and useful tool for communication that can provide various kind of information.
The computing technologies have altered conceptions of time and distance. It has
created a wealth of information that is available at the stroke of a key. Moreover,
these computing technologies are being widely adopted and used in education
sectors, such as universities and schools.
26
To build modern and highly automated city named “NEOM” in accordance with Saudi Vision 2030.
As a part of the same vision, the country hopes to build a Hyperloop, a massive, high-speed
pneumatic transit system that would travel between several cities in Saudi Arabia and UAE.
They are also projecting to build the world’s largest entertainment city as a part of an economic
diversification strategy.
Kingdom plans a huge Red Sea Beach tourism project. Each of such steps of development will help
in ICT interventions in it.
History of Computer
We are from the generation where we have grown from infancy from desktop to laptop within the last three decades. The
history of the computer goes back several decades, however, there are five definable generations of computers. Started
from basic calculators to the Babbage's engine initial computer machine can be classified in many generations. Each genera-
tion is defined by a significant technological development that changes fundamentally how computers operate – leading to
more compact, less expensive, but more powerful, efficient and robust machines.
First Generation (1940 to 1956) Third Generation (1964 to 1971) Fifth Generation (2010 Onwards)
Using Vacuum Tubes Using Integrated Circuits Using Artificial Intelligence
27
Session Introduction to Computing
Features of Computer
The features of computers such as the high speed of calculation, attentiveness, precision, consistency and a huge capacity
to store the data, which has made it an integrated part of our life.
The process of a computer involves the processors with the data or information from
the input devices and provides the output.
CPU SCREEN
DATA
28
Applications of Computers
In day to day life, it is very easy to understand the application of computers as everyone using computers of various sizes
like desktop, laptop, palmtop, PDAs, tablets etc. Computers have made our life so easy. With greater precision and accuracy
and less time taking computers can do a lot in a short time while that task can take a lot of time doing manually. Computers
have taken many sectors to a completely new level. The process of information with different applications will be discussed
in approaching chapters.
Software Development:
The developments of various system software or applications designed with the different programming
languages for different types of applications such as operating systems like MAC, Windows as
background software’s and end-user productivity tools like office tools and different applications for
gaming, communication. Detailed with practical skills discussed in the Algorithm and Programming
chapter.
Information Security
In this trending technology era, the information stored in digital devices such as computers and smart
devices, using the internet the data is stored online in the cloud. Many organizations provide cloud
storages such as One Drive, SkyDrive to name few. The question is the data which stored offline or online
is it safe and private? To ensure the data is safe, protected with confidentiality, authenticity various
information security measures should be taken, you will learn in detail about the information security
chapter with different techniques.
29
Session Introduction to Computing
Classification of Computers
Computer can be classified based on its size and performance. The computers broadly categorized into four types.
- Shaheen II system has a total of 197,568 processor cores and 790TB of aggregate memory.
- Shaheen II was the seventh fastest supercomputer in the world.
Mainframe Computers
Mainframes are a type of computer that generally is known for their large size, amount of
storage, processing power and high level of reliability. They are primarily used by large
organizations for special applications requiring high volumes of data processing. In some
ways, mainframes are more powerful than supercomputers because they support more
simultaneous programs. However, supercomputers can execute a single program faster
than a mainframe.
The main difference between a supercomputer and a mainframe is that a supercomputer channels all its power into
executing a few programs as fast as possible, whereas a mainframe uses its power to execute many programs
concurrently.
Mini Computers
A minicomputer is a type of computer that possesses most of the features and capabilities of a
large computer but is smaller in physical size. It fills the space between the mainframe and
microcomputer. They are mainly used as small or mid-range servers operating business and
scientific applications. However, the use of the term minicomputer has diminished and has
merged with servers which are capable of supporting from 4 to about 200 users simultaneously.
30
Computer Peripherals Devices
As a machine computer requires hardware devices which supports the entire process of computing. Computer hardware
comprises of some electromechanical components. These required components are classified into three parts:
1The- end
Input/ Output Devices
user interacts with input and output devices. The computer recognises its input such
as a keyboard, mouse, scanner, from these devices, it accepts the data or information. Further
processed by the system unit and provides the required information using output devices such
as monitor screen, printer, speaker etc.
2 - System Unit
Typically, the system unit known as motherboard which consists integrated circuits. Basically,
motherboard is well known as the heart of the computer. Motherboard consists of the main
component called the Central Processing Unit (CPU). CPU controls the instructions from the
input and output devices and process it accordingly. CPU has registries for the temporary
storage of the instructions. CPU is named as the brain of the computer.
It consists of the Arithmetic Logic Unit (ALU) and Control Unit (CU).
- ALU executes all the arithmetic and logical operations such as basic additions,
subtractions and comparisons (+, -, *, /, <, >, =).
- CU is like an execution unit which controls the rest of the computer instructions
and coordinates with other devices in the queues.
3 - Memory Devices
Memory devices basically stores the data or information. After the process of the instructions
carried out from the input devices to the system unit. The data must be stored temporarily to
provide the instant output of the output devices. This memory named as main memory. Main
memory is also known as primary memory. The essential commands for the processing of data
and any transitional results are also stored in the same. The process of CPU will be working with
the main memory device. To store the processed data for long-term, memory devices have
another type of memory called secondary storage devices. The data stored permanently in this
storage device of the computer, such as Hard Disks, DVD, Flash drives etc.
31
Session Introduction to Computing
Apply
2 - The computer is the integration of ____________ and ____________ with different types of peripherals.
3 - ____________applications referred as the background process consists of programs coded with different
programming languages to interact graphically with the computer machine.
4 - Using _______________ machines can communicate with humans and able to take a decision in the near
future.
5 - A _________________is a type of computer that possesses most of the features and capabilities of a large
computer but is smaller in physical size.
a) CPU
3 - ___________executes all the arithmetic and logical operations such as basic additions, b) CU
subtractions and comparisons (>=, <=). c) ALU
d) DVD
a) ALU
4 - ______________is like an execution unit which controls the rest of the computer b) DVD
instructions and coordinates with other devices in the queues. c) CPU
d) CU
a) Primary
5 - To store the processed data for long-term, memory devices have another type b.) Secondary
of memory called as _____________ storage devices. c) Input
d) Output
32
Discussion Board:
Activity
3 A - Explain how computer works?
B - Which type of computer is suitable to use while studying in university? And why?
Case study:
Activity 1 - Briefly discuss the trending ICT developments in Saudi Arabia?
4 2 - Organize students into the groups:
a - Discuss about the performance of RAM with other groups such as RAM 4GB or 8GB which is suitable for
different types of applications.
b - Discuss the features of different processors such as speed.
Closing
Introduction to Computing
33
Session Computer Applications
Session
Computer Applications
34
Goal
Learning objectives
Dear Student
By the end of this Session, you should be able to:
1 2 3
Be prepared
The Computer is the combination of hardware and software. You have already learned about the basic concepts and
hardware of the computer. The working process of the computer hardware must be supported by the software. Thus, from
this session, you will know about the software and how it is essential for the computers to run efficiently and effectively.
List of Acronyms
Software Set of programs
OS Operating System
GUI Graphical User Interface
CLI Command Line Interface
35
Session Computer Applications
Learn
Introduction
It is well-known that computer is the combination of hardware and software. In the
previous session, you have learned about the basic concepts and working process of
the computer. Computer is a machine which requires both hardware and software.
The necessity of software is to convert the data into user understandable information
so that the end user can interact easily with the computer.
Software
A software is a set of programs. A program is nothing but set of instructions with step by step procedure. Such instructions
are nothing but the commands given by humans to run any program. These programs allocate in the computer hardware
which used to convert the data into understandable information. The Basic Input and Output System (BIOS) is controlled by
the software.
System Software
System software is designed to provide interface, which comprises operating systems. It
controls and manages the hardware devices and other end user applications. It manages
to perform all the utility functions, such as booting up the computer and it is programmed
to complete the loading, executing, retrieval of files from the computer and storing the
data in the secondary storage devices. It mainly works in the background and requires
little or no user interference.
Another example of System Software is a Device Driver software, which controls the
operations of a particular device, such as Printer Driver software.
Operating System
Operating System is the most common System Software. An Operating System is a
backbone of a computer system. It controls and manages the entire operations of a
computer. All computers, tablets and smartphones need an Operating System to
function properly.
36
Types of Operating Systems:
Typically, Operating Systems are classified as User based and Interface based which are named below;
You will also find a single user multitasking system on a personal computer. It is designed to deal with many applications
running at the same time by single user.
Real-Time Systems:
Such systems are those used for direct control over electromechanical equipment such as industrial robots, factory
processes, power stations, airplanes, trains and cars. They monitor external events and react instantaneously that is why
they are known as real-time systems.
Example LynxOS
Batch Systems:
Such systems are used for running batch operations such as calculating and printing of customers’ bills, although they are
not as common nowadays as they once were. They often run a single task for hours or even days at a time.
Example banks process millions of cheques each month. These are processed together in a long run, usually overnight.
37
Session Computer Applications
Storage Management:
Controlling all the storage operations like how the data or files will be stored in the computer and how the
files will be accessed by the users. All the operations which are responsible for storing and accessing the files
are determined by OS.
Process Management:
Executing all the processes given by the user or the process which are system’s own and prioritizing for the
user. Starting or stopping the execution of the process and dividing the large processes into the small
processes.
Resources Management:
Managing and facilitating the operations of the resources connected to the computer such as Memory
devices, printer, scanner etc.
Run Applications:
OS loads and runs applications (or apps), such as Microsoft Edge or MS Word. Most OS supports multitasking
which allows to run multiple apps simultaneously and switching between them.
Microsoft Windows
Microsoft’s Windows is by far the most popular operating system for PCs. Most of the desktop applications
are developed to run under windows as compared to any other OS. Windows comes in different versions
and was initially designed to run with Intel or Intel-compatible processors. Windows 10 is the latest release
from Microsoft, which has a modern user interface and supports tablet computing as well.
Linux
Another famous name in the operating systems category is Linux. The specialty of Linux is that it is an Open
Source OS, which means it is freely distributable. It can be customized and used with different types of
computers, tablets or smartphones. We will learn about it in details at the end of this unit.
38
Android
Android is one of the Linux based operating systems developed by Google and the Open Handset Alliance
(OHA), a coalition of more than 30 hardware, software and telecom companies. It is designed primarily
for mobile and touchscreen devices such as Smartphones and Tablets. Android’s User Interface is mainly
based on touch gestures that correspond to real-world actions, such as swiping, tapping and pinching
along with a virtual keyboard for text input.
Android is now the most popular mobile OS providing lots of exciting features. Its open nature has
encouraged a large community of developers to develop Android based applications (or apps). Thus,
Google Play Store has over a billions of android apps.
Keyboard shortcut to open start menu is “Ctrl+Esc” or simply click “Windows key” on keyboard.
Windows Ink
As the world is moving towards the mobile and touch based computing, Windows 10 has
introduced the Windows Ink feature. It allows you to use pen input in different apps or
annotate on snapshot of your current screen. If you have a touch screen device, the
Windows Ink icon appears in the Notification Area of the Taskbar by default. Otherwise,
to activate it, you need to Right-Click on the Taskbar and choose “Show Windows Ink
workspace button.” When you click on Windows Ink icon, a sidebar of the Windows Ink
workspace appears, which usually has the following options:
Sticky Notes: Allows you to create brief sticky notes by using pen tools such as adding a
schedule reminder. Windows uses character recognition (or handwriting recognition) to
read your sticky notes.
Sketchpad: Enables you to create freehand drawings with pen tools and save it as an
image file.
Screen Sketch: Allows you to draw or annotate on a snapshot of the current screen.
Get More Pen Apps: You can click on “Get more pen apps” link to open the windows store
and download desired pen apps.
39
Session Computer Applications
Virtual Desktops
Virtual Desktop is the very useful feature Microsoft has provided with
Windows 10. This gives you the experience of working with multiple screens;
although having just one. So while you work on multiple apps, you can better
organize them with multiple Virtual Desktops. You can group your personal
apps together in one desktop and work apps in another. You can Add New
Desktops as you want and switch between them easily. The Task View button
on the taskbar helps you manage it.
You can easily move running apps from one desktop to another with just the
Right Click of the mouse. Interestingly, if you close a Virtual Desktop, the apps
that were running on it won’t be closed, rather they will be shifted to previously
available desktop.
Cortana or Search
Cortana is another enhancement in Windows 10. Cortana is a voice-activated
personal digital assistant, which provides relevant suggestions and alerts. The
more you use Cortana, the more personalized your experience will be. For
example, you can use Cortana to find files/apps on computers, search the
internet, send emails, help out with navigation, setting reminders, and more.
Cortana is available only in certain countries or regions. It is accessible from the
search box at the taskbar right next to the start button. You can command
Cortana by either typing in the search box or by clicking on the mic button to
talk to her.
You can also say “Hey, Cortana” to activate via Mic through audio input.
When Cortana is not available, it is replaced with the Windows Search, helping you to search for apps, files, folders, and
settings on your computer.
40
Comparison of Popular Micro-Computers’ Operating Systems
Operating Systems
Factors
Window CE-7
OS Family Linux Darwin Window NT-8
The free program is a version with the limited features whereas the full version avails complete features. We commonly find
such programs in Google Play Stores. Generally, it is distributed under General Public Licenses. (GPL) which to give the
freedom to the users to change and prevent software being changed into proprietary software.
To compete with the marketing strategies of the rivals, many commercial programs offer a one-month free trial. Such
versions are also limited and eventually pushes the user to buy a full version. In contrast, many open source programs are
free, so you can take all the time you need to learn how they work.
It is important to understand that when you pay a license fee to buy commercial software, you don’t actually buy it but, in
fact, are granted a license.
41
Session Computer Applications
Open source software is under constant development which reduces its vulnerabilities significantly. Some
software like WordPress gives you the option of automatic updates, which helps to keep the software current and
bug-free.
Open source software allows you to make choices for a commercial application rather than being locked into static
design and development. You can modify the software as necessary for your own purposes as well.
Open source software is potentially more secure than commercial programs because the code is constantly being
scrutinized by many programmers, not just a selected few.
A number of open source programs have a core application which can be enhanced by the use of plug-ins and
themes. Like WordPress and Joomla.
Using open source software certainly requires a good technical background. If you don’t know how to write code,
then you will be completely dependent on others and you have to spare some budget for minor modifications and
maintenance.
It is often found that the product is no longer supported by the company or the individual anymore unless the
development is picked up by other programmers. Though this is not the case in big names like Linux.
Open source is sometimes referred to as ‘open wallet’ in the sense that it may cost you more to have open source
code modified than it would cost you to buy a commercial program by itself.
Unless there is a structure in place to ensure the quality of the code it might wind up with many changes, bug fixes,
and patches, all of which can make the code more complex and/or degrade the quality, which in turn leads to more
maintenance.
The software might not be well-documented, which could make it difficult to learn.
Before you rush to download the latest open source software it is important to find out if this is the right approach
and appropriate option for you or not. Take some time to read comparative reviews of different programs and, if
you have the time, test both open source and commercial programs to see which one gives you the desired results.
42
The developer has the freedom to contribute to the operating system and it is free to use. This co-operative development
model is meant for the benefits of everyone. That is why it is better known as Socially Responsible Software. Tech world
abbreviated it as FOSS - Free and Open Source Software.
Linux has many other benefits, including speed, security, and stability. It comes from the well-established UNIX family of OS
and so has been built to keep security in mind. Hence, viruses, worms, spyware, and adware are basically a non-issue on Linux.
Application Software
The Application software is a group of programs facilitates the end-user with different
features in the computer to perform certain tasks. Applications are designed specifically in
the view of the end-user’s requirements. Moreover, practicality of this software’s can be
learned in detailed in the coming sessions.
43
Session Computer Applications
Apply
A) Software
3 - _____________ controls and manages the hardware devices and other B) Program
end-user applications. C) Operating system
D) System software
A) Storage Management
4 - Functions of Operating System are _______ B) Process Management
C) Resources Management
D) All of the above
A) New Start Menu
5 - Some of the interesting and exciting new features of B) Windows Ink
Windows 10 are _______ C) Virtual desktop
D) All of the above
44
Discussion Board:
Activity
3
1 - What are the advantages and disadvantages of Open Source Software?
Closing
45
Session Text Processing
Session
Text Processing
46
Goal
Learning objectives
Dear Student
By the end of this Session, you should be able to:
1 2 3 4 5
Be prepared
Imagine that you want to complete a project report using a typical word document! Then you have to think about the text
Processing tools. Decades ago typewriters were used to create the documents. Later on it was done with the help of
‘Notepad’ in computers for specific and limited tasks. With the recent advancements in computer technology, platforms like
MAC and Windows developed many enhanced text Processing tools with much more facilities. This session overviews and
delivers a hands-on experience with different tools which you can use to write your project reports with enhanced styles.
List of Acronyms
Text Processing Productive tool to create text document
Reference Used for referencing
EndNote Example of Referencing tool
Mail Merge Tool to send one document to multiple recipients
47
Session Text Processing
Learn
Introduction
In the previous session, you have learned the concepts of software and
types of software. This session emphasis and delivers the practical way
how to use the applications. An Application software is simply known as an
application. These applications are grouped into software suite. Microsoft
Office is a best example which is the collection of multiple programs such
as MS Word (Text Processing) a tool for creating documents and reports,
MS Excel (Spreadsheet), and MS Outlook. MS Office 2016 is widely used
productivity tools both by corporate and domestic users. Other examples
include Adobe Graphics suite etc.
Specifically, in this session, you will understand the overview of text Processing and other similar applications such as
Pages for Mac, MS Word for Windows.
Apple Pages
‘Pages’ is a text processor and a part of a productivity suite called iWork along with both
Keynote and Numbers, and is recognized for its user-friendly, intuitive interface. It is a
product of Apple which supports and runs in the Apple products such as Mac Book and
iPhone, with macOS and iOS operating systems. Pages have distinct features to create and
collaborate the documents. Its powerful word processor helps you create documents by
touch devices to illustrate with hands and allows you to collaborate your documents with any
devices and anywhere to work with your group in the real-time. It is compatible with mobile
devices such as iPhone.
48
Microsoft Word 2016
Microsoft Word is the text processor, which is one of the programs of MS Office 2016 suite. It is
developed by Microsoft Corporation. MS word supports the different operating systems such as
Windows and macOS. It can be installed and run in the microcomputers such as smartphones,
tablets. MS Word let you create attractive documents with a different type of templates such
as Letters, Flyers, Brochures, Manuals, CVs and more. It also allows you to collaborate your
work with anyone. Word 2016 has various features such as inserting online pictures which can
be helpful to create the documents.
You can download any version of Microsoft Office to your laptop or Personal Computer then install as per instructions. To
activate Office 2016: the user must connect to the KSU network.
The Start Screen of Word 2016 appears with different options to open a
file. You can either choose an existing file or start with a new one.
The Microsoft Office 2016 user interface is quite uniform across its
components. Word 2016 offers a more refined user interface along with
many interesting tools. The user interface of Word 2016 consists of the
following:
49
Session Text Processing
C Tabs At the top of the Ribbon is a set of tabs. Clicking a tab displays an associated set of commands.
E Dialog Box Launcher Clicking the Dialog box launcher displays the associated dialog box or pane.
F Ribbon Display Options It allows you to Show or hide the Ribbon. Click on it to choose from the menu options Auto-hide
ribbon, Show Tabs, or Show Tabs and Commands.
The white area in the middle of the Word 2016 user interface is the Work Area or Workspace. This
G Work Area
represents the actual page where you type text, edit or format a document.
H The Insertion Point (Cursor) The Insertion Point or Cursor is the blinking vertical line in the Work Area. It indicates the current active
place in the document where you can insert text, images, apply editing or formatting commands.
I Rulers It helps you to view and adjust the position of the contents of the document.
It displays the information about the current document such as the total number of pages, the current
J The Status Bar
page number, total number of words in the document, current proofing language and proofing status.
Three view buttons Read Mode, Print Layout, and Web layout on the right side of the Status bar
K View Buttons
allows you to easily switch between the document views.
L Zoom Slider and Buttons These allow you to easily adjust the zoom level of the document contents as per your convenience.
50
Tool Tip
A tooltip is a graphical user interface (GUI) element used in conjunction with the
cursor or mouse pointer to display information about an item without needing
to click on it. ... A tooltip is also known as a hint, info tip or screen tip.
Tell Me Box
In Word 2016 user interface screen, you might have noticed a text box on the
right of the ribbon tabs with a bulb sign that says “Tell me what you want to
do…” It allows you to do the things quickly and efficiently, keeping you free from
remembering and locating the commands in various tabs & ribbons. All you have
to do is to simply enter a word or a phrase in the Tell Me box about the
command you want. It provides you a list of the related commands to get help
with a particular command.
Smart Lookup
Another interesting feature of Word 2016 is ‘Smart Lookup’. It allows you to get the definitions, Wikipedia articles, and other top
related searches from the web about any word or phrase in your document. Thus, bringing the research directly into Word 2016.
- By default, a document in Word 2016 is saved with the file extension .docx.
- The Save As option is the way to save the document to a different file format.
Keyboard Shortcuts
One Drive
When you save a document in OneDrive, your document is stored
in a central location that you can access from anywhere. Even if
you're away from your PC, you can work on your document
whenever you have a connection to the Web.
51
Session Text Processing
Clipboard This group contains the main editing commands such as Cut, Copy and Paste.
Font This group commands enable you to modify and enhance the appearance of your text.
Styles This group commands enable you to apply pre-defined formatting styles.
Editing This group commands help you to find and replace text as well as select text or objects.
You will learn about some of these groups in the following section.
Pages Links
Add-ins Text
Tables Comments
Media Symbols
Illustrations Header & Footer
52
The Design Tab
The next tab after the Insert tab is the Design tab. This tab consists of commands that enable you to quickly apply different
formatting styles to your document. You can even set colors and insert pictures in the background of a document.
It also helps you to add page background where you can apply a watermark, give a color to the page and insert page
borders as well.
- Margins
- Orientation
- Size
- Columns
- Line Numbers
- Hyphenation
- Table of Content
- Footnotes
- Citations and Bibliography
53
Session Text Processing
Introduction to Endnote
Endnote is a commercial reference management software used to create and manage bibliographies and references when
writing research articles. The citations and bibliography group in MS Word is useful when your citations are limited. If you
need to add more citations, then it would be a hard task to add manually. MS Word supports third-party software’s as a
plug-in to be added and it can be used online from their databases. Various programs support MS Word as a referencing
tool such as EndNote, Mendeley, etc. With EndNote, citations can export straight from online databases, catalogs, and
different journals. The reference information from various websites taken automatically without entering it manually. To
EndNote Features
- Create your references with a personalized library.
- Insert references automatically matching your requirements in Word with selected styles.
- In the library, you can attach PDFs, sound files, videos, or any other format of files to your references.
- From the attached files, it can be read and marked.
- EndNote library can be categorized in groups by specific subject or any project or as per individual requirement.
- EndNote references and groups can be Synchronize and used in multiple devices, sharing, tracking the citations from
anywhere by logging into EndNote account at my.endnote.com.
- EndNote supports online database; citations can be added.
54
2 - Import the PDFs files from local computer and
automatically groups can be created.
55
Session Text Processing
56
Citing references in MS Word 2016
EndNote is the plugin in MS word provides you options to insert your citations from the library which is created
from the EndNote desktop application. You can start to cite the references from the library directly into your
documents. This EndNote tab provides different groups such as citations which allows you to insert citations,
insert note, insert figure and edit it using desktop application. Bibliography groups allow to update citations and
convert to different formats with different styles. Using tools group citations can be exported to word citations
as well.
MS word shows the EndNote plugin in the ribbon. References can be added using the options shown as Insert
Citations from there.
3 References Styles can be changed as needed in the document such as IEEE, APA etc.
4 At the end click on update citations and bibliography, so that references shown by using the selected style.
Mail Merge
Mail Merge is a tool which is used in the organizations to send the official letter to multiple people without
changing the content. The process to link the main document to the data source. You can create Letters, E-mail
messages, Envelops, Labels, etc. It can be sent to a bulk mailing list with specific fields of the letter vary and are
personalized.
• Main Document:
The document which consists body of the letter with the text and images such as organizations logo with identi-
cal to be merged with each version.
57
Session Text Processing
It involves step by step process to send your documents or letters using mail merge.
Step 1: Select the type of document or Prepare your own document such as Letters, Envelops, etc.
From Mailing tab Click on Start Mail Merge Select the Letters or any other type of document.
Step 2: Start selecting the document by clicking on step-by-step mail merge wizard and select any of the following option :
a) use the current document
b) select from the template
c) an existing document.
58
Step 3: Choose the recipients from the mailing list from the data source
The Data source can be an existing source in excel sheet, outlook contact. If you have the mailing list, select from the existing
the list. If you don’t have it first create the contact list
Step 5: Preview and print the letters, find the recipient and check for any errors.
59
Session Text Processing
Apply
Assignments
1 - Learn from the video and apply the skills in the teaching aid.
2 - Using teaching aid include references in the given article with the help of EndNote Application.
60
A) Font
B) Styles
3 - ________ group commands enable you to apply pre-defined formatting styles C) Clipboard
D) Editing
A) File
4 - The _________Tab has a lot of useful features that enable you to insert different B) Home
items in your document. C) Insert
D) Design
A) File
5 - _____ tab consists of commands that enable you to quickly apply different B) Home
formatting styles to your document. C) Design
D) Insert
A) Page Layout
6 - ________ tab helps you to change the document orientation, page size, margins, B) References
indentation, line spacing, and paragraph settings. C) Mailing
D) Review
A) Page Layout
7 - The ____________ Tab commands help researchers & professionals in creating B) References
references in the document. C) Mailing
D) Review
A) Table of Contents
8 - The _______________ group in MS Word is useful when your citations are limited. B) Footnotes
C) Citation & Bibliography
D) Captions
Closing
Text Processing
Overview of User Interface The Home Tab The Insert Tab Introduction to Endnote
Text Processing of Word 2016
The Design Tab EndNote Features
New Featuers
Popular text The Page Layout Tab How to use EndNote
of Word 2016
Processors
The File Tab
One Drive
61
Session Spreadsheets
Session
Spreadsheets
62
Goal
Learning objectives
Dear Student
By the end of this Session, you should be able to:
1 2 3 4 5 6
Learn how to insert cells and Know print setup options Know about the view tab and
sheets and its formatting. in the spreadsheets. security options for spreadsheets.
Be prepared
What if you have to analyze certain task related to the business? On a very basic level, you may think about a simple calculator!
But it will certainly restrict you to deal with the data. Therefore, you may need something separate and something powerful.
In this session, you will learn how to simplify your work with easy approaches for auto calculate and analyze the data in a
fraction of a second! Here you will be helped to learn practical skills using different approaches in MS Excel!
List of Acronyms
Formula An expression to perform calculations by using mathematics equation.
Function A predesigned formula which performs calculations automatically.
Charts A graphical representation of the data
Worksheet Work area in the excel workbook
63
Session Spreadsheets
Learn
Introduction
In the earlier session, you have learned about different Text Processing tools which help to
design the documents specifically using Word 2016. In this session, you will learn about the
various tools used for analyzing information. In this session, you will have an overview of
various spreadsheets programs such as Numbers from Apple iWork, Microsoft Excel from
Microsoft Office. A Spreadsheet is an interactive computer application for organization,
analysis and storage of data in tabular form. Practically you will apply the skills to the most
widely used tool i.e., Microsoft Excel.
Supports Touch devices with Apple Pencil. It can be shared with any device.
Microsoft Excel
MS Excel is the product of Microsoft. It is the productive tool from Microsoft Office suite family,
with a member like MS Word. Microsoft Excel is the spreadsheet program comprises of
worksheets used to analyze data and an easy way for all types of computations. It can be used
with all types of microcomputer devices like Laptops, Desktop, Smartphones etc. It can be used
on various platforms like Android, iOS etc. It supports Windows and Mac OS.
Excel 2016 gives you a handy place to work with both textual and numerical data. You can
create formulas, summarize information, show information in charts and do a lot more. The
common scenarios to use Excel 2016 is for creating Schedules, Inventory, Reports, Budgeting,
Accounting, Planning and much more.
64
Features of Excel 2016
Quick Access tool
Functions
Forecasting
Date Grouping
Histograms and Pareto charts
Automatic Preview Options
Tell me Box
Sunburst charts
3D Data Map
Effective automatic calculations
2 - Locate and click on the Excel 2016 from All Apps list.
The Start Screen of Excel 2016 appears with a list of recently used files
and available templates. You can either open an existing file, choose a
template, or start with a new blank workbook. You can also press the
ESC key to start with a new blank workbook.
65
Session Spreadsheets
This field, positioned to the right of the ribbon tabs, lets fast access to Excel commands
B Tell Me Box and functions you need to use.
C Ribbon Display Options You can show or hide a ribbon to maximize or minimize your workspace. You could select from
the options: Auto-hide the ribbon, show Tabs simplest or show Tabs and instructions.
D A Worksheet is a workspace, which is organized into rows and columns. Used to keep
Worksheet and manage information in the form of a table.
E The intersection of a row and a column in a worksheet is called a cell. An active cell is the
Cell and Active cell
one which is selected in the sheet with a green outline.
Columns are the vertical separations in the sheet. The Column has sequential letters at
F Columns
the top as A, B, C etc.
G Rows are the horizontal separations in the sheet. This rows named in the left side of the
Rows
worksheets as 1, 2, 3, etc.
Name box is just beside the formula bar which recognize the selected cells any other
H objects on the worksheets. Every cell has its own address recognizes by the column and
Name Box
the row number (Example A1, B16, Z28 – where alphabet represents the Column and
number represents the Rows).
I Formula Bar Formula bar represents to enter a formula in a cell which used to calculate.
At the bottom of the worksheet where the name of the sheets is displayed. Sheet tabs
J Sheet Tab
help manage different worksheets.
At the bottom of the worksheet, a bar represents called the status bar to show count,
K Status Bar
sum, and an average of selected cells of data. It contains view buttons, zoom slider, and a
zoom button.
1 Click on New option from backstage view. 2 Click on a Blank workbook to create a new workbook.
66
Choose a template if you want to use a template
Note
Excel workbook is saved with the extension “.xlsx”. Excel template is saved with the extension “.xltx”.
TAB Key used to move the active cell one column to the right in the worksheet.
CTRL End to move the active cell to the last cell in the worksheet that contains data
CTRL used to move the active cell to the last row in excel sheet that contains data.
CTRL used to move the active cell to the last column in excel sheet that contains data.
67
Session Spreadsheets
To select sequential and non-sequential cells; Name Box or Mouse can be used. As shown in the above screenshot.
1 Click on a cell and drag the mouse over a group of cells you want to select.
A Excel highlights the selected cells in grey color.
B Use the Select All Button if you want to select all the cells in the worksheet.
2 Enter the cell addresses of the first and last cells separated by a colon (:) in the Name Box and press Enter
key e.g. A2:F6.
68
3 To select non- sequential cells using name box, Enter
the cell addresses separated by commas in the
Name Box and press Enter key e.g. C3, D5, E8, F4.
1 Right click on the sheet tab and point to Tab Color option from a popup menu.
6 You can also click on New Sheet button to insert a new worksheet.
69
Session Spreadsheets
Renaming a Worksheet
Excel 2016 assigns a default name to each worksheet in a workbook like Sheet1, Sheet2. You can give specific names to
worksheets to help you identify their content
2 Click Rename option from the popup menu and type a new name for the worksheet.
4 Click on OK button.
5 A worksheet is copied.
You can also Insert, Delete, Rename, Move or copy sheet and change Tab color from cells group of the Home Tab.
70
Other Sheet Options
Select All Sheets Selects all worksheets so that a formatting option can be applied at once, like Tab color.
Font This group contains commands used to apply a range of formatting options.
Alignment This group contains commands used to position cell data and merge cells.
Number This group contains commands used to apply different number formats to data.
Styles
This group contains commands used to apply various styles.
Cells This group contains commands used to add, delete and format cells, rows, columns, and worksheets.
Editing This group contains commands used to sort, filter and calculate data.
Chart Buttons: To format the chart easily you have chart buttons which enables you to
change different options such as chart elements.
71
Session Spreadsheets
A Chart Area It contains all the chart elements which cover the entire area of the chart.
B Plot Area The representation data in the graphically in this area called plot area.
C Chart Title Shows the title of the chart.
D Data Points From the plotted area actual points represented with data points.
E Primary VerticalAxis Title It’s a section to show the vertical title as Y-Axis Title
Inserting Chart
Excel 2016 provides a number of chart types which are available
to create. It also recommends charts as suggestions to create to
the provided data. Based on the data in the rows and columns
you can create the chart by selecting the best chart type.
To insert a column chart, follow the steps given below
72
Design and Format Tab’s – Contextual Tabs
Move Chart The chart insert in any sheet can be moved to another worksheet by using this options.
Chart Styles It provides you the customized styles with different colors to apply on the charts.
Change Chart Type You can change charts with different types such as bar, area, line etc.
From File Tab Menu Print option provides… provides you with options to print only the
Print a Chart
chart from the worksheet.
73
Session Spreadsheets
Print Area
The print area allows you to print on the selected range of cells to avoid printing in the entire sheet. It allows you to select
the titles to print from the worksheet. You can clear the printing area which is selected for print from the print area
command.
Print Titles
You can use Print Titles command to specify the rows to be printed at the top or columns to be printed at the left of each
page. For example, you can print the header row on all pages when you have a large worksheet to print, so the readers don’t
have to go back to the first printed page to see the headers.
3 Click in the Rows to repeat at the top box under Sheet tab
of the dialog box.
74
The Formulas Tab
The Formulas Tab enables you to calculate data using a variety of functions available in Excel 2016 to make easy calculations.
Excel 2016 provides several built-in functions to perform mathematical, statistical and logical operations. Function Library
group in the formulas tab contains a number of functions grouped in different categories such as Financial, Logical, Text,
Date & Time and Math & Trig.
Logical Functions are used to test for a condition to evaluate it as true or false. It includes
Logical functions such as AND, FALSE, IF, NOT, OR, TRUE, etc.
Text functions are used to manipulate text strings. It includes functions such as CHAR,
Text
LEN, LOWER, PROPER, TEXT, UPPER, etc.
These functions perform arithmetic operations, conditional sum, exponents & logarithms,
Math and Trig and the trigonometric calculations.
It includes the functions such as SUM, SUMIF, LOG, COS, SIN, etc.
It includes Statistical and Engineering functions such as AVERAGE, COUNT, MAX, MIN,
More Functions
CONVERT, DELTA, etc.
Functions
A Function in Excel 2016 is a pre-set or inbuilt formula that performs calculations automatically. Each
function has a specific syntax, i.e. a set of rules associated with it.
Creating a Formula
A formula is an expression that executes all the calculations in the cell’s data. A formula with arithmetic operators like +, -,
*, /, %, to perform addition, subtraction, multiplication, division, and percentage respectively. In Excel 2016, a formula begins
with an equal to (=) sign. You can manually enter the function and formulas. The general syntax of a function is as follows:
75
Session Spreadsheets
The AVERAGE function is used to calculate the average of the values contained in a range of cells.
Average
Syntax: =AVERAGE (number1, [number2], ...)
The COUNT function counts the number of cells in a range that contain numbers only.
Count Syntax: =COUNT (Value1, [Value2], ……)
Max and Min The MAX and MIN function is used to calculate the maximum and minimum value in the selected
range of cells.
Syntax: =MAX (number1, [number2], ...)
The LOWER and UPPER function is used to convert the text to lowercase and uppercase i.e.
Lower and Upper small letters and capital letters.
Syntax: =LOWER(Text): =UPPER(Text)
The LEN function is used to calculate the number of characters in a text string including spaces.
Len
Syntax: =LEN(Text)
The PROPER function capitalizes the first letter of each word of a text string and changes all other
Proper letters to lowercase.
Syntax: =PROPER(Text)
Error Checking
The Formulas and Functions can sometimes result in error values. The Error Checking command helps you to check for
common errors that occur when using formulas or functions. This command shows you the cells containing the error, the
type of error and other error information. Then you have the access to a number of options to check and correct these
errors.
The table shows some type of errors with their description with examples.
Solution Make sure cell ranges are correctly separated. Adding a comma between
the C and E ranges will correct it. =SUM(C2:C3,E4:E6)
Solution Check and update the formula with valid numbers. =SQRT (4)
#NAME? The Formula is unrecognized i.e. a syntax error. =SSUM(E10:E15)
Solution Use the Function Wizard or type the correct formula. =SUM(E10:E15)
#REF! Cell reference is not valid. Cells may have been deleted like C2 that was =SUM(B2,#REF!,D2)
referred to by formula.
76
Adjust the formula so that it uses a reference that exists. Either use Undo
Solution (Ctrl+Z) to undo the deletion, rebuild the formula, or use a continuous range =SUM(B2,C2,D2)
reference like: = SUM(B2:D2)
Formula or operator is wrong. Also, one or more cells that are included in an
#VALUE! arithmetic formula contain text. =D10, D34
Solution Type the correct operand and make sure the appropriate data is referenced. =D10+ D34
Freeze Panes
The Freeze panes used to lock the selected rows and columns in
place to keep them locked while the rest of the sheets moving.
You can use this options to freeze just top row, first column or
any selected multiple rows and columns.
To Freeze both row(s) & column(s), follow the steps given below:
1) Select the cell to freeze all the rows above it and all the columns
to the left of it.
2) Click on the Freeze Panes command.
3) Choose the Freeze Panes option.
4) To freeze the top row, use the Freeze Top Row option from the
Freeze Panes command.
5) To freeze the first column, use the Freeze First Column option
from the Freeze Panes command.
Workbook Security
Excel 2016 enables you to secure your work and prevent unauthorized access to your workbook. Workbooks may contain
sensitive information like Credit Card Numbers, National ID Numbers, Employee Information etc. The following section will
guide you through Excel's password protection feature.
77
Session Spreadsheets
To create a Workbook Password, click on the File Tab and follow the steps given below:
1) In the Backstage view, from the Info option, click on the Protect Workbook command.
2) Click on the Encrypt with Password option from the displayed list.
3) Type the password in the Encrypt Document dialog box and click on the OK button.
4) Re-enter the password in the Confirm Password dialog box.
5) Click on the OK button and save the workbook to apply the password. When you open
the workbook, Excel 2016 prompts you to enter the password for the workbook.
Removing a Password
You can also remove the password from the protected workbook. To Remove the Password, click on the File Tab and follow
the steps given below:
1) In the Backstage view, from the Info option click on the Protect Workbook Command.
2) Click on the Encrypt with Password option from the displayed list.
3) In the Encrypt Document dialog box, select the password and press the Delete key.
4) Click on the OK button and save the workbook.
78
Apply
Self-Learn activity
See the video by scanning the QR Code.
Apply the skills using teaching aid from LMS and submit it.
4 - The _________________ used to lock the selected rows and columns in place to keep them locked while the
rest of the sheets moving.
5 - You can protect your Excel workbook with a _____________ to prevent the unauthorized users from
79
Session Spreadsheets
A) Logical
3 - These functions perform arithmetic operations, conditional sum, exponents & B) Math & Trig
logarithms, and the trigonometric calculations. C) Text
D) All of the above
A) MAX
4 - The ______________ function capitalizes the first letter of each word of a text B) LOWER
string and changes all other letters to lowercase. C) COUNT
D) PROPER
A) LEN
5 - The ____________ function is used to calculate the number of characters in a text B) LOWER
string including spaces. C) COUNT
D) COUNTA
80
Closing
Spreadsheets
Various Spreadsheet The Home Tab Chart and Elements Print Area Freeze
of a chart Functions Panes
Programs Print Titles
Inserting chart Workbook
Starting Excel 2016 Error
Checking Security
Design and Format
Tab's-Contextual Tabs
81
Dr. Slah A. Alsaleh
82
Aim
This chapter emphasizes generic programming concepts and related problem-solving
strategies. The theoretical knowledge and practical skills that students learn in this chapter
will be applicable to a wide variety of programming domains and languages, which will advance
students’ skills regardless of their major field of study.
Learning outcomes
Upon successful completion of this chapter, the student will be able to:
Contents
Introduction to Algorithms
Conditional Logic
Introduction to Programming
83
Session Introduction to Algorithms
Session
Introduction to Algorithms
84
Goal
Learning objectives
Dear Student
By the end of this session, you should be able to:
Describe the concept and Design algorithmic solutions List the advantages and usage
importance of computer to a range of computational of flowcharts in developing
algorithms. problems from various areas. computer programs.
1 2 3 4 5 6
List the advantages of Describe how computers use Transform algorithms into
using algorithms in algorithms to perform the flowcharts to understand
computer programming. tasks we expect them to do. the flow of information.
Be prepared
You know that Computer is a dumb machine. It works only based on your instructions
and cannot do anything on its own. Although it is an accurate machine, if you give it a
wrong instruction, it will generate a wrong result. So you need to give it correct and
step wise instructions to make it work properly and accurately.
There are big companies worth billions of dollars, like Uber for example, are based on
computer application that can be accessed via website and mobile application.
85
Session Introduction to Algorithms
Learn
ALGORITHMS Modern computers can carry out complex tasks. Each task consists of well-defined
procedures known as algorithms. An algorithm is a well-defined procedure that allows a
computer to solve a problem.
Advantages of Algorithms
They are easy They are easy They are easy They are not dependent on any
to understand. to implement. to modify. particular programming language.
86
Rules for writing Algorithms
There are some guidelines for writing an algorithm. These guidelines or rules make algorithms self-explanatory. You should
follow the given rules while writing an algorithm.
Give statement numbers Always begin Write the Write Stop at the Write each statement
as Step 1, Step 2, etc. with Start. statements clearly. end of the algorithm. in a separate line.
Below is what the algorithm could look like. Let's say the input consists of a list of numbers, and
this list is called L. The number L1 would be the first number in the list, L2 the second number,
etc. The list is not sorted. So, the input to the algorithm is a list of numbers, and the output
should be the largest number in the list.
STEP
Start
1
STEP Let Largest = L1
2 This means you start by assuming that the first number is the largest number.
STEP
For each item in the list:
3 This means you will go through the list of numbers one by one.
Notice
that the algorithm is described as a series of logical steps in an English-like language that is
easily understood. For a computer to actually use these instructions, they need to be
written in a language that a computer can understand, known as a programming language.
87
Session Introduction to Algorithms
FLOWCHARTS
You know how to write the steps of an algorithm to solve a problem. If you put all these
step-wise instructions into some boxes, you will get a Flowchart. A Flowchart is a graphical
representation of an algorithm. It is a step-by-step process to solve a problem in graphical
form. The purpose of making a flowchart is to assist in writing a program. The flowchart lists
all the steps to be considered in a program. The steps must be in the correct logical order.
Advantages of Flowcharts
Since the flowchart is the graphical representation of an algorithm, it gives a better understanding of the solution
to a problem than words alone. Following are the benefits of using flowcharts in program development.
88
Let us learn about some symbols used to draw a flowchart.
Start / Stop Box
For example,
The Start / Stop box is oval in shape and is also called the Terminal box.
The box used in the beginning of the flowchart is called the Start box,
Start Stop
and the box used at the end of the flowchart is called the Stop box.
Decision Box
A diamond-shaped symbol is used to represent the Decision box. It represents a decision as
well as a comparison operation.
Yes No
A>B
For example, this chart represents
IF A>B THEN PRINT A
ELSE PRINT B PRINT A PRINT B
Flow Lines
Start
For example
INPUT A,B
89
Session Introduction to Algorithms
Connectors
At times, the flow of the main process in the flowchart has to be redirected to a previous point in order to repeat a process.
This requires connecting two different points of the flowchart, which is done by the use of connectors. A circle is used to
connect two different parts of a flowchart which are at different places.
START
A
INPUT A,B
SUM = A+B
STOP
(a) In drawing a proper flowchart, all necessary requirements should be listed out in logical order.
(b) The flowchart should be clear, neat, and easy to follow. There should not be any room for ambiguity in understanding the
flowchart.
(c) The usual direction of the flow of a procedure or system is from left to right or top to bottom.
(d) Only one flow line should come out from a process symbol.
or
(e) Only one flow line should enter a decision symbol, but two or three flow lines, one for
each possible answer, may leave the decision symbol.
No =0
90
(f) Only one flow line is used in conjunction with a terminal symbol.
(g) Write briefly within standard symbols. As necessary, you can use the annotation
symbol to describe data or computational steps more clearly.
(h) If the flowchart becomes complex, it is better to use connector symbols to reduce the number of flow lines. Avoid the
intersection of flow lines if you want to make it a more effective method of communication.
(j) It is useful to test the validity of the flowchart by passing through it with simple test data.
91
Session Introduction to Algorithms
92
Apply
Activity (a) ____________________ are written in a step-by-step procedure before writing the actual computer program.
1 (b) A ________________ is a graphical representation of an algorithm. It is a step-by-step process to solve a problem
in graphical or pictorial form.
(c) A flowchart is independent of the ___________________.
(d) A ____________ shaped symbol is used to represent the decision box.
2
(b) An oval is used to connect two different parts of a flowchart.
(c) A parallelogram is a graphical representation of steps for solution of a problem.
(d) A diamond is used to represent the start step.
(c) A circle is used for a decision-making step.
3
(b) Print Result Step 2. .....................................
(c) Start Step 3. .....................................
(d) Read A, B Step 4. .....................................
(e) Result = A + B Step 5. .....................................
Closing
Dear student, you have just learned the logic of solving problems using algorithms. Although the examples we covered in
this session are basic, the concept is the same even for much more complicated scenarios. If you would like to build your own
computer application, then you have to practice solving problems using algorithms, then use your flowchart as a guide in the
programming phase and write your code with the programming language that you like.
93
Session Introduction to Programming
Session
Introduction to Programming
94
Goal
Learning objectives
Dear Student
By the end of this session, you should be able to:
Describe what computer programs Differentiate between compilers List the features that Shell window
and programming are. and interpreters. and the Code window provide.
1 2 3 4 5 6
List the different types of List Python’s windows Write your first programs
programming languages. and their purposes. in Python.
Be prepared
Every time we use smart devices, there are programs running in the
background. Moving a mouse pointer from one part of your computer screen to
another may seem like a simple task, but in reality, a computer program just ran.
Another simple task like typing letters into Google Docs leads to computer
programs being executed in the background. It is all programming everywhere.
95
Session Introduction to Programming
Learn
PROGRAMMING
Programming is the process of creating a set of instructions
that tell a computer how to perform a task. It is often referred
to as coding. Programming can be done using a variety of
programming languages, such as SQL, Java, Python, and C++.
What is a program?
- Video games.
A computer program is stored as a file on the computer's hard drive. When a user runs the program, the
file is read by the computer, and the processor reads the data in the file as a list of instructions. Then
the computer does what the program tells it to do.
These represent two states: on (1) and off (0). That is the natural language of
electronic devices. It would be complicated for us as humans to communicate with
the computers in binary.
96
Types of Programming Languages
Computer programming languages are basically classified into two types
High-level programming languages provide strong Low-level programming languages provide little or no
abstraction and have a simple and easy syntax. abstraction and have a very complex syntax. These
Examples include Python, Java, C, C++, Ruby, Perl, languages mainly consist of numeric terms, while
Basic, JavaScript, and many more. high-level programming languages provide syntax
consisting of a complete alphanumeric syntax.
High Level
There are two main low-level programming languages:
Programming FORTRAN C Pascal
assembly language machine language
High-Level Language
Assembly Language
Low
Level Machine Language
Programming
Hardware
Translators
You know that computers understand only binary, the language of 0’s and 1’s. On the other hand, the high-level program-
ming languages are closer to our natural languages. Hence, to communicate with computers by using these programming
languages, we need special translators.
Translators have the responsibility of converting your source
code to binary machine language. We may refer to the binaries
as object code, the program, or a common word today: app.
Interpreters Compilers
Some languages are interpreted. The translator processes the Compilers function differently. They convert the entire source code
source code line by line and runs every line in the program or into the object code via a compilation process. The object code is
app. This means that interpreted source code starts running then executed. If there were errors in the source code, they are
until it encounters an error. Then the interpreter stops to detected during the compilation stage and flagged. This interrupts
report such errors. the compilation process, and no object code is generated.
Python is a good example of an interpreted programming language. Visual Basic and C++ are good examples of compiled
programming languages.
Interpreters translate line by line and execute each line before going on to the next line.
To summarize
Compilers translate the entire program to a file (binary) and execute the whole file.
97
Session Introduction to Programming
There are several powerful languages that are easy to set up and learn, and Python is one of
them. Python is an interpreted, interactive, object-oriented programming language.
Object-oriented programming language is a programming language model organized
around objects rather than "actions" and data rather than logic. Pythons’ flexibility allows it
to do many things, both big and small. Python can be used to write simple programs, but it
also possesses the full power required to create complex, large-scale enterprise solutions.
Source Code
Source code is basically a file, just like a Microsoft Word (.docx) file, but slightly
different. It is a raw text file, written on very simple editors, like the Windows
Notepad. You will recall from the previous section that you need either interpreters
or compilers to convert your source code to binary. The source code must be saved
in a file, which is passed as an input to the translator.
Depending on the language you are writing in, there are designated extensions for saving your source code file.
2 - Scroll down and click on Download Python from the official Python
website (www.python.org).
3 - Select the right operating system that you have (e.g. Windows or Mac).
98
4 - Now you should select the version of Python you are interested
in or choose the latest version. In this book, we used version 3.6.5.
6 - Now your python has been installed in your computer and you
can start using it.
The Python shell provides the very useful ability to execute in interactive mode where you execute a single Python
command and get the result. Interacting with the shell is much like using a calculator, except that, instead of being limited
to the operations built into a calculator (addition, subtraction, etc.), it allows the entry and creation of any Python code.
For example, in the following screen, we entered 2+3 and got the result as 5 in the next line.
Here, the expression 2 + 3 is entered at the shell prompt (>>>), and the program immediately responds with the result 5.
99
Session Introduction to Programming
And that’s it. You’ve just made your first programs in Python. Each time you
entered a line, Python immediately executed the statement.
Once done, you can use exit () or Ctrl D to leave the Python shell.
hell Window
The Shell window opens automatically when you open IDLE (Python’s Integrated Development and
Learning Environment) or when you run a program from the Code window. The main purpose of it
is to run codes. You may use it to write and test small pieces of code. However, you cannot save the
code through the Shell window. Below is a screenshot of the main Shell window.
The first bar of the Shell window illustrates the name and version of Python. It is also printed in the first line of the
Shell window, with more information about the version (inside the orange box).
100
The three arrows, known as the command prompt, appear when the computer is ready for you to type your code. Once
you write your code, press enter to run the code. The code runs immediately and the output appears in the next line
unless there is an error (bug).
As you can see in the screenshot above, we wrote the first command with a missing left bracket and pressed enter. The
output was a SyntaxError, and we have been advised how to fix it. In the second command, we debugged the code and
ran it again. The output was printed on the next line. You may have noticed that there are different colors of the code.
What do these different colors mean? Purple means a built-in function. Green means a string. Red means there is an
error. Blue means a function definition or output from the program in the Shell window. Orange means a keyword. The
rest is usually in black.
ode Window
The code window is used to write your code, especially when you are writing a long program. It
allows you to save and edit your code in a more practical way.
To start a new code window, click on the File menu from the Shell window, then click on “New file”.
101
Session Introduction to Programming
A new untitled window will appear. This window is ready for you to write your code in it. However, it is good practice to
save the file before using it. Click on File then Save to save the file.
The following window will appear. Select the location and folder that you would like to save your file in, then type the file
name and save it as “Python Files”.
102
Now your file is saved and you may notice that the file name on the title bar changed from Untitled to the new name
along with the new location that you entered. You can type your code now and save it frequently by clicking File then
Save or (Ctrl + S) as a shortcut.
Once you are finished writing your code, you can execute it by saving the file and then clicking on the Run menu,
then on Run Module. Alternatively, you may press F5 on your keyboard and that will execute your code.
As you can see in the previous screenshot, the code was executed and the output was displayed in the
Shell window. The first line is the file name and its location, followed by the program output.
103
Session Introduction to Programming
Python has a huge number of GUI frameworks that can be used to create a GUI for its applications. TkInter
(traditionally bundled with Python, using Tk) is one example of the technologies that can be used to build a GUI.
Before we finish with this session, let us create one more interactive program.
We will write a program that asks you a few questions, then prints out an introduction about yourself.
From the same interpreter shell of Python 3.6 that you used in the last examples, click on File and then New file, then write
the following code:
Then save the file as a Python files and double click on it to run the program.
104
Apply
Fill in the blanks. Coding, Binary Code, Integrated Development and Learning Environment, Computer Program
(a) Programming is also referred to as _______________.
(b) A __________ is a sequence of instructions executed by computer process to solve a problem in graphical or
Activity pictorial form.
1 (c) ________________ is the natural language of electronic devices.
(d) An __________________ is a bundled set of software tools for program development.
2 (c) .py
(d) Source code
translate the entire program to a file and execute the whole file
is often referred to as coding.
(e) Compilers is a raw text file, written on very simple editors.
3
b. Write a program in Python to display your name, address, and profession.
c. Write a program in Python to subtract, multiply, and divide two numbers.
What do the green and red text mean in the following window? How can you remove this red text?
Activity
4
Closing
Dear student, you have just learned that anything a computer does must be through a program. A program is a sequence of
instructions that is written in a programming language. A programming language is a language that allows us, as humans,
to communicate with machines and pass our commands through a code. The code is then translated, either interpreted or
compiled (based on the programming language that you used), to be a binary code. The machine then understands the
program and executes the commands. You also became familiar with a powerful interpreted object-oriented programming
language, Python. You learned the functionality of two main windows that Python uses: the Shell and Code windows.
Although you only executed a few simple queries, Python is used for more complicated applications, including business
intelligence and machine learning.
105
Session Building your First Program
Session
106
Goal
Learning objective
Dear Student
By the end of this session, you should be able to:
1 2 3 4 5
Be prepared
Any computer program that you have come across was built to solve a problem or
provide a service. If you have a problem and you would like to utilize the power of a
computer to solve it, then you should know what to do by now.
107
Session Building your First Program
Learn
The game is about a person in a jail. There are three doors Which door
you guess is the escape door?
in front of him. One door will let him go free from the jail, while
the other two will take him to the jailors. Now he needs to
guess which door is the escape door. If he finds it, then he
wins the game. Otherwise, he loses the game and it is over. 1 2 3
Algorithm
STEP 1 Start
Print message “Welcome to the Escape Door game. Which door do you guess is the escape door?
STEP 2 Choose from 1, 2, or 3.”
This means you start by allowing the participant to enter a door number.
STEP 4 Then print the message “Sorry!! The number you entered is incorrect! Try again.”
This means you start This means the player entered a door number that doesn’t exist.
STEP 5 Go back to step 2
STEP Then Print message “Sorry!! The jailor caught you and took you back to the jail. GAME OVER”
7
This means the player entered the wrong door number and lost the game.
STEP 9 Then Print message “Well done, you are free now. GAME OVER”
This means the player entered the right door number and won the game.
108
STEP 10 If the number entered = 3:
Then Print message “Sorry!! The jailor caught you and took you back to the jail. GAME OVER”
STEP 11
This means the player entered a wrong door number and lost the game.
STEP 12 Stop
Now you have written an algorithm that explains the solution in a clear and simple way. To make your
program even more understandable, we are going to draw a flowchart together. The flowchart, as we
learned in session one, will make it easy for anyone to understand the object and logic of your program.
Flowchart
START
Draw a flowchart of the Escape Door game.
Output
“Enter door number”
Input
Door number
Output No
Wrong number, Number = 1, 2,
try again!! or 3?
Yes
Output
“Sorry!! The jailor caught No
you and took you back to Number = 2?
the jail. GAME OVER”
Yes
Output
“Well done, you are
free now. GAME OVER”
END
109
Session Building your First Program
Program code
Your program should now look like the following
Save your file, then click on the Run menu, and click on Run Module. Alternatively, you could press F5 on your keyboard
and it would directly run your program. You should get the following window.
- Spelling errors
f you get an error message nown as a bug , then you have to debug - Missing quote marks or brackets
- Missing indents
your code by carefully chec ing the code again. uch errors might be
- Using = instead of == in an if statement
- Not using : after if, elif, and else
110
Apply
Activity
Create an algorithm and flowchart to add two different numbers (using three variables)
4
losing
ear student, you have just learned how to solve a problem or provide a service through a computer application.
Although the program that you built is a simple and small one, the concepts and procedures remain the same even with
more complicated ones. It is always a good practice to split a big program into small subsets of functions, then work on each
one individually. Once the small subsets are completed and tested, then it is much easier to combine them and run the whole
program. There are many techniques and practices in how to code your program, and you need to define your own way and
be precise and consistent.
111
Session Variables, Statements, and Operators
Session
112
Goal
Learning objectives
Dear Student
By the end of this session, you should be able to:
1 2 3
Be prepared
A statement is a unit of code that the Python interpreter can execute. In this
session, you will learn how to use variables and create executable statements.
113
Session Variables, Statements, and Operators
Learn
Variables
Before explaining the variables in Python, let us review the values and their types. A value is a basic
element that a program works with, such as a number or a letter. In the previous sessions, we dealt with
different values including 1, 2, 3 and “Python is fun!”. These values belong to different types. Here, 1, 2, 3 are
integers and “Python is fun!” is a “string,” as it contains a string of letters. The string is always enclosed in
quotation marks. If you are not sure what type of variable it is, then you can use the command “type” and
the interpreter will tell you the type, as shown in the following example.
Python displays the variable type based on the value assigned to it. This means Python will change the variable type if we assign
a value of a different type. For example: if you assign ' Python is fun!' to a variable var, then the type will be string. If you reassign
another value, 5, to var, then it will be integer.
114
The following table explains some basic variable types in Python.
Type Examples Description
123
Any positive, negative, or
0
integer zero value; no limit on size
-1234
3.15
Real numbers expressed in decimal or scientific
float 6.02E2 notation; limits on scale and precision
3
True Logical true/false quantities
boolean False
Programmers choose names for their variables that are meaningful and describe what the variable is used for. In Python, variable
names can contain both letters and numbers, but they cannot start with a number. It is legal to use uppercase letters, but it is a
good idea to begin variable names with a lowercase letter. The underscore character ( _ ) can appear in a name. It is often used in
names with multiple words, such as student_id. If you give a variable an illegal name, you get a syntax error:
In the above examples, it is clear that the first and second examples are wrong, as we explained in the previous
paragraph. However, what is wrong with the third example? You may have noticed that the variable name in the
third example is class, which is one of Python’s keywords. Keywords cannot be used as variable names.
Python has 33 keywords reserved that cannot be used as a variable name. They are:
115
Session Variables, Statements, and Operators
Statements
The code for an application is usually contained in a sequence of statements. A statement is a unit of
code that the Python interpreter can execute. So far, we have seen two kinds of statements: print
statement and assignment. When you type a statement, the interpreter executes it and displays the
result, if there is one.
If there is more than one statement, the results appear one at a time as the statements are executed,
as explained in the following example:
print(“King Saud University”)
x = 2019
print(x)
Operators
Python has special symbols called operators that represent computations like addition and division.
The values the operator is applied to are called operands. The operators can be summarized in the
following table.
+ + Addition 4+2 6
– – Subtraction 4-2 2
× * Multiplication 4*2 8
42 ** Exponent 4 ** 2 16
or power
() () Parentheses (4 + 2) * 3 18
(grouping)
116
Now you can write some expressions that are built by the combination of values, variables, and operators. If you
type an expression in interactive mode, the interpreter evaluates it and displays the result:
You can start by creating variables and assign values to them, then do some calculations, as in the following
example:
When more than one operator appears in an expression, the order of evaluation depends on the rules of precedence. For
mathematical operators, Python follows mathematical convention as follows:
1 2 3 4
117
Session Variables, Statements, and Operators
Now let us build a more meaningful application that reads two values, which are your car speed and the distance to your
destination; then the application tells you how many minutes you need to arrive.
We will start in a new Code window as you have learned in session 4. Let us save the file as Traveling_Time
print("Welcome to the traveling time application")
speed = input("enter your speed in km/hour")
speed = int(speed)
distance = input("enter the distance to your destination")
distance = int(distance)
time_h = distance/speed
time_m = distance/speed*60
print("you will need",time_m, "minutes to arrive")
print("you will need",time_h, "hours to arrive")
And when you run the program you will get an output similar to the following.
118
Apply
Activity
1 Create two integer-type variables and calculate the addition of them in a third variable.
Activity
2 Print “I am studying at King Saud University” using an appropriate variable.
Activity
What will be the result for the following statement? >>> 6*5*(9+2)+3**2+(5+1)?
3
Closing
Dear student, you have just learned how to use variables, operators, and statements to enhance your programming
and produce solutions for more complicated problems. We mentioned in this session four famous types of variables, and
there are many more you may need to learn in your feature studies. We also explained the basic operators that allow you
to do computations. However, Python has many built-in functions that you can use, and you can also create your own
functions. You can now refer to the Python website and explore more advanced variable types and functions to improve
your previous programs.
119
Session Conditional Logic
Session
Conditional Logic
120
Goal
Learning objectives
Dear Student
By the end of this session, you should be able to:
1 2 3
Build a single-decision
conditional statement.
Be prepared
One of the most powerful features of programming is the ability to use conditional logic. In programming, there are some
situations where you need to make decisions, and based on these decisions, the program will execute the next block of code.
In other words, conditional logic here means we are given different paths from which we have to choose one. Python
supports the usual logical conditions from mathematics. In this session, you will learn how to use different conditional
statements.
121
Session Conditional Logic
Learn
Decision Making
As a programmer, you will definitely need to distinguish between many decisions and
perform different instructions based on the conditions output. To do so, Python provides
you with two main features: Boolean expression (an expression that is either true or
false) and conditional statements. The following are examples of Boolean expressions
that use the operator == to compare two values and produce True if they are equal and
False otherwise:
Conditional statements are used when we have two or more outputs for a condition, with a specific action for each
condition output. The following flowchart from session 1 is an example of a decision-making structure. Here, we have three
conditions, and each condition has two outputs.
START
START
INPUT A, B, C
END
Decision structures evaluate multiple expressions and produce TRUE or FALSE as the outcome. You need to determine
which actions to take and which statements to execute if the outcome is TRUE or FALSE.
122
If Statement
An “if statement” allows your program to run a group of instructions, based on a condition
or set of conditions. With an if statement, your program can make a choice. The syntax of
writing an if statement in Pythons is as follows:
if condition:
indented statement(s)
As we mentioned, the condition we are testing is usually a Boolean expression with
a true/false output.
If the expression is true, the program will run the indented statement(s),
but if it’s false, the program will skip them and continue with the rest of the program at the
next unindented line.
Let us now practice using if statements in the following scenario. You were asked to build a program that asks students to
enter the pass mark for the IT140 course, asks them to enter their accumulated marks until now, and tells them if they have
already passed or how many marks they need to pass the course.
As you learned, you should start by drawing a flowchart before you start coding your program. Make that
flowchart now, then proceed to the commands below.
Else Statement In many scenarios, we want our program to execute a set of instructions if a condition output
is true and a different set of instructions if the condition output is false. Python provides you
with a shortcut for that: the else statement. It allows you to test if the condition is true
without having to perform another test to see if it is false. The else statement can only be used
after an if statement, so we sometimes refer to the two together as an if-else statement. The
syntax of writing an if-else statement in Pythons is as follows:
if condition:
indented statement(s)
else:
other indented statement(s)
If the condition in an if statement is true, the indented statements under the if are executed, and the else and all its statements are
skipped.
If the condition in the if statement is false, the program skips directly to the else’s other indented statements and runs those.
Let us now rewrite the previous example (the if statement example) with an if-else statement instead.
An if-else statement makes the code shorter and easier to read since the condition must be either true or false. It also helps prevent
coding errors in the two conditions as you may forget some outputs, such as if your mark is equal to the pass mark.
123
Session Conditional Logic
Elif Statement
In other scenarios, we have more than two possibilities for a condition, and we need more than two
groups of instructions. One way to express a condition like that is to use an elif statement:
if condition:
indented statement(s)
elif condition:
indented statement(s)
else:
indented statement(s)
Elif is an abbreviation of “else if.” Again, exactly one branch will be executed. There is no limit on the number of elif
statements. If there is an else clause, it has to be at the end, but there does not have to be one.
To practice the elif statement, let us assume that you are going to write a program that reads a student’s mark and display
the grade. If the mark is 95 – 100 then the grade is A+, 90 - <95 then the grade is A, 85 - <90 then the grade is B+, 80 - <85
then the grade is B, 75 - <80 then the grade is C+, 70 - <75 then the grade is C, 65 - <70 then the grade is D+, 60 - <65 then
the grade D. Otherwise, the grade is F, unless the entered mark was above 100 or less than 0; then the error message
“Sorry, you entered", your_mark, "This is an invalid mark !!” should be displayed.
It is obvious that the decision is based on the student’s mark. Therefore, all conditions will be directly related to the marks.
You may also have noticed that we have multiple conditions, where each condition has an output, and as a result we will use
an elif statement to execute this conditional logic.
124
Apply
Activity Write a program to compare two variables (a and b) and print the value that is larger along
1 with the variable name.
Activity
2 Write a program to check whether a number is even or odd.
Activity
Write a program that reads three numbers, then finds and prints the largest one.
3
Closing
Dear student, you have just learned how to use different decision-making statements to enhance your programming
and produce solutions for more complicated problems. We mentioned in this session three famous types of conditional logic.
You can now refer to the Python website and explore more details and more examples where you can use different
decision-making statements and improve your previous programs.
125
Session Loops and Functions
Session
126
Goal
Learning objectives
Dear Student
By the end of this session, you should be able to:
1 2 3
Be prepared
In this session, you will become familiar with two programming features that can
execute complicated tasks more efficiently: loop and function. Loop allows you to
repeat a statement or group of statements hundreds or thousands of times without
typing them again and again. Yes, you only need to write a loop statement with a
counter or a condition, and the program will take care of all the repetition.
On the other hand, a function is a block of organized, reusable code that is used to
perform a single, related action. There are built-in functions like print(), and you can
also create your own functions.
127
Session Loops and Functions
Learn
Loop When we need to do something over and over again in a program, loops allow us to repeat those steps
without having to type each one separately. To build a loop,
For statement
A for loop statement in Python iterates over a list of items and repeats one step or a group of steps for each item in a list,
like the numbers 1 through 20, or names =[‘ahmad’, ‘saad’, ‘sarah’].
Start
for items
repeated
statements
end
As you can see in the previous figure, the program started, and when we wanted to repeat some statements, we used for.
Along with for, we specified the number of loops using a list of items. After that, we wrote one or a group of indented
statements which will be repeated until the list is completed.
128
Have a look at the following examples and predict their outputs.
Example 1 Example 2
Let us now practice using the for statement in a more detailed example.
While statement
A while loop statement repeats a step or group of steps while a given condition is true. It
checks the condition before executing the loop body and then executes the steps, which makes
it different from the for statement.
The following example shows you how to count down from 10 and then say “I like Python”:
n = 10
while n > 0:
print(n)
n = n - 1 Start
print('I like Python')
While Condition
repeated
statements
end
As you may notice, we started by having a counter n and assigned it a value of 10. Then we started a while statement with
a condition n > 0. While the condition is true, the while statement body (the intended steps) will be executed.
In this example, we have two steps: print n and update n with n-1. The body will be repeated 10 times. Each time we execute
the body of the loop, that is called an “iteration”. When n=0, the condition becomes false. At this stage, the while loop
statement is completed and the interpreter exits the while statement and continues the program. We have one more
statement remaining in the program, which is printing “I like Python”; then the program is completed.
129
Session Loops and Functions
Example 1
Let us now practice while and for statements using a more detailed example. You have been asked to write a program
that reads a number and prints all values from that number until zero. The program then asks for a new number and repeats
that same process until 0 is entered. Once 0 is entered, the program prints “Thank you and have a nice day” and stops.
Example 2
130
Functions
A function is a block of code that only runs when it is called. It is a block of organized
and reusable code that is used to perform a single task. Functions are very useful in
many cases where you need to run the function every now and then.
To use a built-in function or a function that you defined, you only need to call the
function and pass the parameters. That will execute the function using the parame-
ters and return an expression if there is any.
Built-in functions
Python has many built-in functions that you can use immediately to save time and shorten your code.
You will find many built-in functions in the following table; some of them you already used in this chapter.
Method Description
abs() Returns absolute value of a number
len() Returns the number of items in an object or the number of characters in a string
131
Session Loops and Functions
Let us practice the function len(), which returns the number of characters in a string. Have a look at the following
example and predict the output:
efining a unction
If the built-in functions are not enough for you, then you can create your own functions. These functions are called
user-defined functions.
You can define functions to provide the required functionality. Here are simple steps to define a function in Python.
Function blocks begin with the keyword def followed by the function name
and parentheses ( ( ) ). Have a look at the following example where we are
creating a function with the name “my_function()”
The first statement of a function can be an optional statement — the documentation string of the function or docstring.
The code block within every function starts with a colon (:) and is indented.
The statement return [expression] exits a function, optionally passing an expression back to the caller. A return statement
with no arguments is the same as return none.
132
Apply
Activity
1
Write a program to print all natural numbers in reverse (from n to 1), using a for loop)
Activity
2
Write a program to print all even numbers between 1 and 100, using a while loop.
Activity
Write a program to find the maximum and minimum among three numbers, using functions.
3
Closing
Dear student, you have just learned how to use different loops and different types of functions to enhance your
programming and produce solutions for more complicated problems. We mentioned in this session two famous types of
loops and two ways of using functions. You can now refer to the Python website and explore more examples where we can
use different loops and functions and improve your previous programs.
133
Session File Input/Output (File I/O)
Session
134
Goal
Learning objectives
Dear Student
By the end of this session, you should be able to:
1 2 3
Be prepared
You have learned many programming features of Python that allow you to write and execute many programs efficiently.
That is really great. In this session, you will learn an important feature that allows you to import data from a text file and
store the program output to a text file. In many cases, you do not want to enter every single variable that your program
requires by typing it, as you may already have it stored in a file. In other cases, you need to store the program outputs in a
file for documentation and sharing purposes. In such scenarios, using file I/O is very helpful. In this session, you will learn
how to read data from a text file, manipulate it, and then write data to a file and store it.
135
Session File Input/Output (File I/O)
Learn
Files in Python
Python has two categories of file: text or binary.
A text file is structured as a sequence of lines, where each line includes a sequence of
characters. Each line is terminated with a special character, called the EOL or End of Line
character. The most common EOL is the comma {,} or newline character. It ends the current
line and tells the interpreter a new one has begun. A backslash character can also be used to
tell the interpreter that the next character – following the slash – should be treated as a
new line.
On the other hand, a binary file is any type of file that is not a text file. Because of their nature, binary files can only be
processed by an application that knows or understands the file’s structure. In other words, there must be an application
that can read and interpret binary files.
Here is a list of the different modes that can be used while opening a file:
Modes Description
r Opens a file for reading only. The file pointer is placed at the beginning of the file. This is the default mode.
Opens a file for reading only in binary format. The file pointer is placed at the beginning of the file. This is the
rb default mode.
r+ Opens a file for both reading and writing. The file pointer is placed at the beginning of the file.
136
Opens a file for both reading and writing. The file pointer is placed at the beginning of the file.
rb+
Opens a file for writing only. Overwrites the file if the file exists. If the file does not exist, creates a new file
w for writing.
Opens a file for writing only in binary format. Overwrites the file if the file exists. If the file does not exist,
wb creates a new file for writing.
Opens a file for both writing and reading. Overwrites the existing file if the file exists. If the file does not exist,
w+ creates a new file for reading and writing.
pens a file for both writing and reading in binary format. Overwrites the existing file if the file exists. If the file
wb+ does not exist, creates a new file for reading and writing.
Opens a file for appending. The file pointer is at the end of the file if the file exists. That is, the file is in the append
a mode. If the file does not exist, it creates a new file for writing.
Opens a file for appending in binary format. The file pointer is at the end of the file if the file exists. That is, the
ab file is in the append mode. If the file does not exist, it creates a new file for writing.
Opens a file for both appending and reading. The file pointer is at the end of the file if the file exists. The file
a+ opens in the append mode. If the file does not exist, it creates a new file for reading and writing.
Opens a file for both appending and reading in binary format. The file pointer is at the end of the file if the file
ab+ exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing.
Also, and before we take an example of opening and reading file, let us explore some basic file attributes and how to
identify these attributes.
Attribute Description
Now let us practice all of that. You have a text file “cfy.text”
which has three lines of text,
The file is saved in the following folder; “C:\TEMP”. If you have your
text file stored in another location, you can use it after changing
the current directory in the Python shell. Let us now change the
current directory to TEMP.
137
Session File Input/Output (File I/O)
Now we are ready to open the file and read the data.
>>> mycfy = open("cfy.txt", "r+")
To check the text inside the file object “cfy.txt” which you assigned to mycfy, you can use a print statement or simply type
mycfy.
>>> print("The text is:", mycfy)
The text is: Common First Year
King Saud University
2019
138
Write data to file
Before we write to a file, let’s create our own file and name it. Using the open file
statement open(“filename”, “mode”) with mode (W+) opens a file for both
writing and reading. It overwrites the existing file if the file exists and creates a new file
for reading and writing if the file does not exist.
Once you have your file ready then you can write to it using the write() function which writes any string to an open file. It
is important to note that Python strings can have binary data and not just text. The write() function does not add a
newline character ( n ) to the end of the string. The syntax of write function as follows:
file bject te( t n )
Let us create a file with your name and write your details in it.
Now you should have already created a file called “Ahmad.txt” with your information stored in it. To open the file, go to
C:\TEMP and double click on the file.
When you are finished working on your file, you can use the clo e() function to close it. This will close the file complete-
ly and terminate resources in use. It is important to understand that when you use the clo e() function, any further
attempts to use the file object will fail.
m file clo e()
139
Session File Input/Output (File I/O)
Apply
Activity Write a program to create a file with the name “KSU.txt” and add three things which you
1 like in the KSU.
Activity
2 Write a program to display contents of a file on the screen.
Activity
3 Write a program to read a file and display its contents with line numbers on a screen.
Activity
4 Write a program to copy one file to another.
140
Closing
Dear student, you have just learned how to use files in programming languages. We mentioned in this session some
famous file operations that we can apply to a file. You can now refer to the Python website and explore more examples
where we can use files and practice some more file modes and improve your previous programs.
141
Dr. Mona A. Asiri
142
Aim
The data visualization chapter focuses on visualizing the data using different tools and
applications. The student will be able to present different types of data to be much clearer
and more understandable. This chapter provides the practical skills that the student can use to
communicate data effectively to various audiences and in a variety of situations
Learning outcomes
Upon successful completion of this chapter, the student will be able to:
Contents
Data dashboards
143
Session Introduction to Data Visualization
Session
144
Goal
Learning objectives
Dear Student
By the end of this Session, you should be able to:
1 2 3 4
Be prepared
In this session, you will learn what data visualization is, why data visualization is important, and how data visualization can
change people’s way of thinking.
List of Terms
145
Session Introduction to Data Visualization
The map showed the distribution of the affected buildings – buildings where one or more people had died of cholera. When
the data were laid out on the map, it was relatively easy to trace the outbreak to a specific point: a water pump on Broad
Street.
Snow publicized his Ghost Map, and this time, people listened. The Broad Street pump was shut down, and the number of
cases of cholera decreased until the outbreak eventually ended.
John Snow’s decision to visualize the data he’d collected on cholera deaths became a significant step toward solving the
mystery of London’s terrifying Ghost.
I hope by now you are getting a sense of why visualizing data is such an important part of solving a problem or communicat-
ing a message.
146
Learn
Before learning about data visualization, we need to understand what data is.
What is data?
Data is a collection of information. It could be in a variety of forms, such as numbers, text, figures, analysis, statistics,
observations, and facts based on some existing information.
What we see is data. Data includes the things we know, facts, stories, closely interrelated concepts. Data includes all
information about any organization or individual: the number of employees in an organization, sales reports, investment
performance, profit and loss, etc.
Types of data
There are two main types of data.
You see data visualization around you almost every day. Common The human brain processes images
examples of visuals are a Google map, Riyadh’s train map, the
scale-style speedometer, and many of the signs and visual 60,000
instructions you pass on the street. times faster than text.
147
Session Introduction to Data Visualization
Data visualization helps you to explain the relationships among the data in an easier
way. We live in a fast-paced world in which our leaders, our managers, and we,
ourselves, are often faced with the need to make quick and accurate decisions. With
the flood of information available to us, the process of reviewing all the relevant data
seems impossible. However, reviewing charts, figures, and graphs that show the
patterns, trends, and relationships inherent in that data decreases the time and
effort it takes to make sound decisions.
Illustrate concepts
Show company goals and future plans Important simplify complex data would be better
aspects
of data
visualization
Convince your audience Convey a message
148
Figure 3: The process of exploration.
Figure 3 shows the process of finding the story in an exploratory
data visualization. The process starts by carefully examining the
visual and formulating questions about what you see. Then you
examine the visual again to explore answers to those questions
or to find relationships or trends.
By this point, it should be clear to you that the significance of data visualization lies in:
It is worth mentioning that the focus of this chapter will be on explanatory visualization. Hence, in the following sessions,
you will learn how to visualize your data using some tools and software to communicate a story and answer questions for
your audience effectively and in a visually appealing manner.
149
Session Introduction to Data Visualization
Create a narrative
“Don’t show your data, tell a story.” —Chris Dutton
To tell a story effectively through visual aids, you should know your audience as well as the message you want them to get
from your data visualization. Maybe your audience is a group of professionals who need to get a sense of how their business
or organization is performing so they can make important decisions. In this situation, the data visualization might focus on
presenting the changes to their market value over time or comparing earnings over two periods or the performance of two
products. Or maybe you want to communicate a general message about your latest assignment to non-specialists – in that
case, you might choose a visual that is very direct and contains fewer details. Thus, the storytelling changes according to
who the audience is, what they already know about the topic, and the level of information you want your data visualization
to convey.
The next sessions talk about how you can effectively visualize your data using the concepts we learned in this session.
First, you will learn how you can present your numerical data using different types of charts. Then, you will learn about
presenting non-numerical data. Finally, you will learn how to pull everything together to create your own dashboard that
tells your story in an effective way.
150
Apply
The Best Stats You've Ever Seen | Hans Rosling | TED Talks
Activity
a - What makes the presentation so attractive in your opinion?
1 b - What is the tool used in the presentation?
c - What is the type of data in the presentation?
c - Time, weight, height, and amount are examples of numerical data. ( ) True
( ) False
( ) True
d - Data visualization is a method used to display data in graphic format. ( ) False
Closing
Data Visualization
what is data? What is data visualization? What makes data visualization successful?
151
3 Session Visualization of Numerical Data
Session
152
Goal
Learning objectives
Dear Student
By the end of this Session, you should be able to:
1 2 3 4
Be prepared
As mentioned in the first session of this chapter, we will learn in sequence how to
visually represent numerical and non-numerical data. This session focuses on
numerical data, and we will learn how to use different types of charts to represent
a given set of data.
With your group, considering what you have learned about a successful data
visualization, examine the two charts below for the same data and answer the
following questions:
153
3 Session Visualization of Numerical Data
List of Terms
Chart A graph or diagram that represents quantitative or qualitative data such as bar chart and pie chart
Data preparation The process of adding, deleting, calculating, or reorganizing the data before using it in a chart
Band chart A line chart combined with background shades
A chart that presents the cumulative effects of either positive or negative contribution to
Waterfall chart reach the net value
154
Learn
Assigning data to the wrong chart type affects the story and the message that you want to
deliver. However, how you can choose a suitable chart type to present your data effectively? The
answer is mostly based on the purpose of presenting the data and the message that you want
your audience to get from your data visualization. The next table shows a classification of some
types of charts, based on the purpose which they serve.
The purpose
Of course, this table does not cover all purposes or types of charts. However, it gives you an idea about how some charts
can serve specific purposes more than others, although some charts can serve several purposes perfectly.
In general, classifications of the types of charts based on their purpose are not sharply divided, because you can find a chart
that can serve more than one purpose. Thus, if you have a good sense of your data and you know exactly what message
you want your audience to get, you can pick a suitable chart easily.
1 Bar chart
A bar chart is a chart which represents categorical
data with bars with height or length proportional to
the values. It shows comparisons among discrete
categories. For example, the following chart shows
the elderly (65 years and above) population in the
year 2017 in Saudi Arabia for 6 different cities.
155
3 Session Visualization of Numerical Data
2 Bullet chart
A bullet chart or bullet graph features a single measure, which
compares to one or more measures, and displays it in the context
of qualitative ranges of performance. A bullet chart or graph is like
a traditional thermometer. It displays data value encoded by the
length of the main bar in the middle of the chart. Mostly, it
displays information as excellent, good, or poor. It conveys a lot of
information in a compact space.
3 Heat map
b Composition
1 Pie chart
A pie chart is a circular statistical graphic that is divided into slices
to illustrate numerical proportion. One of the most popular chart
a
types, pie charts are widely used in the business world and the
mass media. Pie charts are best used for making part-to-whole
comparisons with discrete or continuous data. For example, the
following pie chart shows data about smokers in 6 different
regions for the year 2017.
2 Pareto chart
A Pareto chart is a type of chart that contains both bars and a line
graph. The vertical bar represents the frequency of individual
a
values and the line represents a cumulative total. The Pareto
chart is useful for analyzing what problems need attention first. It
is based on the Pareto principle, which states that in a given
situation, 80 percent of the effects come from 20 percent of the
causes. (It is also known as 80/20 rule.)
156
c Distribution
1 Histogram
A histogram shows you an accurate distribution of continuous
data. A histogram chart resembles a bar chart, but it actually
differs from it. In a histogram, data values are distributed into
bins, which are represented as columns.
2 Boxplot
d Evolution
1 Line chart
A line chart is a type of chart that displays information as a series
of data points connected by a straight line segments. Line charts
are used to show time series relationships with continuous data.
They are most often used to visualize data that changes over
time. For example, the following line chart shows the statistics of
water consumption in 3 big cities for the period of 8 years from
2009 to 2016.
2 Step chart
A step chart is used display changes that occur at irregular
intervals. The step chart shows the trend as well as the time of
the change. It is an extended version of a line chart, but it does
not use the shortest distance to connect two data points; it uses
vertical and horizontal lines to connect, which makes a step-like
progress. The following example shows the change in price of an
item over a period of time.
157
3 Session Visualization of Numerical Data
e Relationship
1 Scatter plot
2 Bubble chart
A bubble chart displays three dimensions of data. It shows
relationship between data in 3 numeric dimensions: x-axis data,
y-axis data, and the size of bubble. It is used to compare and
display relationships between categorized circles. It is like a
scatter plot with the exception of the third variable. Following is
a sample bubble chart.
There are many tools and software programs to create charts, for example Tableau, Power BI, and Microsoft
Excel. In the following sections, you will learn how to create band and waterfall charts using Excel. Excel has
been chosen since it is the most powerful and flexible software to create charts, especially for average users.
Band chart
A band chart is basically a line chart combining with background shades that represent the upper and lower boundaries of
the data. The purpose of using the band chart is representing data during a period against specific intervals. For example,
you want to show, track, or monitor the performance of two companies during a period against percentage intervals.
158
2 Thus, you have to add three columns to show the three intervals:
Month Com.1 Com.2 Low (<50%) Medium (50% - 80%) High (>80%)
Apr-15 86.4% 63.0% 50% 30% 20%
May-15 45.8% 58.9% 50% 30% 20%
Jun-15 44.1% 81.6% 50% 30% 20%
Jul-15 77.6% 86.1% 50% 30% 20%
Aug-15 80.7% 95.0% 50% 30% 20%
Sep-15 83.7% 78.2% 50% 30% 20%
Oct-15 78.8% 98.9% 50% 30% 20%
Nov-15 76.0% 88.3% 50% 30% 20%
Dec-15 79.0% 75.5% 50% 30% 20%
Jan-16 77.0% 72.1% 50% 30% 20%
Feb-16 67.1% 93.1% 50% 30% 20%
Mar-16 45.8% 95.7% 50% 30% 20%
The value in the Low column represents the band from 0% – 50%
The value in the Medium column represents the band from 50% – 80%
The value in the high column represents the band from 80% – 100%
You will get the value of the bands by subtracting the lower percentage from the higher one.
By now, your data is ready to create the band chart.
4 Change the chart type for the data series Com. 1, Com. 2, Low, Medium, and High as follows:
Line with Markers for the Com. 1 series and Com. 2 series.
Stacked Column for the series Low, Medium, and High.
159
3 Session Visualization of Numerical Data
Click on any column, then, in the format data As a result, you will get bands rather than columns. Here is
5 series pane, change the gap width to 0%. your final band chart
By looking at the band chart now, it is easy and quick to track the performance of the two companies — when the companies
are performing well and when they need to improve.
Waterfall chart
A waterfall chart is used to show how an initial
value is increased and decreased by a series of
intermediate values, leading to a final value. It is
also called a flying brick or Mario chart.
The waterfall chart is commonly used in financial
departments of small to large businesses. It gains
its popularity from its feature of presenting the
cumulative effects of either positive or negative
contributions to reach the net value.
160
You can use the waterfall chart for quantitative analysis, such as inventory or performance analysis, and also for contract
tracking, which helps the stakeholders to make the right decisions about finishing some contracts or investing more in
others.
Thus, if you have start value and end value and you want to show how the changes occur to move from the start to the end
value, the waterfall will be the perfect choice.
To present your given data using a waterfall chart, you have to prepare it as follows: 80000 Start
-5003 Apr
1 Make sure that the month column is on the right, because you do not want to include
-16700 May
the net cash flow column when you select your data to create the waterfall chart.
48802 Jun
2 Add two columns to represent the negative and positive contributions. -11195
-35260
Jul
Aug
3 Add two columns to represent the start and end values in the net cash flow; they will 18220
-23840
Sep
Oct
be the first and last columns in the waterfall chart.
43250 Nov
4 Add another column to represent the float column in the middle. -18280 Dec
26670 Jan
5 Now you are ready to insert the formulas in your column to calculate the values, as 15000 Feb
shown in the table below. 24750 Mar
You may notice that there are top and bottom rows with the value 50000 in the float column. This is a random value just
to save a space to the right and left sides of the waterfall chart.
161
3 Session Visualization of Numerical Data
By doing these steps, you are ready to create the waterfall chart.
Create the waterfall chart You will get a chart like this chart:
The waterfall chart is basically a customized stacked
chart. You can create it by following these steps:
162
Apply
1 https://www.data-to-viz.com
Then, in pairs, answer the following questions:
a) What is the criterion to choose the most appropriate chart to represent numeric data?
b) How many categories of charts are used to represent numeric data, and what are they?
2 a) A __________ chart is basically a line chart combined with background shades that represent the upper
and lower boundaries of the data.
b) The __________ chart is commonly used in financial departments of small to large businesses.
c) A __________ is a circular statistical graphic, which is divided into slices to illustrate numerical proportion.
d) A __________ resembles a bar chart but differs from it.
e) A __________ is a graphical representation of data that displays values in a matrix and differentiates
them by colors.
Activity a) Assigning the data to the wrong chart does not affect the story and the message ( ) True
3 that you want to deliver. ( ) False
b) The purpose of using the band chart is representing data during a period against ( ) True
specific intervals. ( ) False
Closing
163
Session Visualizing Non-Numerical Data
Session
164
Goal
Learning objectives
Dear Student
By the end of this Session, you should be able to:
1 2 3 4
Be prepared
165
Session Visualizing Non-Numerical Data
In groups, try to convert the following table of an organizational hierarchy into another
visual form to make it easier to understand and present.
List of Terms
Term Explanation
Diagram A visual illustration of a group of concepts and the relationships between them
Visualization technique A method to represent data considering the purpose of the visualization
Word cloud A group of words of different sizes placed together into a cloud shape
Tree diagram A visualization technique that has a start, root, or parent node, with branches
emanating from it
166
Learn
When we talk about non-numerical or categorical data, this does not mean they
cannot be numbers. However, the numbers in non-numerical data do not have
any mathematical value, and mathematical operations cannot be performed on
these numbers. For example, if you collect data for a survey that needs the
gender of a client, you can make the task easier by assigning the number “1” as a
code for men and the number “2” as a code for women. The numbers “1” and “2”
here do not have any mathematical meaning, and you cannot add them.
Most non-numerical data can be represented in a diagram. In the next sections, we define a diagram and describe the most
common visualization techniques to draw diagrams.
What is a diagram?
A diagram is a visual illustration of a group of concepts and the relationships between them. Diagrams are mostly used to
represent non-numerical or qualitative data. Diagrams are used to convert qualitative data into visual representations to
make information clearer, simpler, and easier to understand and remember. Diagrams can use different visualization
techniques according to their purpose and the types of concepts and relationships that you want to show. You can see
diagrams around you everywhere, in educational settings such as in books, posters, or presentations, and in business
settings such as in organizational hierarchies or process maps for task completion.
167
Session Visualizing Non-Numerical Data
The next section shows how to choose the right diagram to represent your data.
Example of
Diagramming purpose diagramming technique
Brainstorm: create, include, and comprehend ideas about a topic Mind map
Identify defects: analyze the causes of a problem to correct the defect Fishbone diagram
Demonstrate relationships: show the connections between concepts or people Tree diagram
Compare: show similarities and differences between two or more concepts Venn diagram
The next section covers some of the most common visualization techniques for diagrams.
168
Common types of visualization techniques for diagrams
Mostly, only words are counted in non-numerical data; thus, most visualization techniques for this type
of data are about words or concepts and the relationships between them. The most common visualization
techniques for non-numerical data are the following.
Word clouds
A tree diagram is a visualization technique that has a start, root, or parent node, with branches emanating
from it. Each branch leads to a new node, and so on. Tree diagrams are used to make strategic decisions or
valuation calculations, or simply to show a classification, as each branch represents a mutually exclusive
decision. Each new node is created at a new level, and you continue moving to lower levels until you reach
the end, leaf, or child node with a concluding decision.
computer components
169
Session Visualizing Non-Numerical Data
Flowcharts
As described in chapter two, flowcharts are a visualization technique to represent algorithms and
processes. As algorithms contain series of computational operations to solve a problem, they can be hard
to understand and track within a text description. A flowchart’s role is to convert the algorithm into an
easy-to-understand-and-track diagram. Flowcharts use different shapes and connections. Each shape
represents a different type of operation, and each arrowhead connector represents the direction of the
steps. There are two main types of flowcharts: program flowcharts represent a single problem unit to
achieve a result, and system flowcharts represent multiple problem units interacting to achieve a goal.
Start
PRINT AVG
Stop
JPEG
Venn diagrams GIF
Venn diagrams are also known as set diagrams because
Smaller
each collection of entities represents a set. In Venn Limited File Size
diagrams, each set is drawn within a circle, and if two Loosy,
Color Palette No Transparency
sets intersect, it means that one or more entities occur
in both sets. The entities outside the intersection area WEB
represent the differences between sets.
Lossless,
SAFE
Large
Transparency
Color Palette
Larger
File Size
PNG
THE DIFFERENCES AND SIMILARITIES AMONG THREE TYPES OF IMAGES
170
Venn diagrams are also used in mathematics to represent possible logical relationships between sets.
A B A B
A B A B
A B A B
A B A B
Dia is a diagramming application that can be used to make a large variety of diagrams. Dia is easy to learn
and flexible enough to allow power users to create highly customized diagrams. It has many excellent
features, such as the following:
1 Dia is free
171
Session Visualizing Non-Numerical Data
Interface of Dia
1 4
As you can see, the main interface of the Dia application is simple and easy to explore.
1 Ribbon
The ribbon has all the commands you need to deal with the file, canvas, and objects. The ribbon has several
tabs, and each tab includes a group of commands.
File tab: Includes commands that deal with files, such as new, open, save and export
Edit tab: Includes commands such as do, undo, copy, cut, and paste
View tab: Includes commands concerned with the appearance of the canvas
Layers tab: Allows you to distribute objects into multiple layers on your canvas
Allows you to control objects in ways such as send them back, bring them
Objects tab:
forward, or group them together
Tools tab: Includes all control tools in the toolbox, such as modify, text edit, and magnify
172
2 Toolbox
3 Canvas The canvas is where all the objects and diagrams are placed. You control
the properties of the canvas in the View tab.
4 Rulers The rulers allow you to align objects on the canvas and know how big the objects and canvas
are. There are both a horizontal and a vertical ruler.
Start
How to create a flowchart? A represents the first number
INPUT A,B B represents the second number
As you learned in chapter 2, you can draw a
flowchart using several shapes. Each shape
represents a specific action. For example, the S (A+B ) S represents the sum
oval shape is used to represent the start and
the end of an algorithm. AVG S/2 AVG represents the average
Stop
173
Session Visualizing Non-Numerical Data
Once you select the flowchart sheet, you will see all the objects that
relate to flowchart diagrams.
2 Select the circle shape to represent the first step in the algorithm, “Start,” and draw an oval shape
on the canvas. Then click on the text edit tool to write “Start” inside the shape.
174
Select the input/output shape from the objects and draw the shape for the input of the two
3 numbers. Then click on the text edit tool to write “INPUT A, B” inside the shape.
4 To connect the two shapes, select the line from the toolbox and draw an arrow between the two
shapes. If the line connects to the edge of the shape correctly, the shape will be highlighted in red.
You can then control the style of the beginning and end of the
arrow from the tools at the bottom of the toolbox.
175
Session Visualizing Non-Numerical Data
Apply
Activity
1 Now try to re-represent Table 1, using a suitable diagram in Dia.
Activity
2 Re-draw the network types (PAN, LAN, MAN, and WAN) from chapter 4 by using the
network sheet in Dia.
Activity
3 With your friend, use any search engine to find more diagrams to visualize non-nu-
meric data, other than the ones you have learned about in this session.
Activity
4
Choose TRUE or FALSE for the following statements.
a) The visualization technique depends on the purpose of the data visualization and
the type of the concepts.
( ) True ( ) False
c) The size of the word in a word cloud represents the importance of that word in
the text.
( ) True ( ) False
d) The intersection area in a Venn diagram shows the common entities between
two sets.
( ) True ( ) False
176
Closing
177
Session Data Dashboards
Session
Data Dashboards
178
Goal
Learning objectives
Dear Student
By the end of this Session, you should be able to:
1 2 3 4 5
179
Session Data Dashboards
Be prepared
For a long time, people relied on spreadsheet software not just to process
numbers and do calculations, but also to represent numbers in a visual format.
Nowadays, with the rapid growth of data sources, spreadsheet software is no
longer adequate. The dashboard is a powerful tool in the business intelligence field
that fills this gap. The idea of a dashboard itself is not new; however, dashboard
features and their ability to be more interactive have evolved and are now key to
their success. In this session, you will learn about the different types of
dashboards, how to design dashboards to answer specific questions or measure
specific key performance indicators (KPIs), and how to create a dashboard using
Tableau software.
List of Terms
Term Explanation
KPI (Key Performance A measurable value that indicates a company’s progress towards its goals
Indicator)
Metric A quantifiable and measurable unit within a KPI that tracks processes
A single visual display combining data from several sources to track the business
Dashboard
KPIs, metrics, and key data points
SaaS (Software as a A strategic dashboard mostly viewed once a day by executives to monitor their
Service) business performance
MRR (Monthly Renewal An analytical dashboard mostly used in the accounting department to predict the
Rate) new trends
180
Learn
181
Session Data Dashboards
Characteristics of Dashboards
Customizable
There are several types of dashboards, including operational, strategic, and analytical
dashboards. The differences among these three types depend on the type of information
and level of detail in the dashboard report. As a result, each dashboard type targets
different teams and different business departments. In this section, we will learn about
dashboard types, what type of information each contains, and which teams will benefit
from each type of dashboard.
All-in-one
By using the dashboard tool, you can represent all data analysis in one place. This gives
a valuable advantage over the old-fashioned method of reviewing huge reports to
reach conclusions.
182
Level of detail
Having everything at a glance does not mean you are limited to shallow data at all. You
can drill into details and show as much information as you need in a dashboard by
including the required objects and variables.
Accessibility
In an era of speed and competitiveness, especially in business sectors, accessibility to
data matters. A crucial advantage of dashboards is that they are accessible from
anywhere and at any time, even on mobile devices.
Types of dashboards
There are several types of dashboards, including operational, strategic, and analytical dashboards. The
differences among these three types depend on the type of information and level of detail in the
dashboard report. As a result, each dashboard type targets different teams and different business
departments. In this section, we will learn about dashboard types, what type of information each
contains, and which teams will benefit from each type of dashboard.
183
Session Data Dashboards
The analytical dashboard could be either an operational dashboard or a strategic dashboard. However, it
has drill-down functionality, which allows the analysis of large amounts of data to discover new insights,
view trends, or predict conclusions. The analytical dashboard is the most common type of dashboard
because the designer and developer of the analytical dashboard is a data analyst. Analytical dashboards
need accurate and up-to-date data to provide accurate predictions. However, the data is not updated
very frequently. The MRR (Monthly Renewal Rate) dashboard, which is mostly used in the Accounting
department, is an example of an analytical dashboard.
184
Designing the dashboard
Designing a dashboard is an art. While designing dashboards, keep in mind that you are communicating
important and large amounts of data which need to be readable at a glance.
Know your data well to transfer it into a meaningful and informative dashboard.
First, think about your audience. Successful dashboards target a specific team in
the business. Once you know who your target team is, it will be easy to pick the
data that is most useful to them and that they really need to know. For example,
if the executive managers of the business are your audience, then your data
should provide a good overview of business performance by choosing KPIs and
metrics such as periodic revenue or cost comparisons.
Next, you will need to decide which dashboard type is most appropriate to
represent the selected data to your audience. As we discussed in the
previous section, there are three main types of dashboards: operational
dashboards, strategic dashboards, and analytical dashboards. Each type
is designed to represent specific data to specific teams in the business.
For example, if you want to represent data from everyday operations
such as website monitoring, or sales data such as the number of calls or
appointments, then the operational dashboard would be your best choice.
When you have different groups of data in your dashboard, pay attention
to their logical order. For example, part of your data may be related to
marketing, while another part is related to sales. Make sure that the
marketing data is grouped and ordered logically and that the same
approach is taken with the sales data. Additionally, you need to use the
space on the dashboard effectively. For example, do not save the top left
corner of your dashboard for the business logo. The top left corner is the
first space in your dashboard that attracts the attention of western
language speakers, as their languages are read from top to bottom and
from left to right. Thus, keep this space for an important piece of data.
185
Session Data Dashboards
This rule depends on the size of the business. For a small business, you may
choose to create a single strategic dashboard for the executive manager and
the heads of departments. In this case, the dashboard contains several KPIs
for different departments. Each person in the audience will find the required
data for his department. For a large business, the situation is different. Each
department will have a separate dashboard with their required data. In either
situation, if you have a mixed audience, make sure that you identify the data
requirements for each group while keeping in mind the scope of the whole
business, each department, and each individual.
The rule here is simple and easy to follow. Include in your dashboard just the relevant and
important data. Do not include items just because you can, or to fill a space. Irrelevant and
unnecessary data would distract the attention of your audience from the important
message that you want to convey. There is no golden rule to the amount of data you should
include on a dashboard; however, you can figure out what important data to include by
identifying your audience and their data requirements.
Deciding how often you will need to refresh the data on the dashboard before actual
development will save you time and effort while designing the dashboard and sourcing the
required data. The type of dashboard could help in this matter. For example, if you intend to
design an operational dashboard, you need real-time data, so the data refresh rate will be
quite high. However, a strategic dashboard needs less frequent data refresh.
Why Tableau?
Tableau has been trusted by more than 50,000 users around the world for many reasons.
1 Tableau is an easy tool that is both fast to learn and to apply. You do not need to code anything, as any
function can be applied by drag-and-drop features. In addition, there are many built-in features that allow
you to manipulate data easily, such as table calculations and connection to programming languages such as
R and Python.
2 Tableau can connect to more than 40 types of data sources. These include file-based data sources such as
Excel or CSV files, relational databases such as Teradata or SQL Server, and cloud-based data sources
such as Google Analytics.
186
3 Tableau allows users to create a dashboard that is automatically updated when the source data is refreshed.
This feature allows the user to share real-time data with teams who need minute-by-minute updated data,
such as the marketing team.
Tableau has strong community support, represented by the Tableau community, Tableau bloggers, and many
4 online training courses. These rich resources provide inspiration and solutions for many issues, from selecting
the most appropriate version of Tableau to the most advanced design issues.
Tableau offers several products to meet different needs. These products are Tableau Desktop (Personal),
5 Tableau Desktop (Professional), Tableau Server, Tableau Reader, Tableau Public, and Tableau Online. To
choose the most appropriate product for your needs, you must understand four terms:
Automation the ability of the product to update the dashboard based on refresh rates of the data sources
Security the level of security (on- or off-premise) that the product provides
The table below compares the different Tableau products against the features of connectivity, distribution,
automation, and security. This table is adopted from the book Practical Tableau: 100 Tips, Tutorials, and Strategies
from a Tableau Zen Master by Ryan Sleeper, 2018.
Tableau Features
products
Connectivity Distribution Automation Security
- Excel
- Text files
- Access Statistical files - Offline or Depends on your
Desktop - Tableau Public Not available computer/
- Shape files
(Personal) server security
- Spatial files
- Tableau files
All possible
All possible Depends on your
Desktop distribution
connections in Not available computer/
(Professional) options in
Tableau server security
Tableau
Depends on your
Tableau
.twbx files only Offline Not available computer/
Reader
server security
187
Session Data Dashboards
We will work with Tableau Public as our product of choice in the next practical section.
188
Drag the sheet “Orders” to the upper empty space of the screen. You will get this screen:
You will notice a difference between the first few rows in the Tableau sheet and the Excel sheet. However,
we can fix this by using the Tableau Data Interpreter.
Data Interpreter
189
Session Data Dashboards
Click on the Data Interpreter option to get the following cleaned data:
Data visualizations
Once you have imported the dataset, you will have a “Go to Worksheet” option at the bottom left of
the screen:
190
Click on Sheet1 to move to the following screen, where you will develop all the graphs:
Before we go any further, we should explain some terms in the graph screen.
Dimensions Dimensions are fields that represent the headings of rows or columns. These fields mostly contain
a string of discrete values, which cannot be aggregated. An example of a dimension is city name.
Measures
Unlike dimensions, measures represent fields that contain numerical or continuous values. Thus,
you can aggregate and measure the values. Example of measures are sales or profits.
Shelves
Pages shelf
Filters shelf
Marks shelf
191
Session Data Dashboards
If you intend to draw a chart in Tableau, the rows and columns shelf represents your x
Rows and Columns shelf
and y chart axes.
The pages shelf allows you to see dynamic changes in the data by shifting from page to
Pages shelf page to represent changes in data values between pages.
The filters shelf allows you to see the part of the data that you are interested in. For
Filters shelf example, if you are interested in the profit of each branch rather than the total profit of
the whole company, you would use this shelf.
The marks shelf allows you to annotate your data. For example, you may choose to
Marks shelf
represent your data using different shapes or sizes.
Show me
Show me is one of the most important features in Tableau. Once you drag and drop your dimensions
and measures, Tableau will create a default graph according to the number and type of dimensions and
measures. However, you can change the graph type using the Show me pane.
To create a map chart, you first need to make sure that the geographic role of Administrative region is State/Province.
Then drag Administrative region (locations) onto the empty space in the middle of the screen.
192
If Tableau does not recognize the location of the Administrative regions on the map, you will get this screen:
You can fix the unknown locations by clicking on the “unknown” icon in the bottom right corner of the screen and choosing the
first option, “Edit Locations”:
Enter the name of the country “Saudi Arabia” in the dialog box, then click OK:
193
Session Data Dashboards
Now you will get a map of Saudi Arabia with small circles on it:
Next, drag Profit in the same way as you did Administrative regions. You will notice that the circle sizes change to reflect the
difference between the profits of the different administrative regions. This map is called a symbol map.
Now we will convert the symbol map to a map of the administrative regions colored in different shades to
represent the different profit values.
From the Show me pane, select Map.
Now drag Profit again, but this time you need to drag Profit onto the Label icon in the Marks pane. Then
you will get the following screen:
194
Create a new worksheet
To create another graph, you need to open a new worksheet by clicking on the bottom left corner:
You will get the following screen. Rename this worksheet to “Bar chart”.
Now let’s create a bar chart to represent the product subcategory sales in the new workbook. To do this:
Drag Sub-Category to the row shelf.
Drag Profit to the column shelf.
Then, from the Show me pane, choose Horizontal Bars to get the following screen:
195
Session Data Dashboards
To add some customization to the bar chart, drag Sales to the Color icon in the Mark shelf.
Then, drag Sales onto the row shelf and Profit onto the column shelf. At this stage, you will see one small
circle that represents the total sales and profits for all administrative regions.
To represent sales and profit for each administrative region, drag Administrative regions onto the
current graph. The single circle will now scatter into multiple circles representing the different
administrative regions.
196
Now drag Administrative regions again, but this time onto the Label icon in the Marks pane to label each
circle on the scatter plot graph:
To create your dashboard, you need to combine all your graphs and charts to convey a message. To do
this, follow the following steps.
Click on the window symbol at the bottom of the screen to create a new dashboard.
197
Session Data Dashboards
The left side of the screen will now display a list of all the sheets that you have created so far. You can
combine any of these sheets to create a dashboard. In this example, we will drag all three sheets to the
empty area in the middle of the screen to create the following dashboard:
After creating your own dashboard, you can still change the position of the graphs and charts until you
get the desired visualization.
Furthermore, any changes you make in the worksheets after you have created the dashboard will still be
reflected in the dashboard.
Once you have created your dashboard, it is a good idea to add a filter to one of the charts so that you can
see the sales and profit of one administrative region at a time. To do this:
Click on the small arrow on the right of the graph that you want to convert to a filter. From the drop-down
menu, choose the Use as Filter option.
198
For example, if you apply the filter option to the map graph, you will get the following visualization:
199
Session Data Dashboards
Apply
Activity
1 Visit the following website for more online training and videos:
https://www.tableau.com/learn
Activity Fill in the blanks with the appropriate words provided below.
b) The operational dashboard quickly and frequently changes its data; it is a) True
updated from one minute to the next. b) False
a) True
d) Dashboards can display large amounts of data which are readable at a glance.
b) False
e) It is not necessary to choose the right dashboard type for the selected data. a) True
b) False
200
Closing
201
Dr. Amani k. Samha
202
Aim
The main aim of data communication and networking is to enable continuous exchange of
data between any two points in the world. This exchange of data takes place over a computer
network. This chapter introduces basic concepts such as data, information, communication, and
computer networks. It describes how different data is communicated via computer networks.
Then it discusses how the data is stored in different storage units, how the data is protected and
backed up, and finally how the data is restored, along with an illustration of the best practices.
Learning outcomes
Upon successful completion of this chapter, the student will be able to:
Contents
Data Storage
Data Backup
Data Restore
203
Session Overview of Data Communication and Network
Session
204
Goal
Learning objective
Dear Student
By the end of this Session, you should be able to:
1 2 3 4 5 6 7 8 9 10
List and distinguish Understand the List the benefits Explain the
List the characteristics
between different components of a data of computer components
of data communication.
data types. communication system. networks. of a network.
Be prepared
Networks are popular these days; it is hard to do anything with data without a network. Two or more computers connected
to share resources (a printer, for example) are called a computer network. Networks are designed to exchange files and
share resources between different users and uses, allowing businesses to expand, grow, and save money. To use computer
networks efficiently, users need to understand what data to share and how to transfer that data as useful information.
This session introduces the topic of data communication—how data is exchanged and sent from one place to another via a
network. Networking is the process of communicating data remotely through connected devices and media. This session is
structured to introduce the main concepts of data communication and networking, and to illustrate different types of data
and its flow from one point to another.
Prerequisites
Before starting this session, you should know the basic concepts of a computer, the internet, and operating systems.
205
Session Overview of Data Communication and Network
List of Terms
The rules or process that specify what is communicated and how it is communicated;
Protocol
acts like a translator
Simplex Sender transmits the data; the other device acts as a receiver only
Half-duplex Each device can transmit and receive the information, but not at the same time
Full-duplex The sender and receiver devices can transmit and receive the information,
simultaneously
The variance in the arrival time of the data packets in milliseconds (ms) over a
Jitter
communication network
Network Interface Card Electronic device (card), which allows a connection to the network
Operating System Software needed on client and server computers to communicate over the network
Hub Hardware device that splits the network connection and distributes it to multiple
computers
Router Hardware device used to share a single internet connection to multiple computers
Ethernet Cable Network cable used to connect different devices to the internet
206
Learn
Data is defined as a collection of raw facts, figures, or statistics, which are collected and processed
to deduce information, which in turn is used to make decisions. The raw facts (or factual information)
and statistics are first represented in the computer as quantities, characters, or symbols; any
necessary operations are then performed, and the output is stored and transmitted in the form of
electronic signals and finally recorded on a media device.
For example
some companies obtain people’s opinions by collecting data via distributed surveys. This data is collected, in whatever form
the people provide it, and the data needs to be summarized into reports to be presented to management (decision makers).
The managers then make important decisions based on the data collected through surveys and the reports prepared from
the data.The following figure illustrates the process, from data transmission to information.
Types of Data
Data comes in different forms that a computer can take as input and then process to produce information as output.
Text
Text is a sequence of alphabetic and other characters, each of which LETTER ASCII CODE BINARY
is represented as a binary bit pattern (0’s and 1’s) or a code. It 107
k 01101011
includes combinations of alphabets, both lowercase and uppercase. K 075 01001011
These are stored and populated using an encoding system called s 115 01110011
“ASCII” (American Standard Code for Information Interchange). S 083 01010011
Each text symbol is a different bit pattern, and each character u 117 01110101
occupies one byte (which is eight bits) that is made up of numbers. U 085 01010101
For example:
the abbreviation for King Saud University is “KSU” and the codes representing it are in the following table.
Numbers
Numbers include all combinations of digits from 0 to 9. Numbers are also represented by bit patterns. However,
numbers do not use the ASCII table, because they are directly converted to binary numbers, to simplify mathe-
matical operations.
Images
Images are also represented by bit patterns. An image is composed of pixels, where each pixel is a small dot. Its
size depends mainly on the image resolution—the higher the resolution, the more memory the image occupies.
207
Session Overview of Data Communication and Network
Audio
Audio refers to sound or music. It is different from the previous data types because it is not discrete, but
continuous.
Video
Video refers to a continuous data that is being broadcast or recorded, as a combination of audio, such as sound
or music, and a sequence of images. For example, output from a TV camera.
After we discuss data and its types, the following section will show how the different types of data are communicated.
ENCODE DECODE
RULE 4.. RULE 1..
RULE 5.. RULE 2..
RULE 6.. MESSAGE RULE 3..
SENDER RECEIVER
SOURCE HOST
2 - Receiver
The receiver is a device that can receive a sent message. It can be a computer, workstation, telephone handset, television, printer,
fax machine, or any other computer-related device. The receiver must be capable of accepting the message.
208
3 - Transmission medium
The transmission medium is the physical path that connects the sender with the receiver, which is used to transmit data between
the sender and receiver. It can be wires, such as twisted-pair, hub, cables, or optical fiber, or it can be wireless, such as microwaves
and radio waves.
4 - Message
The message is the actual data or information to be communicated between the sender and receiver. The message may include all
data types. Some data will be converted, depending on its type. For example, text is converted into binary, and images into pixels,
whereas the other types will be sent as it is.
5 - Protocol
When two devices establish a connection, no communication can be accomplished without an agreement on the rules that will be
followed during this communication. Therefore, when two devices communicate, they need an agreement; this agreement, called a
protocol, is a set of rules that encode and decode messages and govern and control message transmission between computers on
the network.
Data Flow
The data flow describes the direction of the messages sent via a communication channel. The communication between the
sender and receiver devices, no matter what data type is sent, can follow one of the following three data flow modes.
b - Half duplex
In half-duplex communication, each station can transmit and receive, but not at the same time. One station acts as the
sender and sends the message that the other station receives. This mode is used when there is no need to communicate in
both directions at the same time. Once the message has reached the receiver, the receiver can reply to the message.
Examples walkie-talkie, with a “push to talk” button that sends data with no reply needed at the send time.
c - Full duplex
As shown in the figure, full-duplex DIRECTION OF THE DATA ALL THE TIME
communication is when messages can be
transmitted from and received by both
stations/devices simultaneously. STATION 1 STATION 2
Examples the telephone and cell phone networks, where two people can talk and listen on the phone at the same time. It is
used when communication is required all the time.
209
Session Overview of Data Communication and Network
b - Accuracy
The system must guarantee the accuracy of the delivered message. Data that is received is not altered in
transmission.
c - Timeliness
The system must deliver the data in a timely manner; late data delivery is useless. For some data types, timely
delivery means delivering the data as it is produced and in the same order (for example, video and audio). This kind
of delivery is called “real-time transmission.”
d - Jitter
Jitter is the variance in the arrival time of the data packets over the network. For example, when two computers
are communicating, both will transfer data packets. If the network is in good condition, the packets travel at equal
intervals, which allows the receiving computer to process the data. However, if there is a jitter in the intervals, the
process becomes disrupted.
Computer Networks
A computer network is an interconnection of a group of computer systems and other hardware at different locations. Two
or more computers are linked through a “data communication device” and a “medium” to share resources and information.
Facilitate communication
By using a computer network, users can communicate easily and efficiently
via different communication channels. Examples include sending emails,
video conferences, and telephone calls.
Permit sharing
By using a secured network, authorized users can access files (data and
information) that are stored on any computer within the network.
Network Benefits
File sharing
By using a computer network, files can be shared between computers, which gives users flexibility to access
files remotely. Shared files can include photos, music, and documents. Users can use a home network to save
copies of important data on different computers, as well as to keep backup copies that can be retrieved when
needed..
210
Resource sharing
Using a computer network allows resources, which include software and hardware, to share peripheral
devices, such as printers, faxes, scanners, and copiers. It also allows sharing of software between multiple
users. For example, a small home network can share a single printer between multiple users, as well as sharing
a single copy of software.
Internet sharing
A computer network allows multiple users to use a single internet connection, which is cost-effective.
Multi-player games
A computer network enables friends and family to play together, simply by joining the same network.
Home entertainment
A computer network can be used by family to share home entertainment products, including video-game
consoles such as Nintendo and Xbox. Adding such consoles to the network enables internet gaming and video
sharing.
Categories of networks
Computer networks are categorized by purpose and size, where the size is determined by the number of
computers and the geographic area covered.
HEADSET
PRINTER
TABLET
MOBILE
CAMERA TV
211
Session Overview of Data Communication and Network
DESKTOP CLIENT
INTRNET
FIREWALL
SERVER 1
DESKTOP CLIENT
HUB
ROUTER
SERVER 2
LAPTOP FAX
TABLET MOBILE RINTER
LAN
LAN
INTRNET
212
WAN - Wide Area Network
A computer network used to connect large geographical areas, such as countries. The largest and most well-known such
network is the internet.
LAN
WAN
LAN
CAMPUS (10 meters to 1 km)
PAN Room up to 10 m
213
Session Overview of Data Communication and Network
Network Components
Computer networks consist of several integrated devices, functions, and features, as follows.
Servers
Servers are computers that hold the main applications, files, and network operating system. Servers
enable users to access all network resources, with each server providing several functions:
print server, mail server, file server, application server, database server, and
for example
message server.
File Servers
provide file functions, such as storing and retrieving data, which allow users to read, write, exchange, and manage files.
Print Servers
provide printing functions on a network and can handle fax services.
Application Servers
help to reduce cost by sharing software resources, such as allowing users to share one copy of expensive software.
Database Servers
provide users access to strong, centralized databases.
Clients
Clients are users’ computers that use the network and its resources, requesting and receiving services
from the network.
FILE
SERVER DATABASE
CLIENT SERVER
CLIENT
REMOTE
NETWORK
CLIENT
CLIENT
214
Transmission media
Transmission media are facilities that are used to connect computers, such as twisted-pair
wire, cable, and optical fiber.
Operating system
Every computer needs a local operating system to function, which allows users to access files,
print documents, etc. The network operating system is a second system, which is needed on
both client and server computers to communicate over the network. One example is Microsoft’s
Windows Server.
Hub
A hub is a hardware device that splits the network connection and distributes it to multiple
computers. It works as a center for distributing the connection and can receive multiple
requests and transmit them to the entire network.
Switch
A switch is a hardware device that connects multiple devices together to receive and process
data and to forward it to its destination. The switch works as a control unit in the electronic
circuit (on and off), where it connects network segments.
Router
A router is a device that is used to connect a computer to the internet, share a single internet
connection with multiple computers, and forward data between computers.
Ethernet cable
An ethernet cable is a network wire that is used to connect different devices to the internet or
to other devices on the network, such as printers.
Network applications
Applications are the tools that a computer uses to perform operations. The applications that are run on the computer and
are not connected to other computers are called “stand-alone applications.” Examples include word processors,
web browsers, spreadsheets, and presentation software. They function even if they are offline; for example, a document
written using Microsoft Word 2016 and saved to the computer would have both the program and file stored locally.
In contrast, “network applications” are tools and programs that utilize the internet or another network to perform
useful functions, such as file transfer from one point to another. Network applications use a client-server format, in which
both computers are connected to the network.
A server is programmed to provide services to a client, which can be a desktop, a laptop, or even an iPhone. The server
could be any of these, but it is typically a computer in the data center.
An example of a typical network might be a client computer running a web client program (web browser), such as Firefox,
Google Chrome, or Microsoft Edge, with the server running a web server program like Apache or Microsoft Internet
Information Server. Data can be saved locally on the client or on the server, but it operates over a network rather than on
either individual computer.
215
Session Overview of Data Communication and Network
Apply
Read the following cases and note down your responses in the boxes provided below.
• Make a group of 6 students and discuss the following topics: types of data, data communication system,
Activity data flow, network categories, transmission media.
2 • Based on the above topics, identify:
a - The type of data you send and receive using an E-Mail communication.
b - The communication system you use while chatting with a friend.
c - How the information flows from sender to receiver.
d - Which network category you use while connecting to the network at your home.
e - Which transmission medium you usually use.
a - Protocol
2 - A set of rules that encode and decode the message and that govern and b - Message
control message transmission between computers on a network. c - Sender
d - Receiver
a - Accuracy
3 - The variance in the arrival time of the data packets in milliseconds (ms) b - Timeliness
over the network. c - Jitter
d - Delivery
a - MAN
4 - A computer network that is organized around an individual person b - WAN
within a small area, usually a single building. c - PAN
d - INTERNET
a - Router
5 - A hardware device that splits the network connection and distributes b - Hub
it to multiple computers. c - Network interface card
d - Ethernet cable
216
Closing
Dear student, you have learned the main concepts of data communication and networking,
as shown in the following diagram:
Network Benefits
Network Applications
Network Categories
217
Session Data Storage
Session
Data Storage
218
Goal
Learning objectives
Dear Student
By the end of this Session, you should be able to:
1 2 3 4 5
Be prepared
The ability to store and access data is a vital part of our daily lives. Every day, we interact with countless pieces of data
and information stored across a variety of media, from USB drives to DVDs to the Cloud. The concept of data storage
began more than a century ago, starting with punch cards, which were used to communicate information to equipment
until electronic computers were developed. Punch cards were eventually replaced by magnetic and optical storage
technologies—revolutionary forms of data storage. The amount of data and information is continuously growing, now
measured in terms of gigabytes and terabytes instead of kilobytes and megabytes.
This session introduces data storage units, including local, external, and remote data storage (the Cloud). It then discuss-
es their advantages and disadvantages, lists data storage capacities, and reviews how to compress files and folders in
Windows 10 to reduce costs and to save storage space.
219
Session Data Storage
Prerequisites
Before starting this session, you should have a basic knowledge of different types of data and how to access the internet.
List of Terms
Portable External Hard Drive Magnetic disk drive that is plugged into the computer via a USB
Local Storage Storage devices that are locally embedded with the computer
Random Access Memory, holds the frequently required instructions and data
RAM that the processor is currently working on
HDD Hard Disk Drive, a low-cost, high-capacity permanent physical storage medium
Digital Versatile Disc or Digital Video Disc, optical plastic discs having
DVD
capacities from 4.7 GB to 17 GB
Magnetic Storage A storage method that stores the data in the form of magnetized dots
Flash Drive A pen drive memory unit, data stick, keychain drive, etc.
Memory Card (SD - Secure Digital) A flash memory card that is used to store images, videos, and other digital data
Cloud storage service provided by Google, provides the users with the ability
Google Drive
to share files online with anyone at any time
Online cloud storage service provided by Microsoft; allows you to store files
OneDrive in the cloud and access and share them anytime, anywhere
220
Learn
Data Storage
Data storage refers to the ways of using recording media to store data in a computer or other storage
devices, in digital format. A storage device is an electronic memory device used to store and extract data,
media, and other types of files.
Types of Storage
Data storage can be categorized based on its physical storage units, as follows.
Local Storage
Data stored on storage devices that are locally attached to the computer. For example, hard drives (both internal and
external).
1 - Portable external hard drive
A portable magnetic disk drive that is plugged into the computer via a USB or FireWire cable.
Advantages Disadvantages
Convenient to setup, with plug and play devices Bulky; as they take up much space; typically inconvenient
Compatibility with different operating systems, such as Prone to failure, and can be wiped out by electrical surges
Windows, Linux, and Mac OS
Cost effective; the cheapest storage device option Security issues: not reliable as portable discs
Internal storage
A system component embedded within the computer and used for storing data and programs.
Primary Storage (Primary Memory)
Primary memory is where data and programs are kept on a short-term basis and made accessible to the central processing
unit (CPU). Primary memory is also known as the “main memory” of the computer. It is smaller in size and closely connected
to the processor. It consists of two memories:
221
Session Data Storage
Secondary Storage
These storage devices have large capacities to store data for a long period of time. A hard disk
drive (HDD) is a low-cost, high-capacity physical storage medium that permanently stores the
operating system files, software applications, user’s personal files, etc. Its storage capacity
can range from 120 GB to 4 TB, and the upper limit is gradually increasing. Data is recorded
magnetically onto a hard disk; rapidly spinning platters, which are divided into tracks and
sectors, are used as the recording medium. The electromagnetic heads are placed just above or
below the surface of the platters and are used to read data from, and write data to, the
platter. The hard drive spins thousands of times per minute.
The internal hard drive is considered the main long-term storage device, while external hard
drives and other external media are additional storage devices. Primary and secondary
storage refer specifically to the components inside the computer; RAM and ROM are therefore
considered to be primary storage, while the internal hard drive is secondary storage.
Some of the advantages and disadvantages of HDDs are showed in the following table.
Advantages Disadvantages
Huge storage capacity Damaged hard drive will stop the computer from working
Faster than optical discs like DVDs Slower read and write speed than RAM
File: The file is a piece of information or data that is stored in different storage units, where it can
TIP be made available to computer programs. For example, images, video, sound recordings, PDF files,
and documents are all stored as files. Users use different applications to create, move, modify, and
delete files.
Storing files: Most computers save files to the hard disk, which allows instant access for users.
222
4 - External storage
)
These are the storage devices that are externally connected and controlled by a computer but are not integrated with it.
There are two categories of external storage devices: optical storage and magnetic storage.
i. Optical Storage
An electronic storage method that uses lasers to store and retrieve data. There are three main methods of optical storage.
HD-DVD 20 40 35
ii.Magnetic Storage
A storage method that stores the data in the form of magnetized dots. The following are some magnetic storage devices.
A - Floppy Disk
An older storage device that holds up to 1.44 MB of data. Older computers had a floppy drive to read
data from, and write data to, a floppy disk.
B - Zip Drive
This has the same physical shape and properties as the floppy disk, but a zip drive is needed to read it, and
its capacity is 250 MB.
223
Session Data Storage
C - Flash Drive
An integrated circuit memory chip that is portable and often around the size of a human thumb. They are
sometimes called thumb drives, pen drives, memory units, data sticks, and keychain drives. The physical size
of the memory is becoming very small, and the capacity is expanding and currently ranges from 2 GB to 4 TB.
Following are some advantages and disadvantages of flash drives.
Advantages Disadvantages
D - SD – Secure Digital
A flash memory card is used to store images, videos, and other digital data for electronic devices, such as
digital cameras, MP3 players, printers, cell phones, and game consoles. Capacities range from 4 GB to 128 GB.
Advantages Disadvantages
Portable and can hold large amounts of data Due to its small size, it is more likely to be lost or stolen
• Accessibility: Cloud storage provides easy access to all stored files. However, accessibility is limited to the availability
of an internet connection.
• Space: Cloud storage provides a variety of capacity options. However, users may have to pay annual or monthly fees,
which can sometimes be expensive.
• Security: Security can be an issue, as users can give privileges to other users depending on their role.
224
Advantages Disadvantages
Not affected by disasters such as fire or theft Less control and is more expensive
The example of Cloud storages are not limited to store data but also works to as backups for data, therefore, the examples
will be discussed in session 3 where the storages acts as backups.
2 - Select the option “Compressed (zipped) folder” 3 - Rename the file/folder if you want. or press the ENTER
to compress your selected file/folder. key to skip.
Zip one or more files with the File Explorer ribbon menu
1 - Select the files/folders you want to compress.
2 - Click on the “Share” tab of File Explorer and select the “Zip” command.
Add files and folders to an existing ZIP folder
To add files/folders to an existing ZIP folder, drag and drop the selected files/folders to
the already zipped folder.
225
Session Data Storage
226
Storage Capacity
Storage capacity is the volume of data a storage device can hold. The smallest unit of measurement is a bit, which has a
value of either 0 or 1, then a byte, which consists of eight bits, with each byte representing a single character, e.g. the binary
code for letter “A” is “01000001”and the ASCII Code is “065. (each keyboard character = 1 byte).
The following table presents different units of measurement for data storage.
Bits Bits 0 or 1
227
Session Data Storage
Apply
Activity
1 1 - Open the File Explorer app on your computer. Compress any file using the Windows 10 ZIP tool.
2
1 - It is known as volatile or temporary memory as it needs a constant power c) CD
supply. d) DVD
a) DVD
2 - It is known as non-volatile memory and holds the instructions that cannot b) RAM
be modified but can be read only by the processor. c) ROM
d) CD
a) HDD
3 - __________is a low-cost, high-capacity physical storage medium that permanently b) ROM
stores the operating system files, software applications, user’s personal files, etc. c) RAM
a) Magnetic storage
4 - An electronic storage method that uses laser light beams to store and b) Optical Storage
retrieve the data. c) ROM Storage
d) RAM Storage
a) CD-ROM
5 - This is rewritable. The user can write, erase, and overwrite its content. b) CD-R
c) CD-RW
d) DVD-ROM
a) Local Storage
6 - ________ allows users to store data on the internet by reserving a space b) Cloud Storage
that is accessible from the computer with an active internet connection. c) External Storage
d) Internal Storage
a) Byte
7 - The smallest unit of measurement is the________, which can have a value b) Bit
of either 1 or 0. c) Kilobyte
d) Megabyte
a) Data Process
8 - It is a conversion process in which the file size is reduced by using a b) Data Compression
particular compression technique. c) Cloud
d) Local storage
a) 1000
9 - 1GB contains this many megabytes: _______. b) 1024
c) 1028
d) 1064
228
Closing
Data Storage
3- Internal Storage
External Storage
1. Optical Storage
2. Magnetic Storage
Cloud Storage
229
Session Data Backup and Restore
Session
230
Goal
Learning objectives
Dear Student
By the end of this Session, you should be able to:
1 2 3 4 5 6
List the steps of backup. Practice different types of Practice deleting the backup
local backups files and folders.
Be prepared
Data is considered a valuable and irreplaceable asset of any organization or individual. There exist situations which may
result in data loss, like power failures, system or file corruption, malware attacks, or a natural disaster. Backup is a
high-priority task of organizations and computer users, to protect and restore their data.
This session introduces local and offsite data backups, then discusses their advantages and disadvantages and illustrates
the best practices.
231
Session Data Backup and Restore
Prerequisites
Before starting this session, you should have a basic knowledge of different data storage units.
List of Terms
Keyword Description
Data restore The process of making available a usable copy of the backed-up data
Popular backup type which involves backing up all selected files and
Full backup folders that are important to the user
File history Regular or scheduled backup of data from your PC to a storage device
Incremental backup Backup of all changes that have been made since the last backup
Data backup procedure that records the data changes that have
Differential backup
occurred since the last full backup
232
Learn
Backup
Backup is the process of creating copies of data to a separate storage drive or
location, which is later used for restoring in case of any data loss. Backup is
required to protect your data and information from any loss or to make sure
that the information is available when you need it.
Backup steps
Depending on the aim and need, the backup process consists of a number of steps, which are essential for a successful
backup.
To choose the perfect time for backup, users need to consider these factors:
a - Frequency
Frequency determines how often a backup is scheduled locally or remotely, e.g. hourly, daily, weekly, or month-
ly. Large organizations configure special servers that are located in a backup center to back up data based on
predefined times.
b - Starting time
It is very important to set a starting time for each backup. There are some issues to be considered when
choosing the starting time. Scheduling backups when system use is as low as possible will speed up the backup
process. A connection drop might cause a backup failure. Also, any opened and in use files will not be backed
up at all. Therefore, most organizations start the backup process after working hours and have the computers
backed up overnight.
233
Session Data Backup and Restore
Restore
Data restore is the process of making available a usable copy of the backed-up data. It is the replacement and restoration
of lost, stolen, or damaged data to its original location or to other locations. A number of conditions can create the need for
data restore, such as human error, where the data is accidentally deleted; malicious attacks, where the data is stolen or
hacked; natural disasters; and machine failures.
1 - Full backup
Full backup is the most common and popular backup type. It involves backing up all selected files and folders that are import-
ant to the user. For example: a business organization needs to maintain fresh and updated copies of data every day;
therefore, it will set up an initial backup schedule that starts every night from Sunday to Thursday. Every day, the selected
data would be fully copied to the backup location.
Advantages Disadvantages
Fast restoring time as complete files are Space consuming, since every time the user runs a full
stored each time. backup, it will take more space.
The following steps illustrate how to set up and use File History in Windows 10 to safeguard your important files. Initially,
the user should use a new external drive that is connected to the PC or a network drive.
234
Set up a drive to use with File History
1 - Click the “Start” button and Click the
“Settings” button to open the Settings app. 2 - Click the “Update & security” button from the Settings app.
3 - Click the “Backup” option on the left side of the 4 - Click the “Add a drive” button, then select the media
Settings window. with which you want to use the File History feature.
The option “Automatically back up my files” is switched “on” by default when you select a backup media. The system will
automatically back up data on the selected media after the specified time.
5 - To open different backup options, click the 6 - Click the “Add a folder” button to select the folders you want to
“More options” button. back up. Select the Folder and Click on “Choose this folder” button.
By default, the system will only back up the folders listed in the “Back up these folders” section. As you have a drive linked
with File History, you can also choose which additional folders you want to back up.
235
Session Data Backup and Restore
7 - To specify how often your backups take place, click on the dropdown box beneath “Back up my files”. Select a particular
time period. This can range from every 10 minutes to just once a day, but the default hourly backups are probably fine for
most people. Making regular backups of all your files can take up a lot of space on your external hard drive, so there’s a
second pull-down menu that tells File History how long it should keep all those backups.
8 - You can also specify how long you want to keep the backup
versions on the selected media. Click on the “Keep my backups”
dropdown list and Select one of the options: 1 month, 3 months,
Forever, etc.
File History automatically adds certain folders to the backup.
Before you begin the backup process, you can remove folders you
don’t want to back up.
9 - In the “Back up these folders” section, select a folder you don’t want to back
up and click “Remove”. Repeat for each folder you want to remove.
You can also choose to exclude some folders. For example, you can exclude a
subfolder, if it is in one of the folders being backed up.
10 - In the “Exclude these folders” section, click “Add a folder”. Select a folder
to exclude and click “Choose this folder”.
When you have applied all the above settings and are ready to start the backup
process, click on the “Back up now” button at the top, in the “Overview” section.
You’ll see a message saying File History is backing up your data.
The File History tool in Windows 10 lets you restore your files if
they’re corrupted or accidentally deleted. It also allows you to
restore a modified document to an earlier version.
236
2 - Click the “Backup” option on the left side of the 3 - Choose the files and the folders that you intend to
Settings window, then click the “More options” button. restore, then click the “Restore” button, which is
green in color, to restore them to their original
On the backup options screen, click “Restore files from a location.
current backup” under Related Settings.
2 - Incremental backup
Incremental backup involves making a backup of all changes that have been made since the last backup, which can be the
initial full backup or the last incremental backup. For example: an initial backup is done on Sunday, then on Monday the
backup of only those files and folders that were changed or added since Sunday takes place. The Tuesday backup will include
the files or folders changed since Monday, and the cycle continues this way.
Advantages Disadvantages
Much faster than other backups. More time to restore than full backup.
3 - Differential backup
Differential backup records the data changes that have occurred since the last full backup. It falls in between full backup and
incremental backup. Initially, a full backup is made; then subsequent backups save all changes since the last full backup. For
example, if a full backup is made on Sunday, then on the following day of the backup schedule (Monday), only the files that
have changed since Sunday and new files added to the backup folders will be backed up. The following day (Tuesday), the
files changed and added since Sunday’s full backup will be copied again.
Advantages Disadvantages
Efficient use of storage space. Less storage space than incremental backup.
237
Session Data Backup and Restore
To understand the main differences among full, incremental, and differential backups, assume that a company decided to
compare the three backups to determine the best practice for it to use by creating all types of backups for the whole week.
Since the business week is 5 days, there would be 5 backups. The full backup process would take a full backup of the whole
data for 5 days. The incremental backup would start at the first backup and keep copies of any changes for every day, then
take the next day’s backup. The last is the differential backup, which would take only the differences and the changes from
the previous full backup.
Number of Backup
Full backup Incremental Differential
arranged by days
Backup no.1 All data ــــــــــــ ــــــــــــ
Backup no.2 All data Changes from backup 1 Changes from backup 1
Backup no.3 All data Changes from backup 2 Changes from backup 1
Backup no.4 All data Changes from backup 3 Changes from backup 1
Backup no.5 All data Changes from backup 4 Changes from backup 1
4 - Local backup
When local storage such as a hard drive (internal or external) or a flash drive is used to store the backup copies, the storage
medium is kept close at hand. Offsite backup is the opposite. The offsite backup is used to keep the data at a different
physical location; however, the local backup is used to keep copies of the data in the same physical location where the
source data exists.
Example
The following steps guide you in backing up to a local HDD. 2 - Click on the “Update and security” option
1 - Click the “Start” button and open the “Settings” app. from the Settings window.
3 - Click on the “Backup” option on the left side and 4 - In the Control Panel window, click on the “Set up
select “Go to Backup and Restore (Windows 7)”. backup” button.
238
5 - Select the location where you want to back up the data. 6 - Select what you want to back up.
7 - Backup is in process. Click on the “View Details” button to see the progress of the backup.
Advantages Disadvantages
Faster backup and restore. Since the backup is stored close to the source, it does
not offer good protection against natural disasters.
Good protection against hard drive failures.
When the source is damaged,
Data transfer cost is cheaper than any other storage medium.
Since it is local, it is conveniently obtained whenever there is a good chance the backup will also be
needed for backup and restore. damaged.
Advantages Disadvantages
239
Session Data Backup and Restore
This option creates an exact duplicate of your PC’s hard drive – sometimes referred to as a “disk clone” – including
Windows 10 itself, along with any other programs and all the personal files you have stored on your PC.
240
5 - Select one of the drives to store the system image and click on the
“Next” button. Make sure your external storage device is plugged in and
turned on. It should automatically be detected.
6 - Select the other drives you want to include in the backup. The drives that
are required for Windows to run will be included by default. You cannot include
the drive to which the backup is to be stored. Click on the “Next” button.
7 - Click the “Start backup” button to begin the backup process. The process
can take some time, depending on the size of your backup.
241
Session Data Backup and Restore
242
2 - Under “Protection Settings,” select the main system
drive (e.g. C:) and click the “Configure” button.
243
Session Data Backup and Restore
Apply
Suppose you have a database, that needs a continuous back up. Which of the following strate-
Activity gies could you use to speed up the backup process, depending on available backup resources?
1 Discuss with your friends.
a - Perform a full backup on the weekend and differential backups during the week.
b- Perform a full backup on the weekend, and during the week, back up only the tables with many changes.
Choose the correct answer for the following questions. a) Start time
Activity b) End time
2
1 - _____________ determines how often a backup is scheduled locally c) Frequency
or remotely. d) Restore
a) Compression
2 - The process of making available a usable copy of the backed-up b) Encryption
data is c) Data restore
a) File History
3 - The ________tool in Windows 10 lets you restore your files if b) Save History
they're corrupted or accidentally deleted. c) System Point
a) Full backup
4 - The data backup procedure that records the data changes that b) Differential backup
have occurred since the last full backup is: c) Incremental backup
d) Data restore
244
Closing
245
Session Remote Data Backup and Restore
Session
246
Goal
Learning objectives
Dear Student
By the end of this Session, you should be able to:
List remote backup types. Describe the meaning of data compression and encryption.
1 2 3
Be prepared
Online and remote data backup have accessibility drawbacks that online and cloud backups can solve. Some individuals and
organizations need to keep records of their backup copies online, where it is more convenient and easier to access and
modify them at any time.
This session introduces remote and online data backups, then discusses their advantages and disadvantages and illustrates
the best practices.
247
Session Remote Data Backup and Restore
Prerequisites
Before starting this session, you should have a basic knowledge of different data storage units and offsite backups.
List of Terms
Keyword Description
Online backup Backup of data to a storage center connected to the source system
Remote backup Data is remotely backed up apart from the source data
248
Learn
There are several types of remote data backups; the most common type is cloud
backup. The following section discusses different types of remote backups, the
advantages and the disadvantages of each type, and best practices.
Advantages Disadvantages
Offer protection from natural disasters More expensive than other backups
May take a long time to back up and restore,
Easy access via the internet
depending on the internet connection
Cloud Backup
Cloud backup (also called online backup or remote backup) refers to backing up data to a remote storage, cloud-based
server. The cloud server is accessible to a computer via an internet connection. This strategy involves backing up data over
the internet to an offsite server, hosted by a third-party service provider. The provider charges fees based on the usage
capacity.
Advantages Disadvantages
249
Session Remote Data Backup and Restore
Install Drive File Stream from the Drive Click Drive File Stream and then
PC or Laptop
Help Center Open Google Drive.
The Google Drive dashboard is displayed. The navigation tabs along the left side are:
My Drive: To access your stored files
Shared with me: To access files shared with you
Recent: To access recently used files
Google Photos: To access your photo library
Starred: To view files tagged for importance
Trash: To access your recycle bin
Backups: To access your backups
Upgrade Storage: To buy more cloud storage
250
Creating a new document.
The following table lists the documents that can be created in Google Drive.
251
Session Remote Data Backup and Restore
6 - Dropbox
The Dropbox company offers a file hosting service that creates a folder (Dropbox) on user’s computer
while synchronizing the contents with the Dropbox server and the user’s other devices, thus keeping the
files updated. A Dropbox basic account is free with 2GB of storage space.
Installation of Dropbox
Install the Dropbox app from https://www.dropbox.com/install. Once it is installed, a Dropbox folder is created on the
computer. To access the Dropbox, user must have a Dropbox account.
Accessing Dropbox
Go to https://www.dropbox.com/home/and log in to your Dropbox account.
252
To add files to your Dropbox folder in Windows 10:
Initially, the user has to install the desktop app on their computer.
253
Session Remote Data Backup and Restore
7 - OneDrive
OneDrive is an online cloud storage service provided by Microsoft that allows you to store files in the
cloud and access and share them anytime, anywhere on your PC, tablet, or phone. It lets a user easily
back up, store, and share photos, videos, documents, and more – anywhere, on any type of device.
OneDrive is pre-installed on Windows 10, and it also works on Mac, Android, and iOS.
Accessing OneDrive
Setup the OneDrive.
• Windows 10 has the OneDrive app already installed. Click
on the “Start” button, search, and open the OneDrive app
from the File Explorer.
• The OneDrive setup window is displayed. Enter your email
address associated with Microsoft, click on the “Sign in”
button, and set up the OneDrive account.
254
Uploading files to OneDrive from your PC.
OneDrive is integrated within File Explorer, making the process of
uploading files easy. You can transfer the files and folders from
PC to OneDrive so that you can access them from anywhere,
anytime.
• To upload, open the File Explorer and click on “OneDrive” in the
Navigation pane of File Explorer.
• Drag and drop or copy and paste content into the OneDrive
folder.
The files and folders placed in OneDrive on your PC will be
automatically synchronized with your OneDrive account. Now
you can access and share the files and folders from anywhere,
anytime.
Menu Options
- One you select a file or folder, right click on it. You
can choose from the following options:
• Open the selected item.
• Share the selected item
• Download the selected item to your device.
• Delete the selected item from OneDrive.
• Move, copy, or rename the selected item.
255
Session Remote Data Backup and Restore
Sharing
- To share an item, select and right click on it, then click on the “Share” option from the menu.
- Now set the suitable permissions and click on the option “Email”.
- Enter the email address of the person to whom you want to share the file and add a suitable
message, then click on the Share button to share the file
8 -KSU Storage
King Saud University has made an agreement with Microsoft Corporation to
provide cloud storage service to university employees, which has been linked with
employee’s’ university e-mail.
In this one place, you can find a number of useful Apps. In the Apps pane section, you can create different types of
documents, store all your important work online, manage data and information, share and collaborate on your work, and
explore the Microsoft OneDrive app.
256
Creating new Documents
- To create a new Word, Excel, or PowerPoint document, click on
“New” button and select the type of document you want to
create. You can also use a particular app from the Apps pane to
create a new document.
- Type a suitable title for the created document. All your work and
changes are saved automatically.
The created document will be listed in the Documents pane. The
Documents pane displays a list of recent documents, the pinned
documents, and the documents shared by you or other people.
Uploading a file
- To upload a file, click on “Upload and open” button, select the file you want to upload and click on the “Open” button.
- Your file is uploaded to Microsoft OneDrive and will be opened automatically after the upload is complete. Whenever you
edit the uploaded file, the changes are saved automatically.
257
Session Remote Data Backup and Restore
Online backup
Online backup provides continuous backup of data to a storage center connected to the source system (the one from which
the data is being backed up). It is considered an offsite backup as the storage facility provided is a data center located away
from the source computer. Since it is an ongoing backup process via the internet, it does not require human intervention for
connecting drives or media for backup. Typically, it is a paid service, and many data centers provide this subscription service
to consumers. Normally, the data centers are built with safety specifications against natural disasters. They have very high
security standards and a monitoring system to protect the data. The backed-up data is replicated across many storage
media, which grants more safety and lowers the risk of data loss.
Advantages Disadvantages
Provide best protection against natural disaster. More expensive than other local backup.
Require minimal human and manual intervention. Might take a long time to back up and store due to
the internet speed.
Offsite backup
Offsite backup is any backup kept at a different geographic location from the source data. The data is placed locally on any
storage device, such as a hard drive, DVD, or flash drive, which then gets moved to a different location, such as another
building. Remote backup (see below) also counts as being offsite.
Examples:
• A backup copy taken from the office and kept at home.
• A copy that is kept online, i.e. remote backup.
Advantages Disadvantages
Remote backup
Remote backup is a form of offsite backup where the data is remotely backed up apart from the source data, i.e. in a
different physical location.
Advantages Disadvantages
Secured or protected from natural disasters. More expensive than other local storage methods.
Can takes a long time to store, backup, and restore,
Easy access and does not need physical depending on the speed of the internet connection.
movement to access.
Available only with an internet connection.
258
Delete backup files in Windows 10
You can also tell Windows 10 to delete older backups automatically, which will prevent your hard drive from filling up too
quickly. Windows 10 has many backup features to protect your system and files. You may have enabled system protection
to create system restore points, set up automatic image backup tasks with Backup and Restore (Windows 7), or backed up
your files using File History.
Clean up File History
Before you delete File History backup versions, you need to make sure the backup drive is connected and File History is
turned on. Otherwise, you are not allowed to delete File History backups.
To delete File History, follow the given steps:
259
Session Remote Data Backup and Restore
260
Apply
Activity Enter your email address associated with Microsoft, click on the “Sign in” button, and set up the
1 OneDrive account.
Activity Create a Word document and save it in the Documents folder. Open File Explorer to access the
2 OneDrive folder on your computer. Now move the Word file to your OneDrive storage location.
Activity Log in to your Google account to access Google Drive. Create a new Excel file with the title “Student”
3 and save the file to Google Drive.
Activity
4 Open the MS Word app, create a document, and save it with a suitable name.
Activity
5 Transfer the file from your PC to your OneDrive folder so that you can access it from anywhere, anytime.
Choose the correct answer for the following question: a) Cloud backup
Activity This is the strategy for backing up data over the internet to an offsite b) Local backup
6 server, hosted by a third-party service provider. c) System image backup
d) Offsite backup
Closing
261
Dr. Rakan A. Alsowail
262
Aim
The aim of this chapter is to provide students with an introduction to the basic principles in
the field of information security. Students will become aware of the importance of the field of
information security, as well as various security terminologies that are widely used in the field.
Also, students will be able to differentiate among the different types of attacks and types of
protections needed to protect the different components of the information system. The focus
will be on technical protections, mainly access control and cryptography. Students will become
aware of the concept of access control and cryptography, and they will have the chance to
practice important cryptographic mechanisms.
Learning outcomes
Upon successful completion of this chapter, the student will be able to:
Define the term information security and state its main goals.
Explain the concept of Access Controls and differentiate its components & models.
Describe the different cryptographic mechanisms and algorithms and practice them.
Contents
Access Control
An Introduction to Cryptography
Cryptography in Practice
263
Session AN OVERVIEW OF INFORMATION SECURITY
Session
264
Goal
Learning objective
Dear Student
By the end of this Session, you should be able to:
Define the term Information Differentiate the three types of Classify the different types
Security. Protections. of security attacks.
1 2 3 4 5
Be prepared
265
Session AN OVERVIEW OF INFORMATION SECURITY
List of Terms
Term Explanation
Attack Any kind of malicious activity that attempts to collect, disrupt, deny, degrade,
or destroy information system resources or the information itself.
Authorized user A person who possesses the authority to perform an action or set of activities.
Unauthorized user A person who does not possess the authority to perform an action or set of
activities.
Unauthorized disclosure
Exposure of information to user(s) not authorized to access the information.
Unauthorized modification Modification of information by user(s) not authorized to modify the information.
Unauthorized disruption Unauthorized user interrupts or prevents the correct operation of system
services and functions in order to make information unavailable.
Unauthorized destruction
Unauthorized user destroys information in order to make it unavailable.
Encryption Converting the data (Scramble) into a form that is not understandable .
266
Learn
While the technology has increased our productivity and simplified our access to
vast information, it raises various security issues. For example, if an attacker is
able to access our bank information, the consequences can be severe. About 30
years ago, such security issues almost did not exist. This is because technologies
were not implemented as widely as nowadays, and fewer people were using the
technology at that time.
Information Security is a field that involves the study of practices of protecting our information wherever it is
(in the Information System) from those who would seek to misuse it.
The term “Information Security” is defined as protecting information and information systems
from unauthorized access, use, disclosure, disruption, modification, or destruction.
Information Security is not only concerned with protecting the information itself, but also protecting each component of
the Information System.
So let’s understand the different components of the Information System that need to be protected.
All these components play an important role in producing the desired information and presenting, storing, or transferring it.
Hardware Networks
People Software
Components
of an Information
System
Procedures Data
267
Session AN OVERVIEW OF INFORMATION SECURITY
Software
Software consists of the applications, operating systems, and command utilities that are being
used in the Information System. This component of the IS is considered the most difficult to
secure.
Hardware
Hardware consists of the physical technologies installed in the IS that host and execute the
software, store and transport the data, and provide interfaces for entering or removing the
information in the system. This component of the IS is considered as physical assets which must
be protected from harm, theft, and unauthorized access or interaction.
The physical location of computers and the computers themselves must be secured because a
breach of physical security can result in a loss of information.
Data
Data consists of the facts and figures that are stored, processed, or transmitted in and out by
the Information System. This component of the IS is considered the most valuable to an organiza-
tion and the main target for intentional attacks. Therefore, it must be highly protected.
People
People, the users of the IS, are also an important component of the IS, which is often neglected in
information security considerations. People always constitute a threat to information security,
and they are considered the weakest link in an organization’s security program. There must be
security policies that prevent people from accidentally or intentionally damaging or losing
information.
Procedures
Procedures are another component of the IS that also is often neglected in information security
consideration. Procedures are written instructions to accomplish a specific task in an Information
System.
Organizations usually distribute procedures to their employees so that they can access the
information system, but without proper protection of procedures. Protection of Procedures is of
great importance. For example, similar to all critical information, Procedures should be distributed
to employees or users on a need-to-know basis.
Networks
Information Systems are often connected together to form Networks, such as a Local Area
Network (LAN).
This component of the IS has increased the necessity of information security. Threats to the
security of Information and Information Systems increase when organizations work on LANs, and
they become worse when these LANs are connected to the Internet. Extreme focus is required to
secure this component of the IS.
Thus, in order to protect information, each component of the information system must be protected as well.
These components are different from each other, and each of them requires a different kind of protection.
268
3 - Types of Protections
There are different types of protections that can be applied for protecting the different components of the IS. Following are
the three main types of Protections in the Information Security context:
1 - Physical Protection
The Hardware component of the IS requires Physical Protection.
Physical Protection involves the use of physical security policies, such as locks and keys that restrict access to the
area where the hardware components are located.
2 - Awareness-Based Protection
The People and Procedures components of the IS are protected by Awareness-Based Protection.
Awareness-Based Protection involves education and training to prevent users from accidental or intentional
misuse of information or procedures.
3 - Technical Protection
Software, Data, and Networks are protected by Technical Protection.
Technical Protection involves the use of security technologies to manage access to, and usage of, a system or
information by different users.
Examples of such security technologies are Access Control systems, Cryptography, firewalls, etc.
Two main security technologies that we will be focusing on in this chapter are:
Access Controls involve processes that allow us to Cryptography allows us to keep information secret. It
limit access to a system or information by the users involves generating codes to convert (scramble) data into an
and to control and manage it. Users must provide User unreadable format so that an unauthorized user can’t
IDs, Passwords, biometric identifiers, etc., to get understand or misuse it. To recover the data, the authorized
access to a system or information. You will learn more user requires a key. You will learn more about Cryptography
about Access Controls in Session 2 of this Chapter. in Sessions 3 and 4 of this Chapter.
TIP Technical Protection can also be additionally applied for the protection of People and
Procedures to prevent individuals from intentionally misusing knowledge in the Procedures.
269
Session AN OVERVIEW OF INFORMATION SECURITY
1 - Confidentiality
onfidentiality is the a ility to pre ent unauthorized disclosure of information
so that sensiti e information is accessi le only to authorized users.
Every one of us has sensitive information that we want to keep confidential and not have
disclosed to unauthorized users.
2 - Integrity
Integrity is the a ility to pre ent unauthorized modification of information in order
to maintain its accuracy, consistency, and trust orthiness o er its entire lifecycle.
In other words, Integrity is a property that is concerned with allowing sensitive information
to be modified only by authorized users.
3 - Availability
Availability is the ability to prevent unauthorized withholding of information
so that it is a aila le hen needed y the authorized users.
Although it might seem less important than Confidentiality and Integrity, there are situations
where the Availability of information is of great importance.
A patient’s record should be available to the authorized users at all times
in a hospital. In emergency situations, getting access to such information
as quickly as possible is very important; if the information is not available
on time, there could be loss of lives due to delayed treatment.
270
Types of Security ttac s.
A security attack is one of the main concerns in information security. It can come in
different forms.When performed by unauthorized users (outsiders), it is known as an
External Attack; when performed by authorized users (insiders), it is known as an
Insider Attack. It is more difficult to detect or prevent insider attacks than external
attacks, because insiders are authorized users who operate within their privileges.
Insider and external attacks can be further classified into four categories:
1 - Interception Attacks
2 - Interruption Attacks
3 - Modification Attacks Confidentiality Interception
4 - Fabrication Attacks
Interruption
Each type of attack can affect the Confidentiality, Integrity, or
Availability of the CIA triad, as depicted in Figure aside.
Integrity Modification
Fabrication
Interruption
Availability Modification
Fabrication
1 - Interception Attacks
Interception attacks allow an attacker to gain access to sensitive information. Interception might take the form of
unauthorized file viewing or copying, eavesdropping on phone conversations, or reading email. This type of attack affects
the confidentiality of the information.
2 - Interruption Attacks
Interruption attacks allow an attacker to make sensitive information unusable or unavailable to authorized users. This
type of attack affects the availability of the information. It might affect the integrity of the information as well.
For example, if an attacker overwrites files in a file system in order to prevent access to the data they contain, we might
consider this an integrity attack, due to the possible corruption of data.
3 -Modification Attacks
Modification attacks affect the integrity of the information. They allow an attacker to tamper with sensitive information.
This type of attack might affect the availability of the information as well.
For example, if an attacker tampers with a configuration file that manages how a particular service behaves, this might affect
the availability of that service by changing the contents of the file.
4 - Fabrication Attacks
Fabrication affects the integrity of the information. It is a type of attack in which the attacker inserts forged objects or
information into the system, as if it was generated by an authorized user. This forged information misleads authorized
users when they use it. In addition, fabricated data may reduce confidence in genuine data within the affected system.This
type of attack might affect the availability of the information as well.
For example, if an attacker generates enough network traffic, email, or nearly anything else that consumes resources, this can
potentially render the service that handles such traffic unavailable to authorized users of the system.
271
Session AN OVERVIEW OF INFORMATION SECURITY
Apply
ead the follo ing cases and note do n your responses in the o es pro ided elo .
A - Consider that you are a Security Officer in a Bank and you have a flash drive (USB)
Activity containing secret financial details and security codes of the banks. You want to protect
1 this flash drive from theft or misplacing.
1 - Note down the possible security measures you will follow to protect your flash drive (USB).
2 - Match your security measure with the appropriate type of Protection you have learned in this Session.
3 - Consider that you are using your laptop on a coffee shop, which provides free open Wi-Fi. Will you use
that flash drive (USB) on your laptop? Why or why not?
B - You are planning to buy a car on loan from a bank. An employee of the bank has asked you
to fill out a form (PDF) and send it to him via email. In the PDF form, it asks details about your
financial sources and also about your family. You filled out the form correctly, but while
sending the email, you mistakenly sent it to a wrong person.
5 - How can you avoid this kind of mistake in the future? List your suggestions.
C - When you start chatting with someone through an application on your smartphone,
sometimes it gives a message like “This chat is secured with end-to-end encryption.”
6 - What do you understand from this message? And which goal(s) of Information Security are
achieved with this?
272
Choose the correct option for the blanks in the following statements.
a) Availability
Activity b) Confidentiality
2 a - ____________ is/are the main goal(s) of Information Security.
c) Integrity
d) All of the above
a) Modification
b - _____________ attacks insert fake objects or information into b) Interception
the system. c) Fabrication
d) All of the above.
a) Integrity
c - ________________ is the assurance that the information is b)Awareness-Based Protection
trustworthy and accurate. c) Confidentiality
d) Information Security
a) Confidentiality
d - Interception attacks are generally designed to target and b) Availability & Confidentiality
challenge the __________ pillar(s) of the CIA Triad. c) Integrity & Availability
d) All of the above
a)Professional Development
e - ______________ involves providing Education and Training to b) Integrity
c) Awareness-Based Protection
employees in an organization.
d) None of the above
Closing
Dear student, Following is a mind map that summarizes the concepts and knowledge you
have learned in this session.
273
Session ACCESS CONTROL
Session
ACCESS CONTROL
274
Goal
Learning objective
Dear Student
By the end of this Session, you should be able to:
1 2 3
Be prepared
2 - Have you ever learned about / thought about / experienced managing and controlling access to a resource?
For example, access to your car by many drivers. How do you manage or control it?
275
Session ACCESS CONTROL
List of Terms
Term Explanation
Subject A user (or program of a user) that needs access to data or resources.
Usually much longer than a password, an actual phrase of some type; easier for the
Pass-phrase user to remember.
Cognitive password Questions about facts or predefined responses that only a user knows the answers to.
276
Learn
For instance,
confidentiality is met if only authorized people can view or access the information;
and availability is met if only authorized people can withhold the information.
The major function of Access Control is to manage access rights of users when fully sharing the
system resources, and to ensure that illegal use of and access to the resources cannot occur.
Access Control limits the access of the subject (user) to the object (data). It controls the subject’s access according to
his/her authentication.
Access Control is one of the central themes of information security; it helps to achieve confidentiality and integrity of data.
Firstly, each person must have a unique identity to identify him/herself to the system;
this step is known as Identification.
Secondly, each person must prove to the system that he/she is really who they claim to
be; this step is known as Authentication.
Finally, the system must define what the authenticated person can or cannot do with
the information; this step is known as Authorization.
Thus, Access Control comprises three components; Identification, Authentication, and Authorization. Each complements
the other, and they must be implemented in order. Let’s discuss each one in detail.
277
Session ACCESS CONTROL
1 - Identification
The first step in access control is identification.
Identification is the process y hich a user agrees an identity and responsi ility is initiated.
Hence, the identification process is established when a user provides a username, a log-in ID,
a personal identification number (PIN), or a smart card. Once a user has identified himself, his
identity will be responsible for further actions undertaken by him. Computers are not able to
differentiate humans from each other but rather are able to differentiate your user account
from all other user accounts.
Identification is about providing a public piece of information (username, account number), and it might be known by a
subject’s friends or family. Thus, identification does not play an important role in making the system more or less secure.
However, it is only the first step and the starting point that facilitates, introduces, and is relied on by the two most important
steps: Authentication and Authorization.
2 - Authentication
The second step in access control, Authentication, relies on the identification step. While identification is about providing
a public piece of information, authentication is about providing a private piece of information that is known solely by a
certain user.
uthentication is defined as the process of erifying or testing that a claimed identity is alid.
In the authentication step, additional information is needed from a user, and it must correspond
exactly to the identity declared. A well-known example of authentication is a password.
Authentication techniques can be classified into three types based on their characteristics, as follows:
a) Something the user Knows b) Something the user Has c) Something the user Is
Authentication Techniques such as Password, Pass-phrase and Cognitive Password belong to the category of
“Something the user Knows.”
Password is the most commonly used technique for authentication processes; it is considered the weakest.
Pass-phrase, which is a string of characters usually much longer than a password, is more efficient and effective than
passwords. A pass-phrase is easier for the user to remember than passwords, as it is an actual phrase of some type.
Pass-phrases also provide a higher level of protection than passwords, as they are longer and harder for an attacker to
guess or break.
Cognitive password, which is a number of questions about facts or predefined responses that only a user should know,
is efficient.
Examples of cognitive password are “What is your birth date?”, “What is your mother's maiden
name?”, and “What is the name of your division manager?”
278
An effective cognitive password system asks a different set of questions each time.
Cognitive passwords are more difficult for an attacker to break, and they are usually easier
for a user to remember.
Although making a long, complicated password is preferred to survive attacks and make
this type of authentication stronger, humans are not able to remember long, complicated
passwords that consist of different alphanumerical characters. Even if a user is forced to
create such passwords, the user would write them down somewhere, as he/she will not be
able to remember them; hence, they are susceptible to physical theft.
Thus, this type of authentications is not efficient to be used alone, and it is usually used in
combination with type 2 (something the user has) or type 3 (something the user is).
There are several authentication techniques that can be classified in the category of “Something the user Has,” such as
One-Time Password (OTP), Memory card, and Smart card.
Memory card
Memory card is another technique to use in this type. Memory cards contain information
within a magnetic strip and rely on a reader of some sort to process the information. For a
user to be authenticated in this technique, he/she first inserts the card into the reader and
then enters a set of credentials to be authenticated.
A well-known example of Memory card is an Automated Teller Machine (ATM). The user
inserts the ATM card into the ATM and then enters his/her PIN number. The card provides
the account number (user information) while the user provides the secret code (PIN);
together, they provide a credential set.
Smart card
Smart card is different from a Memory card. It has a microprocessor and
integrated circuits, which make the smart card able to process information It is also possible to authenticate
rather than only containing the information as with a Memory card. While based on something you have, that is,
using the smart card, the user must insert it into a reader which has electrical something in your possession. Give an
connections that switch on and power the smart card processor. The user example of authentication based on
something you have.
then enters a PIN value, which unlocks the information and processing power
contained on the smart card. Smart cards are considered more tamper-proof
than memory cards as a smart card locks itself if the user has entered
Cryptographic keys can be used for the Authentication process; this can be classified under the “Something that
TIP user Has” type of Authentication Techniques. You will learn about Cryptographic Keys in Session 3 of this chapter.
279
Session ACCESS CONTROL
The authentication process based on “Something the user Is” is considered the strongest and
most efficient. It is suitable for organizations that require a very high level of security. This type
of authentication is usually referred to as Biometric Authentication. Biometrics measure
unique physical or behavioral characteristics of a user to recognize or authenticate his/her
identity. Physical biometrics include fingerprint, hand or palm geometry, retina, iris, and facial
characteristics. Behavioral biometrics include signature, voice, keystroke pattern, and gait.
The acceptance of biometric authentication by society is very low, and the implementation is
very expensive compared to other authentication types.
People do not prefer biometric authentication because of the associated inconvenient processes that a user must go
through to be authenticated, and also because it reveals personal information about them. As a result, it can only be seen
in organizations that require a very high level of security, where confidentiality is more important than people’s
convenience and preference.
Multi-Factor Authentications
The three types of authentication techniques provide different levels of When you want to authenticate
security; each type is stronger than the one preceding it. In other words, yourself to your computer, most likely you
type in your username and password. The
type 3 of the authentication techniques is the strongest type because it is
username is considered public knowledge,
the most difficult to breach, compared to the other two types.
so it is the password that authenticates
you. Your password is something you
Deciding which Authentication technique to use depends on the level of know.
security desired by a certain organization: whether it is a low, moderate,
or high level.
Discuss in groups and answer
the following questions:
To satisfy the levels of security desired by different organizations, one or two or all three types of Authentication
techniques can be used at a time.
When only one of the three types of Authentication techniques are used, it is referred to as One-factor authentication.
When two of the three types of Authentication techniques are used, it is referred to as Two-factor authentication.
Whereas if all three types of Authentication techniques are utilized, it is referred to as Three-factor authentication.
280
In order to have a strong authentication process,
the authentication must utilize two-factor or
9 0 1 2
Two-factor authentication requires
more. An example of utilizing two-factor is when
DEBIT CARD
5 6 7 8
$ 123 that two of the three authentication
1 2 3 4
a subject/user uses a debit card at a shop. He methods (something you know, something you
must swipe the card (something he has) and have, something you are) be used. Give an
enter a PIN (something he knows) to complete example from everyday life where two-factor
the transaction. authentication is used. Which two of the
three are used?
3 -Authorization
Authorization is the third and final step of access control. It is performed after a user has been identified and authenticated.
uthorization is the process of assigning access and the right to carry out specific operations to authenticated
users, depending upon their preconfigured access rights and permissions outlined in access criteria.
It must be noted that not every identified and authenticated user can use all resources.
Instead, after a user is identified and authenticated, a check must be performed to find
out what accesses and operations he/she can perform. In other words, by performing
the Authorization step, we can determine what an identified and authenticated user can
actually access and what operations he/she can carry out.
Authorization is provided by a system through Access Control Models, which manage the
type and level of each user’s access to objects. A wide variety of Access Control Models
exist, each of which provides a different approach to Authorization. The following section
gives a brief description of the major types of Access Control Models.
The main objective of an Access Control Model is to enforce the rules and objectives of certain security policies. In other
words, it dictates how objects must be accessed by subjects/users.
There are different Access Control Models that focus on different goals of Information Security (the CIA triad). Some
Access Control Models focuses more on Confidentiality of data, whereas others focus more on data Integrity.
Each Model has its own advantages and disadvantages and serves different organizations’ needs, culture, nature of
business, security policy, etc. Traditionally, there are three widely accepted Access Control Models:
281
Session ACCESS CONTROL
In Mandatory Access Control, each object is attached to a security label and each user is assigned to
a security clearance.
Access restriction in the Mandatory Access Control Model is based on the security clearance of users and security labels of
objects.
In order for a subject/user to access an object, the subject’s clearance level must be equal to or greater than the object’s
label level. For instance, if an object is very confidential in an organization and has been assigned a “Top Secret” security
level, a user who has been assigned the lower security level “Secret” cannot access the object, as his/her security level does
not match the object’s.
User A
Secret
User B
Top Secret
As this model is named mandatory, the security levels are enforced by the system and only the administrators of the
system can modify them. In other words, it does not allow a user or a program of the user to modify the security levels. That
makes this model stricter and more secure, suitable for organizations that require a high level of security, such as the
military.
ut this model is neither e i le nor scala le.
For instance, if a subject creates a file on his system and wants to share it with other subjects, the subject can control and
specify who can access the file. In other words, the access control is based on the discretion or the decision of the owner.
DAC is often implemented using an access control list (ACL) of objects, where each ACL defines the types of access granted
or restricted to an individual or a group of subjects.
Unlike MAC, DAC is applicable for organizations that do not require a high level of protection.
282
2 2
1 1
3 3
In Discretionary Access Control, a subject is permitted to access an object based on the identity of the
subject, and some subjects can also delegate their own access authorities to other subjects.
In the Role-Based Control Model, access to objects is restricted based on the business function or
role that subjects/users are performing.
Unlike DAC, access permissions in RBAC are assigned to roles rather than to subjects’ identifiers. In this model, groups of
users are created by the administrators, who then assign access rights and permissions to the groups. A user in a group will
be able to utilize the access rights and permissions of the group.
This model is more appropriate for large organizations that are required to change access rights and permissions more often.
This is because this model allows the administrators to add a subject, add an object, or change access rights and permissions
very easily by changing centralized roles without having to manipulate any subject or object in the system. For instance, in a
company, the administrator can add a new employee to a role rather than creating access rights and permissions for every
person who joins the company.
283
Session ACCESS CONTROL
Apply
Do the following Access Control Exercises by using your Google Drive account.
Activity
1 1 - Authorize your class friend(s) to only be able to view a Word file stored in your Google Drive account.
2 - Authorize your class friend(s) to view and edit a Word file stored in your Google Drive account.
3 - Share a Word file stored in your Google Drive account by using the sharable link feature.
Choose the correct option for the blanks in the following statements.
Activity
2 1. ____________ is a number of questions about facts or predefined
a) Password
b) Pass-phrase
responses that only the user should know. c) Cognitive Password
d) Subject
a) Two-factor authentication
2. When one of three types of Authentication techniques is used, b) One-factor authentication
it is referred to as ________________. c) Three-factor authentication
d) None of the above
a) Identification
3. ________________ is the process of assigning access and the right b) Password Protection
to carry out specific operations to the authenticated users. c) Role-Based Access Control
d) Authorization
a) One-Time Password
4. OTP stands for _______________. b) One-Time Protocol
c) One-Way Protocol
d) None of the above
284
Closing
Dear student, Following is a mind map that summarizes the concepts and knowledge you
have learned in this session.
ACCESS CONTROL
Multi-factor Authentlcation
285
Session An Introduction to Cryptography
Session
An Introduction to Cryptography
286
Goal
Learning objective
Dear Student
By the end of this Session, you should be able to:
1 2 3 4
287
Session An Introduction to Cryptography
Be prepared
2 - When checking your email over a secure connection, or making a purchase from an online retailer, have you ever
wondered how your private information or credit card data is kept secure?
3 - In ancient times, how did people share secret messages during world wars?
List of Terms
Term Explanation
Plain Text The original message (or) an original readable textual material message or data.
Cipher Text The coded message (or) a non-readable form of the original text.
Decryption Restoring the original plain text from the cipher text.
A value that is used to encrypt or decrypt a message. It can include numeric and
Key
alphanumeric text and special symbols.
288
Learn
1 - What is Cryptography?
Cryptography is a science of secret writing and is an ancient art. The aim is to hide the meaning of a
message so that it is unreadable by unauthorized eavesdroppers. Cryptography has a definitive
existence in everyday life. There are a range of situations where we want our data to be undisclosed.
Everything from our smartphone to our banking relies heavily on cryptography to keep our information
safe and our life secure.
Security of information in communications, computer systems, electronic commerce, and the emerging information society
depends on cryptography. Cryptography can protect communications that traverse untrusted networks.
Cryptography is an essential tool to achieve the basic goals of Information Security: Confidentiality, Integrity, and Availability.
Cryptanalysis is the science of breaking cipher texts without knowledge of the key. Cryptography and Cryptanalysis are
known as Cryptology.
2 - Cryptographic Mechanisms
In Cryptography, a variety of cryptographic mechanisms exist to support different security services: data confidentiality,
data integrity, etc. Some of the popular cryptographic mechanisms are as follows:
1- Encryption
2- Hash Functions
3- Digital Signatures
4- Digital Certificates (Digital IDs)
289
Session An Introduction to Cryptography
Encryption is a process of converting the data (referred to as “plain text”) into a form that is not
understandable (referred to as “cipher text”).
The conversion and subsequent recovery of the data depend on a code or a key, which can be a number or a string
of characters.
• You can substitute each letter of your message with the letter that is two down from it in the alphabet order. So “A”
becomes “C,” “B” becomes “D,” and so on.
• You need to inform your trusted friend that the code (or the Key) is “Shift by 2.”
• Your friend gets the message and decodes it properly by replacing each letter with the letter that is two up in the alphabetic
order.
• Anyone else who sees the message will see only distorted text.
The fundamental requirement is that no information be lost (that is, all operations are reversible).
Thus, Encryption is a cryptographic mechanism that helps to achieve the security service Confidentiality, whether the
information is in storage or in transit.
There are a range of techniques of encryptions. In other words, there are different ways to transform the “plain text” into
the “cipher text.” Two of the techniques are basic:
In substitution, each element in the plain text Transposition Ciphers are a bit different from
(bit, letter, group of bits or letters) is mapped Substitution Ciphers. In transposition, elements
into another element. in the plain text are rearranged or plain text
characters are shifted in some regular pattern to
form cipher text.
290
2 - Hash Functions
ash function is a one ay mathematical function that generates a fi ed length hash alue
based on the plain text.
Values returned by a hash function are called message digest or simply hashes.
The hashes can be sent with the message. The receiver simply hashes the message again using the same algorithm, then
compares the two hashes. If the hashes match, the message has not changed. If they do not match, the message has been
altered.
It is impossible for someone to change the data without affecting the hash value, thus securing the data from intruders.
A hash function H( ), applied on input (x), returns a fixed string, hs. Mathematically, it is written as hs = H(x).
Thus, the Hash function is a cryptographic mechanism that helps to achieve the security service Data Integrity.
SENDER RECEIVER
Hash
Data Intended for Sending Data Received
Value
Hashed
Message
Message Hash
Hashed Value
Hash
Compared
Value
Message
No
Tampered with
291
Session An Introduction to Cryptography
3 - Digital Signature
In situations where there is not complete trust between sender and receiver, we need Digital Signatures to
authenticate the sender of the message.
A digital signature is like a handwritten signature, but it is in digital form for an electronic document.
The sender then sends the digital signature along with the message, usually
by appending it to the message itself.
When the message arrives at the receiving end, the receiver uses a key
shared by the sender to decrypt the digital signature, thus restoring the
original hash of the message. (The key shared is often a public key, discussed
later in this session.)
The receiver can then verify the integrity of the message by hashing the
message again and comparing the two hashes.
Although this may sound like a considerable amount of work to verify the integrity of the message, it is often done by a
software application of some kind, and the process typically is largely invisible to the end user.
A digital signature is considered legally binding, and if it is lost or stolen, it must be revoked.
4 - Digital Certificate
Message signing can be scaled up by using Digital Certificates.
igital ertificate is an electronic e ui alent of an indi idual s identity card it can e used to
erify the identity of someone you don t no .
A digital certificate is typically formed by taking a key (public key) and identifying information, such as a name and address,
and having them signed by a certificate authority (CA).
- A CA is a trusted entity that handles digital certificates.
- One well-known CA, at present, is VeriSign.
The advantage of having a certificate is that it allows us to verify that a key (public key) is truly associated with a particular
individual. In the case of the digital signature we discussed in the preceding section, it might be possible that someone had
falsified the keys being used to sign the message and that the keys did not actually belong to the original sender. If we have
a digital certificate for the sender, we can easily check with the CA to ensure that the public key for the sender is legitimate.
292
3 - Cryptographic Algorithms
Cryptography involves the combination of mathematical and computational strategies, keys, algorithms, etc., to securely
and reliably prevent unauthorized access to sensitive information and verify each component in a communication.
Through the use of an algorithm, information is made into meaningless cipher text; a key is required to transform the data
back into its original form. The security of encrypted data is totally dependent on two things: the strength of the
cryptographic algorithm and the secrecy of the key.
SENDER RECEIVER
Encryption Decryption
Plaintext Algorithm Plaintext
Algorithm Ciphertext
Message Message
(Y)
(X) (X)
ASYMMETRIC KEY CRYPTOGRAPHY: Same Key shared by both sender and receiver pair
For example, two users, Alice and Bob, want to exchange messages privately and
securely. In the Symmetric Key Cryptography setting, the following steps will occur:
STEP
1 Alice buys a lockbox and two identical keys to open it.
STEP
2 Alice arranges to meet Bob to give him one of the keys. (It’s inconvenient, but she only
has to do it once.)
STEP
3 Alice uses her key to lock her message into the lockbox and sends the lockbox to Bob.
STEP Bob can use his identical key to unlock the lockbox and read the message. Bob can use
4 the same method to securely reply.
293
Session An Introduction to Cryptography
- Distribution of key – Secret key sharing among senders and receivers is a challenge. It gets even more inconvenient when
the users are on opposite sides of an ocean.
If multiple parties are involved in the communication, then multiple keys have to be distributed. Managing many keys is
difficult.
Both message confidentiality and authenticity are ensured through asymmetric key cryptography. It is also commonly
known as Public Key Cryptography.
SENDER RECEIVER
294
For example, two users, Alice and Bob, want to exchange messages privately and securely. In the Asymmetric Key
Cryptography setting, the following steps will occur:
STEP Bob sends the (unlocked) padlock (Public Key) to Alice, keeping the key (Private
2 Key) safe with himself.
STEP Alice puts her message in a simple box, locks it with Bob’s padlock (Public Key),
3 and sends it to Bob.
STEP Bob receives the locked box, which he can open with his key (Private Key). He can
4 read the message. Alice can follow Steps 1 and 2 to get a reply from Bob securely.
Confidentiality
By using Encryption, which is one of the core cryptographic mechanisms, we achieve the security service
“Confidentiality.” Before you send sensitive data over a network or store it on a disk, you can encrypt it,
which turns it unreadable. The intended receiver needs to decrypt it to get the readable data back.
Integrity
Cryptographic mechanisms such as Digital Signatures and Hash Functions are used to ensure the security
service “Integrity.” One can easily forge email, but it’s very hard to forge a digitally signed email message.
Similarly, it’s hard for someone to modify or manipulate a message that is digitally signed.
Cryptographic mechanisms such as Digital Certificates (Digital IDs) are also used to achieve the access
control component “Authentication.”
Non-Repudiation
The security service “Non-Repudiation” prevents the sender from denying that he or she sent the
message. The cryptographic mechanism Digital Signatures is used to achieve this service.
295
Session An Introduction to Cryptography
Apply
Activity
1 1 - Using a transposition cipher, reverse the order of the plain text “ELPMAXE ELPMIS A”
2 - Convert this plain text to cipher text with the shift parameter of 3.
PLAIN TEXT: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Choose the correct option for the blanks or select True or False in the following statements.
Activity
2
a) Public Key
1 - ______________________ Cryptography uses the same key for b) Asymmetric Key
encryption and decryption of data. c) Symmetric Key
d) None of the Above
a) Cipher text
b) Secret text
2 - The ________is the original message before transformation.
c) Plain text
d) None of these
a) True
3 - A Key is a value that is used to encrypt or decrypt a message.
b) False
a) True
4 - Values returned by a hash function are called message digest.
b) False
a) Plain text
b) Decryption
5 - ______________________ is the process of converting plain text to
c) Encryption
cipher text.
d) None of these
296
Closing
Dear student, Following is a mind map that summarizes the concepts and knowledge you
have learned in this session.
An Introduction to Cryptography
297
Session CRYPTOGRAPHY IN PRACTICE
Session
CRYPTOGRAPHY IN PRACTICE
298
Goal
Learning objective
Dear Student
By the end of this Session, you should be able to:
1 2 3 4 5 6
299
Session CRYPTOGRAPHY IN PRACTICE
Learn
Encrypt a message with the Substitution cipher technique by using the CFY-KSU Cryptography
Tool. Send the encrypted message to your class friend through your KSU email.
Decrypt an encrypted message that you have received in your KSU email from your class
friend by using the CFY-KSU Cryptography Tool.
Your friend has informed you that the Encryption technique Substitution cipher with “Shift by 3” was used while
encrypting the message.
300
2 - Practices on Basic Encryption –Transposition Ciphers
You have learned in Session 3 how a message can be encrypted by using the Transposition cipher technique.
Use the CFY-KSU Cryptography Tool and do the following.
Encrypt a message with Transposition cipher technique by using the CFY-KSU Cryptography
Tool. Send the encrypted message to your class friend through your KSU email.
1 In the CFY-KSU Cryptography Tool, choose the “Basic Encryption” tab. NOTE
2 Enter your message in the “Plain Text” box. CFY-KSU
Cryptography
3 Choose the “Transposition Cipher” option. Tool uses the
“Rail Fence”
4 Encrypt the message. technique of
Transposition
5 The Encrypted message will be shown in the “Cipher Text” box. Cipher.
6 Copy the encrypted message and send it through your KSU email to your class friend.
7 Inform your friend of the encryption technique (Transposition) that was used so that only he will be able
to decrypt the message correctly.
Decrypt an encrypted message that you have received in your KSU email from your class
friend by using the CFY-KSU Cryptography Tool.
Your friend has informed you that the Encryption technique Transposition cipher was used while encrypting
the message.
301
Session CRYPTOGRAPHY IN PRACTICE
Generate a Hash Value for a file that you want to send safely to your friend by using the
CFY-KSU Cryptography Tool.
Send the Hash Value along with the file to your class friend through the KSU email.
You have received a file and a Hash Value in your KSU email. Generate the Hash Value again
and compare it with the Hash Value received by using the CFY-KSU Cryptography Tool.
1 Download the file and the Hash Value from your KSU email and save it onto the desktop.
2 In the CFY-KSU Cryptography Tool, choose the “Hash Functions” tab.
3 Upload the file in the Generate Hash Value section.
4 Generate the Hash Value and download it onto the desktop. Save it with the name “H2”.
5 Now, in the Compare Hash Values section, upload the Hash Value “H1”, which was received in your KSU email.
6 Upload the Hash Value “H2”, which you have generated.
7 Compare the two Hash Values and check the result.
302
4- Practice on Symmetric Key Cryptography
As you know in Symmetric Key Cryptography algorithm, the sender and receiver share the same key, which is used for both
encryption and decryption. Use the CFY-KSU Cryptography Tool and practice Symmetric Key Cryptography as follows.
Generate a symmetric key using the CFY-KSU Cryptography Tool and share it with your
class friend.
1 In the CFY-KSU Cryptography Tool, choose the “Symmetric Key Cryptography” tab.
2 Generate a key and download it onto the desktop.
3 Share this key with your class friend.
(Hint: You may use the Flash drive, because you need to share it privately.)
ncry t a file with the Symmetric Key and send it to your class friend through your KSU email.
1 In the CFY-KSU Cryptography Tool, choose the “Symmetric Key Cryptography” tab.
2 In the Encrypt Section, upload the file you want to encrypt.
3 Upload the Symmetric Key.
4 Encrypt the file and download it onto the desktop.
5 Send this encrypted file to your friend through your KSU mail. Ask him to decrypt the file by using the
pre-shared key in the CFY-KSU Cryptography Tool.
ecry t the encry ted file that you have received in your KSU email with a ey
shared by your friend.
1 Download the encrypted file sent by your class friend in your KSU email and save it onto the desktop.
2 In the CFY-KSU Cryptography Tool, choose the “Symmetric Key Cryptography” tab.
3 Upload the encrypted file in the Decrypt section.
4 Upload the Symmetric Key, which was shared by your class friend separately.
5 Decrypt and download the decrypted file onto the desktop.
6 Open and check the original file.
303
Session CRYPTOGRAPHY IN PRACTICE
Generate your Public and Private keys using the CFY-KSU Cryptography Tool and
share the Public key with your class friend.
1 In the CFY-KSU Cryptography Tool, choose the “Asymmetric Key Cryptography” tab.
2 Generate the Public and Private Keys and download them onto the desktop.
3 Share the Public key with your class friend.
(Hint: You can share it publicly or send it through your KSU email.)
ncry t a file with the shared ublic Key of your class friend by using the Y KSU
ry togra hy ool and send the encry ted file to him through your KSU email.
1 In the CFY-KSU Cryptography Tool, choose the “Asymmetric Key Cryptography” tab.
2 In the Encrypt section, upload the file.
3 Upload the shared Public Key of your class friend.
4 Encrypt the file and download it onto the desktop.
5 Send this encrypted file to your friend through your KSU mail. Ask him to decrypt the file by using the
pre-shared key in the CFY-KSU Cryptography Tool.
ecry t the encry ted file that you have received in your KSU email by using your rivate Key.
1 Download the encrypted file from your KSU email to the desktop.
2 In the CFY-KSU Cryptography Tool, choose the “Asymmetric Key Cryptography” tab.
3 In the Decrypt section, upload the encrypted file.
4 Upload your Private Key.
5 Decrypt and download the file onto the desktop.
6 Open and check the original file.
304
6 - Practice on Digital Signatures
As you learned about Digital Signatures in Session 3, the sender can generate a Digital Signature for a file by first generating
the Hash Value for it and then encrypting the Hash Value with a Private Key. Use the CFY-KSU Cryptography Tool and
practice the Digital Signatures as follows.
Generate a Private and a Public key using the CFY-KSU Cryptography Tool and share the
Public with your class friend.
1 In the CFY-KSU Cryptography Tool, choose the “Asymmetric Key Cryptography” tab.
2 Generate the Public and Private Keys and download them onto the desktop.
3 Share the Public key with your class friend.
(Hint: You can share it publicly or send it through your KSU email.)
Generate a igital Signature for your file using the Y KSU ry togra hy ool and
send it along with the file to your class friend.
1 From “Hash Functions” tab of the CFY-KSU Cryptography Tool, generate the Hash Value for the file.
Download and save this Hash Value onto the desktop.
2 Choose the “Digital Signatures” tab in the CFY-KSU Cryptography Tool.
3 In the Generate Digital Signature section, upload the Hash Value for the file.
4 Upload your Private Key.
5 Generate the Digital Signature and save it onto the desktop.
6 Send this Digital Signature along with your file to your class friend through your KSU email.
Verify a igitally signed file that you have received in your KSU email from your class
friend, by using the CFY-KSU Cryptography Tool.
1 First, generate the Hash Value for the received file. Use the “Hash Functions” tab of the CFY-KSU
Cryptography Tool. Download and save this Hash Value onto the desktop.
2 Choose the “Digital Signatures” tab in the CFY-KSU Cryptography Tool.
3 In the Verify section, upload the Hash Value generated.
4 Upload the Digital Signature received.
5 Upload the Public Key shared by your class friend.
6 Verify the Digital Signature and check the result.
305
Session CRYPTOGRAPHY IN PRACTICE
Apply
As Asymmetric Cryptography is slower and Symmetric is faster, it’s a common practice to use
Activity Asymmetric Cryptography only to share the Symmetric Key and to use Symmetric Cryptography
1 at both the ends.
Use the CFY-KSU Cryptography Tool to send an Encrypted “Symmetric Key” by using
Asymmetric Cryptography.
a - Encrypt a file with Symmetric Key Encryption by using the CFY-KSU Cryptography Tool.
b - Encrypt the generated “Symmetric Key” with Asymmetric Cryptography. Use the Receiver’s “Public
Key” for this encryption.
c - Send the encrypted “Symmetric Key” to the Receiver along with the encrypted file. It can be simply sent
by using email.
d - The receiver needs to Decrypt the “encrypted Symmetric Key” received with his “Private Key.” He gets
the “Symmetric Key,” with which he can decrypt the file easily.
We use Hash Functions for Data Integrity. What if, in the middle of communication,
Activity someone stops the file, modifies it, generates a new Hash value, and sends you the new ones?
2 For this reason, Hash Values are often sent encrypted.
Use the CFY-KSU Cryptography Tool to send an Encrypted “Hash Value” to your class friend
by using Asymmetric Cryptography.
c - Send the file and the encrypted Hash Value to your friend by using your ksu email.
d - Your friend should Decrypt the received encrypted Hash Value by using the Private Key.
e - He should generate the Hash Value again for the file at his end.
f - He should then compare the two Hash Values to ensure complete data integrity.
306