Download as pdf or txt
Download as pdf or txt
You are on page 1of 63

Textbook

CSC204 – Information Technology and


Networking

USEK – CS Dep.
Table of Contents
Chapter 1: Hardware ..........................................................................................................................6
1. Information Systems ......................................................................................................................... 6
2. System units ...................................................................................................................................... 6
3. Hardware Design............................................................................................................................... 6
4. System Unit ....................................................................................................................................... 8
i. RAM, central Memory................................................................................................................... 8
ii. Memories ...................................................................................................................................... 8
iii. CPU ................................................................................................................................................ 9
iv. Performance ................................................................................................................................. 9
v. Extension slot ................................................................................................................................ 9
vi. Connectors .................................................................................................................................. 10
5. Peripherals ...................................................................................................................................... 10
Chapter 2: Application Software and System software ...................................................................... 12
1. Introduction .................................................................................................................................... 12
2. Application software ....................................................................................................................... 12
i. Basic Applications ....................................................................................................................... 13
ii. Specialized applications .............................................................................................................. 15
3. System software.............................................................................................................................. 17
i. Bios (Basic Input Output System)................................................................................................ 17
ii. Utilities ........................................................................................................................................ 17
iii. Device drivers.............................................................................................................................. 18
iv. Language translators................................................................................................................... 18
v. Operating system ........................................................................................................................ 18
Chapter 3: Networks Physical Architecture ....................................................................................... 21
1. Definitions and introduction to networking ................................................................................... 21
i. Definition of Network and networking ....................................................................................... 21
ii. Advantages of networking .......................................................................................................... 21
iii. Disadvantages of networking...................................................................................................... 21
iv. Fundamental Network Classifications ........................................................................................ 22
v. Intranet and Internet Specifications ........................................................................................... 23
vi. Client and Server computers....................................................................................................... 23
vii. Peer to Peer network .............................................................................................................. 24
2. Network topology ........................................................................................................................... 24
i. BUS .............................................................................................................................................. 24
ii. STAR ............................................................................................................................................ 25
iii. RING ............................................................................................................................................ 25
iv. MESH ........................................................................................................................................... 26
3. Networks Peripherals (device) ........................................................................................................ 27
i. Network Interface Card (NIC) ..................................................................................................... 27
ii. Repeater...................................................................................................................................... 28
iii. Hub .............................................................................................................................................. 29
iv. Bridge .......................................................................................................................................... 29
v. Routers ........................................................................................................................................ 30
vi. Switch .......................................................................................................................................... 30
vii. Characteristics ......................................................................................................................... 31
Chapter 4: Privacy, Security and Ethics.............................................................................................. 34
1. Privacy ............................................................................................................................................. 34
i. Primary Privacy Issues ................................................................................................................. 34
ii. Large Databases (Big Data) ......................................................................................................... 34
iii. Private Networks......................................................................................................................... 34
iv. The Internet and the Web........................................................................................................... 34
v. Online Identity ............................................................................................................................ 34
vi. Chip Implants (FDA Approved 2004)........................................................................................... 35
2. Security ........................................................................................................................................... 35
i. Introduction to protection and prevention ................................................................................ 35
ii. Cybercrimes and malwares ......................................................................................................... 35
iii. Measures to Protect Computer Security .................................................................................... 37
3. Ethics ............................................................................................................................................... 38
Chapter 5: HTML language ............................................................................................................... 39
1. Definitions ....................................................................................................................................... 39
2. Creating a Web Page: The Basics .................................................................................................... 40
3. Features .......................................................................................................................................... 40
i. Attributes: ................................................................................................................................... 40
ii. Styling text .................................................................................................................................. 41
iii. Lists ............................................................................................................................................. 42
iv. Special Characters ....................................................................................................................... 44
v. Links ............................................................................................................................................ 45
vi. Anchor Attributes........................................................................................................................ 45
vii. Images ..................................................................................................................................... 45
viii. Tables ...................................................................................................................................... 46
ix. Tables and images ....................................................................................................................... 48
x. HTML Forms ................................................................................................................................ 49
xi. The Input Element....................................................................................................................... 49
xii. Radio Buttons, Checkboxes ..................................................................................................... 50
xiii. <select><option></option></select> ..................................................................................... 50
xiv. Submit and Reset Buttons....................................................................................................... 50
xv. Example ................................................................................................................................... 51
xvi. Adding Audio in web page. ..................................................................................................... 51
xvii. Adding video in web page ....................................................................................................... 51
4. References ...................................................................................................................................... 52
Chapter 6: Mobile application .......................................................................................................... 53
1. Content ........................................................................................................................................... 53
2. Basic forms ...................................................................................................................................... 53
3. Steps – detailed with an example ................................................................................................... 54
i. Step 1: Create project ................................................................................................................. 54
ii. Step 2: connect your phone ........................................................................................................ 54
iii. Step 3: Design your app .............................................................................................................. 54
iv. Step 4: Program the blocks ......................................................................................................... 55
v. Step 5: Test your app .................................................................................................................. 55
4. Resources ........................................................................................................................................ 55
Chapter 7: Excel ............................................................................................................................... 56
1. Spreadsheets fundamentals ........................................................................................................... 56
i. Cells and cell addresses............................................................................................................... 56
ii. Ranges ......................................................................................................................................... 56
iii. Contents of cells.......................................................................................................................... 56
2. Format cells, tables and columns.................................................................................................... 57
i. Formatting a number .................................................................................................................. 57
ii. Display of multiple lines of text within a cell .............................................................................. 57
iii. Copying the formatting to a cell or a range ................................................................................ 57
iv. Column resizing ........................................................................................................................... 57
v. Copying column widths ............................................................................................................... 57
3. Editing ............................................................................................................................................. 58
i. Entering the same data into several cells at once ...................................................................... 58
ii. Filling in data on adjacent cells ................................................................................................... 58
iii. Fill in a series of numbers, dates or other items......................................................................... 58
iv. Automatically fill in repeated entries in a column ...................................................................... 58
4. Functions ......................................................................................................................................... 58
Chapter 1: Hardware
1. Information Systems

• Information system (IS): Any organized system for the collection, organization, storage and
communication of information. More specifically, it is the study of complementary
networks that people and organizations use to collect, filter, process, create and distribute
data.
• Database (DB): A large amount of related data and obeying to static or dynamic
constraints.

2. System units

• Mainframe: Mainframe computers (colloquially referred to as "big iron") are computers


used primarily by large organizations for critical applications, bulk data processing, such as
census, industry and consumer statistics, enterprise resource planning, and transaction
processing. Like IBM Z systems. CDC and NCR Computers.
• Computer, Micro Computer, Desktop: A small, relatively inexpensive computer with a
microprocessor as its central processing unit (CPU). It includes a memory, and minimal
input/output (I/O) circuitry mounted on a single printed circuit board, called the (Central
Unit or Motherboard).
• Laptop: Is a portable computer.
• Notebook: Is a Laptop, fits in a briefcase.
• Tablet, Ipad: Are smaller than notebooks, never including a keyboard.
• Ipod: Is Smaller and never including a GSM (phone) Card.
• Iphone, mobile phone: Are smaller, are Handhelds (may fit in a pocket), always include a
GSM Card.
• Iphone, Ipad, Ipod: have IOS operating system and are Apple trademark.
• E-Reader: Electronic reader, is a device for reading content, such as E_Books, newspapers
and documents.

3. Hardware Design
• System Unit contains all components located on the motherboard:
a) CPU (Central Processing Unit) (Processor)
b) RAM (Random Access Memory) Central Memory
c) Clock
d) Rom (Read Only Memory)
e) Cache memory
f) Bus
g) Extension slots
h) Ports
i) Connectors
• Chips: are small integrated circuits.
• Memories, RAMs, CPUs, Cache memory… all are Active components
4. System Unit

i. RAM, central Memory

• RAM definition: Random-access memory (RAM) is a computer data storage place which
stores frequently used program instructions to increase the general speed of a system.
• Modern RAM is about 4 GBytes.
• RAM contains is a set of boxes called Bytes, each box has its own address between 1
and 4,000,000,000 for 4GB RAM.
• BYTE: Each byte is composed of 8 bits.
• bit: A bit is the smallest memory in the computer, it may be 3 volts or 0 volt. 2 states, 2
possibilities (binary). The first state 3 volts is called 1 for programmers and 0 volt called
0.
ii. Memories

• Memories: Memory capacity is measured in Bytes.


• We have 2 kinds of memories :
a) Permanent memories, like ROM and all storage memories. Like USB Flash Ram, Hard
Disk, Cd Rom, Floppy disk, …
b) Non-permanent (Volatile) memories, like CPU registers, RAM and Cache memory
• ROM: Is a Read only (Unerasable) memory located on the motherboard.
• Cache Memory: is an intermediate memory between CPU and RAM that is used to
speed up searching information inside your memory. It helps speeding up your
computer. Cache Memory is about 256 KBytes, it is larger than CPU and smaller than
RAM. It is slower than CPU and faster than RAM.
• BUS or DATA BUS: are copper lines drawn on the motherboard (replacing old cables). It
is a passive component linking CPU to Cache, to RAM, to ports, to Extension slot, where
information travels from one component to another.
iii. CPU

• CPU: central processing unit or processor. Composed of ALU and CCU. Performs
operations using Registers also called (Words). CPUs have about 100 Registers named
R0 R1 R2 ……. R99.
• CPU Is the brain that may perform 5 kinds of operations:
1. Read (I) and write (O) to Ram or to ports through registers R0 …. R99.
2. Arithmetic operations : + - * / ^.
3. Logical operations : =, <, >. <=, >=, <>, And Or Not.
4. Command : Executes through Register IR (Instruction Register).
5. Control : Go to next line of program through CR (Program counter register).
• ALU: Performs Arithmetic and Logical operations on Registers.
1. AU : Performs Arithmetic operations exp : R0+R1.
2. LU : Performs Logical operations Exp: R0<R1.
• CCU: Performs Command and Control operations.
1. CU Command. Uses IR to execute all the operations one by one.
2. CU Control. Uses CR to jump to next instruction.
• CPU speed is controlled by the system CLOCK and is measured in Hz . Modern speed is
about 4GHz
• CPU family: CPU family depends on the word size or register size. Different brands of
Microprocessors: INTEL, AMD, ARM, RCA, Zilog. INTEL CPUs are MICROSOFT
compatible processors
iv. Performance
Hardware computer performance factors in descending order:
1. Number of CPUs: Mono CPU or Core Duo or I5 or I7… affects the computer
performance.
2. CPU family: Pentium 4 is faster than Pentium 1.
3. Speed: a computer with a clock of 4GHz speed is faster than a computer with 1GHz
speed.
4. Cache memory: A computer with cache memory is faster than a computer without
cache.
5. Ram Size: When the RAM size is too small to contain all the running program. The OS
has to use the virtual memory technique that slows down the execution.
v. Extension slot

• Extension Slot or Expansion Slot: Is a passive component used to extend your


computer: e.g. you may add a new expensive fast VIDEO CARD (VGA) for games . You
buy the external card (e.g. VIDEO CARD) and you plug it in the extension slot. The
display connector will show on the back of the case of your desktop.
• USB port: Modern computers use USB ports for slow peripherals like printers, network
cards or other slow cards, instead of using Extension slots. But they still need Extension
slots for fast external cards like VIDEO CARDS.
• USB: Is a Universal Serial Bus, may be used for different kinds of slow peripherals like
printers, mouses, network cards….
• Fire Wire: For fast video applications, located on cameras and videos.
• Infra Red : Old Direct device for data transfer, replaced by USB cable & Bluetooth.
vi. Connectors
Each peripheral, internal card, and External card has its own connector:
- VGA, Display Connector.
- UTP connector female of RJ45.
- Coaxial connector female of BNC.
- Sound connector.
- Modem connector.
- Mouse connector.
- Keyboard connector.

5. Peripherals

• Input devices (I): For reading information inside CU from peripheral.


1. Keyboard: For text input.
2. Mouse: To choose from a menu by clicking on it.
3. Microphone: For sound input.
4. Scanner and camera: For image input.
5. Joystick: For games.
6. CD Rom: Input from a CD.
• Output devices (O): For writing information from CU to peripheral.
1. Screen: visual output.
2. Printer: On paper output.
3. Speaker: For sound output.
• Storage devices - read and write:
Hard drive: Modern one is about 1 Tbytes, Is a magnetic device.
USB Flash Ram: about 64 GB, electric device.
CD writer: about 8GB, read by light.
Commands to read it: double click on icon, Load, Run, paly.
Commands to write on it: Save, Burn.
• Touch Screen:
I/O device, Used for input and output to the screen.
• Communication devices:
PAN devices: Devices for short distance or Personal use, less than 50m.
Bluetooth, infra Red, USB cable, Fire Wire.
LAN devices: Devices for Local use, distance less than 500 m.
Network card for UTP cable, max 300m, using 8 wires
Network card for coaxial cable, max 500m using 1 wire and a shield.
Network card WiFi: Wlan. 50m.
MAN devices: Devices for Metropolitan use, more than 500m.
MODEM: Modulator Demodulator using the phone line.
Chapter 2: Application Software and System
software
1. Introduction

• Application software:
- Basic applications: General purpose applications (Word processors, spreadsheets,
database management systems, presentation graphics, web browsers), Software suites
and Cloud suites.
- Specialized applications: Special purpose applications (Graphics programs, Multimedia
creation, Web authoring, Artificial Intelligence).
• System software:
- Bios (Basic Input Output System).
- Utilities.
- Device drivers.
- Language translators.
- Operating system (Windows, MAC OS).
You can think of application software as the kind of software you use; you can think of system
software as the kind of software the computer uses.
Software also known as applications or programs executed by the hardware is a set of electronic
instructions to tell the computer (hardware) how to process data and how to perform a task (what
to do). There are two main types of Software: System software and Application Software.

2. Application software

Application software is end user software that is used to accomplish a variety of real-word tasks.
Two categories of application software:
- Basic applications: general purpose applications.
- Specialized applications: special purpose applications.
Also there are Mobile apps that are add-on features or programs designed for a variety of mobile
devices.
i. Basic Applications
Basic applications are general purpose applications widely used in nearly every discipline &
occupation and all career areas.
Competent end users need to understand the capabilities of basic applications which include:
1) Word processors
• Word processors are used to create text-based documents such as memos, letters,
reports, manuals, flyers…
• Most flexible and widely used software tool.
• Word processing programs:
- Microsoft Word (most widely used).
- Mac: Pages.
2) Spreadsheets
• Spreadsheets organize, analyze and graph numeric data such as budgets and financial
reports using Formulas, functions, charts. It is widely used by nearly every profession.
• Excel workbook is a collection of worksheets and charts. The worksheet is a set of rows
and columns, the intersection of which is called a cell.
• Spreadsheet programs:
- Microsoft Excel (most widely used)
- Mac: Numbers
3) Database management system
• A database is a collection of related data (electronic file cabinet) used to retrieve
information easily.
• A Database Management System (DBMS) is a program that structures or sets up the
database.
• It also provides tools to enter, edit, and retrieve data from database.
• All kinds of individuals use databases. Ex. Universities use databases to keep records on
their students, instructors and courses. Organizations of all types maintain employee
databases.
• Relational database is most widely used database structure.
• Data is organized into related tables.
• Tables are made up of rows called records, each containing a number of columns
called fields.
• Database programs:
- Microsoft Access (most widely used).
- OpenOffice Base.
- Corel Paradox.
- Lotus Approach.
4) Presentation graphics
• Presentation graphics are programs that combine visual objects to create interesting
and professional presentations for communicating a message.
• Presentation programs:
- Microsoft PowerPoint (most widely used).
- OpenOffice Impress.
- Apple Keynote.
- Corel Presentations.
- Lotus Freelance Graphics.
• A Software suite (also called productivity suite) is a group of application programs.
The best known is Microsoft Office. Other well-known productivity suites are: Office
Suite, Apple iWork, etc.
• Cloud suites or online office suites:
- Stored at a server on the internet.
- Available anywhere you can access the internet.
- Easy to share created documents and collaborate with others.
- Dependent on the server providing the application to be available whenever you
need it (importance of backup copies).
- Ex. Google Docs, Zoho, Microsoft Office Web Apps.
- Need an account.
5) Web Browsers
• Web browser programs provide access to Web resources. Allow us to navigate, explore
and find information on the Internet.
• Address or location of the resource must be specified: URL (Uniform Resource Locator)
Example of URL: http://www.usek.edu.lb.
• Well-known browsers.
- Mozilla’s Firefox.
- Microsoft’s Internet Explorer.
- Google’s Chrome.
- Apple’s Safari.
• Most commonly used web browsers:
ii. Specialized applications
Specialized applications are special-purpose applications that are focused on specific disciplines
and occupations.
Examples include:
1) Graphics programs
Graphics are widely used by professionals in the graphic arts. They use desktop publishing
programs, image editing programs, and illustration programs.
- Desktop publishing programs: Allow you to create high level publications of
professional quality that mix text and graphics (brochures, newspapers, textbooks).
Popular programs: Adobe InDesign, Microsoft Publisher, QuarkXPress.
- Image editors, also known as photo editors, are programs for editing or modifying
digital photographs. They are used to touch up photographs to remove scratches or
other imperfections. Photographs consist of thousands of dots or pixels (smallest
element of a picture) that form images often referred as bitmap images (.BMP, JPEG,
PNG and GIF). Popular image editors: Microsoft Paint and Adobe Photoshop.
- Illustration Programs, also known as drawing programs: Used to create & edit vector
images. Vector images use geometric shapes or objects (ps, eps, pdf, svg, cgm, swf,
wmf). Popular programs: Adobe Illustrator FreeHand and Microsoft visio.
2) Multimedia creation
Derived from the word “Multi” and “Media”: Multiple media tools that are integrated to
represent things, a form of mass communication. Example: Video (live recording), Audio
(voice and music), Graphics (produced manually or by computer graphics), Animation and
Text, Video games, web presentations.
We consider two types of multimedia:
- Multimedia without user interactivity: User have no control over the content that
is being showed to them like a movie (Ex. Windows Movie Maker – video).
- Multimedia including user interactivity: Users have control over the content that
is being showed to them. Users are given navigational control such as interactive
CD, Digital Encyclopedia (Encarta) Ex. Macromedia Director.
3) Web authoring
• Creating a site is called web authoring, known as Web page editors or HTML editors.
- Provide support for Web site design
- Creates HTML coding
• A website is an interactive multimedia form of communication.
• Popular programs:
- Macromedia Dreamweaver.
- NetObjects Fusion.
- iWeb.
- Freeway.
4) Artificial Intelligence
Artificial intelligence is a field of computer science.
- Mimics or simulates human senses, thought processes, and actions
- Includes reasoning, learning from past actions, and using senses such as vision and
touch
Three areas of AI:
• Virtual reality
- VR is an interactive, computer generated simulated environment with which
users can interact with an animated 3-D environment in real time using data
gloves (tactile) and head mounted computer-graphic displays (audio, video).
- Virtual reality environments are a common feature used in the aviation industry
to train pilots, and now they’re also proving to be a very effective tool in
educating the next generation of ophthalmological surgeons in Medicine.
• Knowledge-based (expert) systems
- An expert system is software that uses a knowledge base of human expertise for
problem solving, or to clarify uncertainties where normally one or more human
experts would need to be consulted.
- Example: Medical diagnosis expert system.
• Robotics
- Robots are machines controlled by "computers".
- Robots are used in factories, manufacturing, home security, the military, and
many other fields.
- Can be programmed to do more than one task.
- Often used to handle dangerous, repetitive tasks.
- Types of robots:
o Perception – imitate some of the human senses.
o Industrial – perform tasks in factories, etc.
o Mobile – can move about and perform tasks.

3. System software

System software is a collection of programs that handle technical details like where a program is
stored, how commands are converted to get processed, where a document or file is saved, how
output is printed.

Types of programs:
i. Bios (Basic Input Output System)
• The BIOS software is built into the PC (ROM Memory) and is the first code run by a PC
when powered on.
• When the computer is booted, the basic input/output system (BIOS) will perform a
check on all of the internal components. This check is called a power-on self-test (POST).
• A collection of software functions for booting that verify the good operation of physical
devices connected to the computer while booting. E.g., keyboard, screen, mass storage.
• This process is known as booting.
• The basic input-output system BIOS is the first thing you see when you turn on your
computer. It makes sure all the other chips, hard drives, ports and CPU function
together.
ii. Utilities
• Utilities are specialized programs that make computing easier.
• Some of the most essential utilities include:
- Troubleshooting or diagnostic programs: recognize and correct problems before
they become serious.
- Antivirus programs: guard your computer against viruses and other damaging
programs that can invade your computer system.
- Uninstall programs: allow you to safely and completely remove un-needed
programs and related files from your hard disk.
- Backup programs: make copies of files in case the original are lost or damaged.
- File compression programs: reduce the size of files so they can be stored and/or
sent over a network more efficiently.
• Windows utilities: Windows has several utilities that can be accessed from the Systems
Tools menu:
- Backup: makes copies of selected or all files saved onto a disk onto another
storage medium protecting us from disk failure.
- Disk Cleanup: identifies and removes unnecessary files such as temporary
Internet files thus freeing up valuable disk space and improves system
performance.
- Disk Defragmenter: locates and eliminates unnecessary file fragments and
rearranges files and unused disk space to optimize operations.
When large files are stored on hard drives, they are broken up or fragmented
into small parts and then these parts are stored wherever space is available.
After a period of time when the hard disk is highly fragmented, the operations
gets slow.
iii. Device drivers

• Are special programs that allow devices such as a mouse or keyboard to communicate
with the rest of the system.
• Device driver works with the operating system to allow communications between the
device and the rest of the computer system.
• Drivers for new devices must be installed before a hardware device can be used.
• Plug and Play (PnP) is a capability developed by Microsoft for its Windows 95 and later
operating systems that gives users the ability to plug a device into a computer and have
the computer recognize that the device is there.
iv. Language translators
• Language translators convert programming instructions written by programmers (high
level language) into a language that computers understand and process. (Machine
language 0-1).
• For example, you may have a C++ compiler that translates the C++ source code into an
executable file the computer can run.
v. Operating system
• An operating system is a collection of programs that manage computer resources,
provides a user interface, and runs applications.
• An operating system is the most important type of computer program.
• Examples:
- Windows XP (2001): Stable, usable, and fast.
- Windows Vista (2007): Smart on security.
- Windows 7 (2009): Introduces Windows Touch.
- Windows 8 (2012): features apps and tiles.
- Windows 10 (2015): “the best Windows yet”.
- Unix (Designed to run Macintosh Computers (APPLE)).
- Linux (Linux is a version of UNIX created by Linus Torvalds in 1991).
• Device type : Desktop

• Device type: Mobile

• Operating system main tasks:


- Managing Resources: Computer resources include memory, processing, input &
output devices (keyboard, mouse, printer, monitor… ).
- Providing a User Interface: users interact with application programs and computer
hardware through a user interface. Most operating systems today use a windows like
Graphical User Interface (GUI) in which graphical objects (Menus, icons, pointer…).
- Running Application: load and run applications such as word processors and
spreadsheets.
- Managing files and folders: The operating system creates a file structure on the hard
disk drive to allow data to be stored. Files are used to store data and programs.
Folders are used to organize files.
• Operating systems categories:
- Embedded operating system: used on handheld devices (Windows CE, PalmOS…).
- Network Operating System: coordinate and manage computer networks (Windows
NT, Windows Server family, NetWare, UNIX…).
- Desktop Operating System: Most commonly used on personal computers.
• Operating system characteristics:
- Multiprogramming: It is the ability to load multiple programs in the main memory
and to share the (one) Processor’s time among these multiple programs.
- Multi-tasking: The computer is capable of operating multiple applications at the
same time. (multiple applications, one user and one processor)
- Multi-processing: The computer can have two or more central processing units
(CPUs) that programs share.
- Multi-user: multiple users can run programs on it simultaneously. (multiple users,
one operating system, network)
- Multi-threading: A program can be broken into smaller parts that can be loaded as
needed by the operating system. Multi-threading allows individual programs to be
multi-tasked.
Chapter 3: Networks Physical Architecture
1. Definitions and introduction to networking

i. Definition of Network and networking


• A network can be defined as two or more computers connected together, either
physically or logically, using special hardware and software, in such a way that they can
share resources.
• A resource may be:
- File.
- Folder.
- Printer.
- Disk drive.
- 125Anything else that exists besides a computer.
• Networking is the term that describes the processes involved in designing,
implementing, upgrading, managing and otherwise working with networks and network
technologies.
ii. Advantages of networking
- Connectivity and Communication.
- Data Sharing.
- Hardware Sharing.
- Internet Access.
- Internet Access Sharing.
- Data Security and Management.
- Performance Enhancement and Balancing.
- Entertainment.
iii. Disadvantages of networking

• Network Hardware, Software and Setup Costs.


• Hardware and Software Management and Administration Costs.
• Undesirable Sharing.
• Illegal or Undesirable Behavior.
• Data Security Concerns.
iv. Fundamental Network Classifications

- Personal Area Networks (PAN):


PAN is a small network around some meters of large, allows the interconnection of
personal machines (portable PC, portable phone).
- Local Area Networks (LAN):
A LAN is a computer network covering a small geographic area, like a home, office,
or building.

- Metropolitan Area Network (MAN):


A metropolitan area network (MAN) is a network that interconnects users with
computer resources in a geographic area larger than that covered by even a large
local area network (LAN) but smaller than the area covered by a wide area network
(WAN).
The term is applied to the interconnection of networks in a city into a single larger
network.
The latter usage is also sometimes referred to as a campus network.

- Wide Area Networks (WAN):


WAN is a computer network that covers a broad area (regional or national
boundaries).
Or, less formally, a network that uses routers and public communications links.
The largest and most well-known example of a WAN is the Internet.

v. Intranet and Internet Specifications


- Intranet:
It’s a private network that is contained within an enterprise.
It may consist of many interlinked local area networks and also use leased lines in
the wide area network.
With tunneling, companies can send private messages through the public network,
using the public network with special encryption / decryption and other security
safeguards to connect one part of their intranet to another.
- Internet
It’s a worldwide system of computer networks
A network of networks in which user at any computer can, if he have permission,
get information from any other computer and sometimes talk directly to users at
other computers.
vi. Client and Server computers
- Server computer is a core component of the network, providing a link to the
resources to perform any task.
The link it provides could be to a resource existing on the server itself or a resource
on a client computer.
- Client computer normally request and receive information over the network.
Client computers also depends primarily on the central server for processing
activities
vii. Peer to Peer network
- A peer-to-peer network is a network where the computers act as both workstations
and servers.
- Great for small, simple, and inexpensive networks.
- In a strict peer-to-peer networking setup, every computer is an equal, a peer in the
network.
- Each machine can have resources that are shared with any other machine.
- There is no assigned role for any particular device, and each of the devices usually
runs similar software.
- Any device can and will send requests to any other.

2. Network topology

- A topology is a way of “laying out” the network.


- Topologies can be either physical or logical.
- Physical topologies describe how the cables are run.
- Logical topologies describe how the network messages travel.
i. BUS

- Bus topology is the simplest physical topology.


- It consists of a single cable that runs to every workstation.
- Each computer shares the same data.
- With a logical bus topology, messages pass through the trunk, and each workstation
checks to see if the message is addressed to itself.
- If the address of the message matches the workstation’s address, the network
adapter copies this message to the system’s memory.
- This topology uses the least amount of cabling, but also covers the shortest amount
of distance.
- It’s difficult to add a workstation.
- If any one of the cables breaks, the entire network is disrupted.
- Therefore, it is very expensive to maintain.
ii. STAR

- A physical star topology branches each network device to a central device called a
hub, making it very easy to add a new workstation.
- Also, if any workstation goes down, it does not affect the entire network.
- But, as you might expect, if the central device goes down, the entire network goes
down.
- Star topologies are easy to install. A cable exists from each workstation to the hub.
And the hub is placed in a central location in the office.
- Star topologies are more expensive to install than bus networks, because there are
several more cables that need to be installed, plus the cost of the hubs needed.
iii. RING

- Each computer connects to two other computers, joining them in a circle creating a
unidirectional path where messages move workstation to workstation.
- Each entity participating in the ring reads a message, then regenerates it and hands
it to its neighbor on a different network cable.
- The ring makes it difficult to add new computers.
- Unlike a star topology network, the ring topology network will go down if one entity
is removed from the ring.
- Physical ring topology systems don’t exist much anymore, mainly because the
hardware involved was fairly expensive and the fault tolerance was very low.
iv. MESH

- The mesh topology is the simplest logical topology in terms of data flow, but it is the
most complex in terms of physical design.
- Each device is connected to every other device
- It’s rarely found, in LAN, because of the complexity of the cabling.
- For x PCs, there will be (x.(x–1))÷2 cables.
- For ex., if you have five computers in a mesh network, it will use 5 × (5 – 1) ÷ 2,
which equals 10 cables.
- This complexity is compounded when you add another workstation.
- For example, your 5 computers, 10 cables network will jump to 15 cables just by
adding one more computer.
- Imagine how the person doing the cabling would feel if you told them you had to
cable 50 computers in a mesh network
- They’d have to come up with 50 × (50 – 1) ÷ 2 = 1225 cables!!!!
- It’s very expensive to install and maintain.
- With this topology, there will always be a way of getting the data from source to
destination.
- Information take an alternate, indirect route if the is a problem on the direct route.
- It is for this reason that the mesh topology is still found in WANs to connect multiple
sites across WAN links.
- It uses devices called routers to search multiple routes through the mesh and
determine the best path.

Top. Advantages Disadvantages


Bus Cheap. Difficult to reconfigure.
Easy to install. Break in bus disables entire network.
Star Cheap. More expensive than bus.
Easy to install.
Easy to reconfigure.
Fault tolerant.
Ring Efficient. Reconfiguration difficult.
Easy to install. Very expensive.
Mesh Simplest. Reconfiguration extremely difficult.
Most fault tolerant. Extremely expensive.
Very complex.
3. Networks Peripherals (device)

i. Network Interface Card (NIC)

• NIC provides the physical interface between computer and cabling.


• It prepares data, sends data, and controls the flow of data.
• It can also receive and translate data into bytes for the CPU to understand.
• The following factors should be taken into consideration when choosing a NIC:
- Preparing data:
In the computer, data moves along buses in parallel.
But on a network cable, data travels in a single stream, as on a one lane highway.
This difference can cause problems transmitting and receiving data, because the
paths are not the same.
The NIC’s job is translating the data from the computer into signals that can flow
easily along the cable.
It does this by translating digital signals into electrical signals (and in the case of
fiber-optic NICs, to optical signals).
- Sending and controlling data:
When two computers send and receive data, the cards must agree on several
things. These include:
a) The maximum size of the data frames
b) The amount of data sent before giving confirmation
c) The time needed between transmissions
d) The amount of time needed to wait before sending confirmation
e) The amount of data a card can hold
f) The speed at which data transmits
In order to successfully send data on the network, you need to make sure the
network cards are of the same type and they are connected to the same piece of
cable.
- Configuration:
The NIC’s configuration includes things like a manufacturer’s hardware address,
IRQ address, Base I/O port address, and base memory address.
Some may also use DMA channels to offer better performance.
Each card must have a unique hardware address.
If two cards have the same hardware addresses, neither one of them will be able to
communicate.
- Drivers:
For the computer to use the network interface card, it is very important to install
the proper device drivers.
These drivers communicate directly with the network redirector and adapter.
They operate in the Media Access Control sublayer of the Data Link layer of the OSI
model.
- Compatibility:
When choosing a NIC, use one that fits the bus type of your PC.
If you have more than one type of bus in your PC (for example, a combination
ISA/PCI), use an NIC that fits into the fastest type (the PCI, in this case).
This is especially important in servers, as the NIC can very quickly become a
bottleneck if this guideline isn’t followed.
- Performance:
The most important goal of the network adapter card is to optimize network
performance and minimize the amount of time needed to transfer data packets
across the network.
There are several ways of doing this, including assigning a DMA channel, use of a
shared memory adapter, and deciding to allow bus mastering.
ii. Repeater

• Repeaters are very simple devices. They allow a cabling system to extend beyond its
maximum allowed length by amplifying the network voltages so they travel farther.
• Repeaters are nothing more than amplifiers and, as such, are very inexpensive.
• Repeaters can only be used to regenerate signals between similar network segments.
• The main disadvantage to repeaters is that they just amplify signals. These signals not
only include the network signals, but any noise on the wire as well.
iii. Hub

• Hubs are devices that link several computers together.


• They repeat any signal that comes in on one port and copy it to the other ports (this
process is called broadcasting).
• There are two types of hubs: active and passive.
- Passive hubs simply connect all ports together electrically and are usually not
powered.
- Active hubs use electronics to amplify and clean up the signal before it is
broadcast to the other ports.
• In the category of active hubs, there is also a class called “intelligent” hubs, which are
hubs that can be remotely managed on the network.
iv. Bridge
• They join similar topologies and are used to divide network segments.
• For example, with 200 people on one network, the performance will be mediocre.
• If you divide this network into two segments of 100 workstations each, the traffic will be
much lower on either side and performance will increase.
• If the destination address belongs to the other segment, a bridge will forward the
packets to that segment.
• They are more intelligent than repeaters but are unable to move data across multiple
networks simultaneously.
• Unlike repeaters, bridges can filter out noise.
• The main disadvantage to bridges is that they can’t connect dissimilar network types or
perform intelligent path selection.
• For that function, you would need a router.
v. Routers

• Routers are highly intelligent devices that connect multiple network types and
determine the best path for sending data.
• The advantage of using a router over a bridge is that routers can determine the best
path that data can take to get to its destination.
• Like bridges, they can segment large networks and can filter out noise.
• However, they are slower than bridges because they are more intelligent devices; as
such, they analyze every packet, causing packet-forwarding delays.
• Because of this intelligence, they are also more expensive.
vi. Switch
• Low-end network switches appear nearly identical to network hubs, but a switch
contains more "intelligence" (and a slightly higher price tag) than a network hub.
• Network switches are capable of inspecting data packets as they are received,
determining the source and destination device of that packet, and forwarding it
appropriately.
• By delivering each message only to the connected device it was intended for, a network
switch conserves network bandwidth and offers generally better performance than a
hub.
vii. Characteristics

• Bandwidth:
The bandwidth is the data rate measured in bits (not bytes) per seconds.
- Kbps (Kilobits Per Second)  125 chars/sec
- Mbps (Megabits Per Second)  1,250 chars/sec
- Gbps (Gigabits Per Second)  12,500 chars/sec
• IP address:
Each interface or network card has an IP address.
An IP address is a series of 32 bits denoted as a.b.c.d
Each value a, b, c or d represents a series of 8 bits or 1 byte.
With a, b, c and d are integers between 0 and 255 since (255)10 = (11111111)2
• Connecting to the Internet:
Requirement:
- A computer or PDA or cell phone.
- An account with an ISP (Internet Service Provider).
- A modem (modulator/demodulator) for dial-up services or a NIC (Network
Interface Card) for DSL/Cable services.
• Home Network (Single machine):

• Home Network (Multiple machine):

• Home Wireless Network:

• Connection Types:
- LAN:
Usually connected using Ethernet

- WLAN:
Wi-Fi (Wireless Fidelity): A wireless technology that connects computers without
cables.
Access Point (AP): A device (base station) that connects wireless devices together.
Usually connected to a wired-network.
- Dial-up Services: Modem
Modulator/demodulator
A device that converts analog signal to digital (modulation) and vice versa
(demodulation)

- Broadband Services:
xDSL (Digital Subscriber Line): A technology that provides digital data transmission
over unused frequencies on traditional telephone lines.
For example, ADSL (Asymmetric DSL):
Download speed > Upload speed
128Kbps - 4Mbps > 64Kbps - 800Kbps.
Need a DSL modem.
Also, a Splitter is needed to separate the voice and data signal.
- WAN:
Spans a large geographic area, such as connections between cities. Usually
connected using telecommunication lines (T1-1.5Mbps, T3-45Mbps) or fiber optic
lines (OC3-155Mbps, OC12-622Mbps, OC48-2.4Gbps).
Chapter 4: Privacy, Security and Ethics
1. Privacy

Collection and Use of People’s Data.


i. Primary Privacy Issues
- Accuracy: Ensure that Data is Correct.
- Property: Who Owns Data and Rights to Software?
- Access: Control who is Able to Use that Data.
ii. Large Databases (Big Data)
- Telephone Companies: Know What Calls We Make, Reverse Directory.
- Supermarkets: What We Buy and When.
- Search Engines: Record Search Histories of Their Users.
- Information Resellers or Brokers: Collect and Sell Personal Data. Create Electronic
Profiles.
- Public, Personally Identifying Information: Google Street View.
- Spreading Information without Consent: Identity Theft.
- Spreading Inaccurate Information: www.annualcreditreport.com.
iii. Private Networks
Employers Can Legally Monitor E-mail
Used by 75 % of All Businesses
iv. The Internet and the Web
- Illusion of Anonymity.
- History Files.
- Temporary Internet Files.
- Cookies: First-party cookies, Third-party cookies.
- Spyware: Keystroke Loggers, Spyware Removal.
v. Online Identity
- Information People Post About Themselves:
Social Networking, Photo/Video Sharing.
Consequences.
- Major Laws on Privacy:
Freedom of Information Act (FOIA).
Gramm-Leach-Bliley Act (Financial).
HIPAA (Medical).
FERPA (Educational).
vi. Chip Implants (FDA Approved 2004)
- Size of a Grain of Rice.
- ID.
- Medical History (1000+ Mexican Patients).
- Secure Access (Mexico).
- Access to VIP Areas (Rotterdam Nightclub).
- “Mark of the Beast” (Virginia).

2. Security

i. Introduction to protection and prevention


• Protection from Unauthorized Use.
- Information.
- Hardware.
- Software.
• Preventing or Limiting Damage from:
- Intrusions.
- Sabotage.
- Natural Disasters.
ii. Cybercrimes and malwares

• Cybercrime
- Hackers.
• Malware
- Crackers.
- Virus.
- Worm.
- Trojan Horse.
- Zombies (Rootkit/ Botnet).
• Car Hacking
- Control Acceleration and Braking.
- Key Fobs.
• DoS (Denial of Service).
• Phishing.
• Cyberbullying.
• Rogue Wi-Fi Hotspots.
• Theft.
• Data Manipulation.
• Computer Fraud and Abuse Act.
• Data Loss: http://www.privacyrights.org/data-breach

• IT Security Threats March 2016:


iii. Measures to Protect Computer Security
- Antivirus:
a) Detects & Identifies Viruses.
b) Inoculates Existing Program Files.
c) Removes or Quarantines Viruses.
d) Creates Rescue/Recovery Disk.
- Restricting Access: Biometric Scanning.
- Passwords.

- Security Suites.
- Firewalls.
- Encryption:
a) Emails.
b) Files.
c) Web Sites (SSL, TLS, HTTPS…).
- Intrusion Detection Software:
a) Analyzes Network Traffic.
b) Assesses System Vulnerabilities.
c) Identifies Intrusions & Suspicious Behavior.
- Anticipating Disasters:
a) Physical Security.
b) Data Security.
c) Disaster Recovery Plan.
- Preventing Data Loss (Backup…).
- System Failure.
- Aging Hardware.
- Natural Disasters.
- Electrical Power Problems:
a) Power Surge or Spike.
b) Surge Protector.
c) Protects Against Power Disturbances.
d) Uninterruptible Power Supply (UPS).
e) Provides Short-term Power.

3. Ethics

• Morally Acceptable Use of Computers.


• Copyright.
• Software Piracy:
- Unauthorized Copying and Distribution.
- Digital Rights Management (DRM):
a) Control Number of Devices that Can Access a File.
b) Limit Kinds of Devices that Can Access a File.
- Digital Millennium Copyright Act.
• Plagiarism.
Chapter 5: HTML language
1. Definitions

• HTML stands for hypertext markup language. A markup language is a set of commands that
tell a computer how to format your document. HTML tags tell a browser such as Firefox, or
Internet Explorer how to structure your Web page.
• An HTML file must have an htm or html file extension.
• An HTML file can be created using a simple text editor such as Notepad.
• HTML is composed of tags. HTML tags are always enclosed in angle-brackets (< >) and are
case-insensitive; that is, it doesn't matter whether you type them in upper or lower case.
Most tags work in pairs; in most cases, both beginning and ending tags are needed.
An ending tag contains the same word as the beginning tag, but it includes a slash before
the word.
<tag> ... </tag>
For example,
<b> is the beginning tag and </b> is the ending tag for bold text.
There are a few exceptions that do not need ending tags (such as <br> for line break) most
tags need to be closed.
• Html basic Document Tags: are the tags which divide up a Web page into its basic sections
(Structure), such as the header information and the part of the page which contains the
displayed text and graphics.
1. HTML: The first and last tags in a document should always be the HTML tags.
2. HEAD: The HEAD tags contain all of the document's header information like the
document title and so on.
3. TITLE: This container is placed within the HEAD structure. Text placed between the
TITLE tags, will appear at the top of the browser's title bar, the history list, and the
bookmark file.
4. BODY: comes after the HEAD structure. Between the BODY tags, you find all of the
items that gets displayed in the browser window. All of the text, the graphics, links…

Basic HTML Structure


2. Creating a Web Page: The Basics

• Step 1: Launch Notepad on your computer, by going to Start- Programs- Accessories


Notepad.
• Step 2: Type the following:
<html>
<head>
<title> My First Web Page
</title>
</head>
<body>
<b>BLAH BLAH BLAH</b>
</body>
</html>
• Step 3: Save the file to your desktop Enter a filename, with the .html or .htm extension.
For example: page1.html
• Step 4: To preview your file: Double-click the file to open it inside your web browser
(Internet Explorer)
• Step 5: After you have viewed your creation, go back to your html code (Notepad –View -
Source). Add italics by typing <b> <i> BLAH BLAH BLAH</i> </b>
• Save your changes in Notepad, and refresh your page in I.E (using the reload button) to see
how these changes would appear on the Web.

3. Features

i. Attributes:
Attributes are optional modifiers placed inside the tags. The values given to the attributes modify
the appearance and behavior of the tag. Attributes are placed inside the tag in the following way:
<TAG Attribute=Value>. Value = text or number for example <Body text=Blue>
• The Attributes of <Body>:
<Body text=color, background=filename, bgcolor=color, link=color alink=color, vlink=color>
Text=color: modifies the color of the text in the document (black by default).
Background = filename: An image to use as the background (.gif,.jpg,.png)
Bgcolor=color: modifies the background color of the document (white by default).
Link =color: modifies the color of all the links in the document (blue by default).
Alink=color: modifies the color of the active links in the document (Red by default).
Vlink=color: modifies the color of the visited links in the document (Pink by default).
• Color Attributes:
Color values are text values that could be represented in 2 ways:
– Color Name (Example: <Body text=“RED”>)
– Color Hex Value (<HR COLOR=“#FF0000”>)
Hex values use a combination of 6 values (RRGGBB) each couple representing a main color
(Red, Green, and Blue).
This combination produces over 16 million colors (16777216 colors) in hexadecimal, the
sixteen "numerals" are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Hexa-Binary: Replace 1 Hexa digit by 4 binary digits.
Examples: 3 5 716 = 0011 0101 01112
(RRGGBB) 16= (24bits) 2
The combination of n bits=2n .n=24 produces 224colors=16777216 colors.

ii. Styling text


The following container tags can be used to add style to any text. Text inside the tags will have
the style applied.
<I> </I> Italic
<B> </B> Bold
<BIG> </BIG> Make text one size bigger
<SMALL> </SMALL> Make text one size smaller
<U> </U> Underline
<S> </S> Strikethrough
<TT> </TT> everything between <TT> and </TT> is in typewriter text (a moonscape font in most
browsers)
To apply more than one style, “stack” tags: <B><I> Bold and italic text </I></B>
<sup>...</sup> superscript: 2 <sup>10</sup> →210
<sub>...</sub> subscript: H <sub>2</sub> O→ H2O
• Font Tag:
The FONT tag, which takes the attributes FACE, SIZE, or COLOR, can be used to control
typeface, size, and/or color of text.
<FONT FACE=”Helvetica” size=”+2” color=red> </FONT>
FACE is the name of the font to use for display.
SIZE can be an absolute value from 1-7, with 7 biggest, the default is size 3.
COLOR follows the six-character hexadecimal or the color name the default is the TEXT
attribute in the BODY or the users’ browser settings.
• Dividing and spacing text: Headings
There are six levels of headings, from Heading 1 through Heading 6. Heading 1 (H1) is
"most important" and Heading 6 (H6) is "least important." By default, browsers will display
the six heading levels in the same font, with the point size decreasing as the importance of
the heading decreases. Here are all six HTML pairs, in descending order of importance:
<H1>Heading 1</H1>
<H2>Heading 2</H2>
<H3>Heading 3</H3>
<H4>Heading 4</H4>
<H5>Heading 5</H5>
<H6>Heading 6</H6>
A heading always begins at the margin of a line and always forces a line break at the end of
the heading. Everything between <hi> and </hi> is boldfaced.
An ALIGN attribute can be added to any headline, with a value of LEFT (by default),
CENTER, or RIGHT.
The headline will be aligned as indicated. The default is left-aligned.
<H4 ALIGN=”RIGHT”> </H4>
• Dividing and spacing text: Paragraph
Perhaps the most used HTML tag is the paragraph, which like the heading adds one line of
space above and below.
Like heading, ALIGN attributes can be added to paragraphs tags. The default is left-aligned.
<P> </P>
<P ALIGN=”RIGHT”> </P>
The division tag <DIV> </DIV> can define areas for alignment but without adding one line of
space above and below.
Like <p>, ALIGN attributes can be added to paragraphs tags. The default is left- aligned.
<Div> </Div>
< Div ALIGN=”Center”> </Div>
• Dividing and spacing text: preformatted and BR
No matter how much whitespace you put between words, whether returns or spacebar
hits, the words will be separated by one space in a Web browser.
But Text in <PRE> </PRE> tags appears preformatted—exactly as typed, preserving all
spaces, returns, tabs, and other whitespace characters usually ignored in markup.
To start a new line without extra space, use the break tag <BR>.
• Dividing and spacing text: Hr
Horizontal rules can be added with <HR>. <HR SIZE NOSHADE WIDTH>
attribute value Description
Left, center (by
align Specifies the alignment of a hr element
default) and right
noshade noshade instead of a shaded color

size pixels Specifies the height of a hr element

width Pixels ,% Specifies the width of a hr element

iii. Lists
Lists are automatically indented. There are three kinds:

1. <UL> </UL> Unordered list.


2. <OL> </OL> Ordered list.
3. <DL> </DL> Definition list.
For ordered or unordered lists, list items are indicated with LI: <LI> </LI> List item (for UL or OL lists)
• Unordered list:
The bullet type of the UL list is defined with a TYPE attribute of SQUARE, CIRCLE, or DISC
(by default). A typical list looks like:
<UL>
<LI>Monday </LI><LI>Tuesday </LI> <LI>Wednesday </LI> <LI>Thursday </LI> <LI>Friday
</LI>
</UL>

• Ordered list:
Ordered lists are automatically incremented for each item. Numerals 1.(Arabic) are the
default, but TYPE attributes of A (Capital letters), a(small letters), I(Large Roman), or i
(Small Roman) can be used to specify letters or Roman numerals. A typical list looks like:
<OL>
<LI>Monday </LI> <LI>Tuesday </LI>
<LI>Wednesday </LI>
<LI>Thursday </LI> <LI>Friday </LI>
</OL>

To start a list from a certain number, add a START attribute.


<OL START=”5” TYPE=”i”>
Nested Lists:

• Definition Lists
Definition Lists: definition lists begin and end with the tags <DL> and </DL>.

Definition lists are delimited by <DT> and<DL>


<DD> tags. <DT> stands for "Definition Term
Term" and <DD> stands for "Definition Data.“
iv. Special Characters
HTML Entities and/or ISO Latin-1 codes can be placed in source code like any other alphanumeric
characters to produce special characters and symbols that cannot be generated in HTML with
normal keyboard commands.
Examples:
&lt; < less than

&gt; > greater than


&nbsp; Non-breaking space

• Comment Tag
The comment tag is used to insert a comment in the source code. A comment will be
ignored by the browser. You can use comments to explain your code, which can help you
when you edit the source code at a later date.
An HTML comment:
<!--This is a comment. Comments are not displayed in the browser-->
• <marquee> tag
You can create a scrolling marquee (i.e. scrolling text or scrolling images) by using the
<marquee> tag. You can make the text/images scroll from right to left, left to right, top to
bottom, or bottom to top - it's your choice!
<marquee direction="left">your scrolling text goes here</marquee>
• Attributes of <Marquee>

Attribute Value Description

Up, down, right, Left


direction Defines the direction of scrolling
(by default)
behavior alternate Defines the type of scrolling.

bgcolor #xxxxxx or color name Specifies the background color


Specifies how many times to loop.
loop number
The default value is INFINITE
v. Links
The link tag <A> is also known as the “anchor” tag. The anchor tag requires a </A> tag.
• Link to Local Files:
The simplest anchor link is one that opens another HTML file in the same directory as the
presently displayed web page. The HTML format for doing this is:
<a href=“ Page2.html"> Click here</a>
HREF defines the destination (hyperlink reference) of the link.
• Link (to a distant file –to the Internet):
The HTML format for an anchor link to an item on the Internet is:
<a href="URL"> Click here</a>
Where URL is the full Uniform Resource Locator, in quotes, the address for the Internet
site where you want to send the viewer.
Example: <a href=“http://www.Usek.edu.lb”> Go to usek site</a>
• Link (to an a e-mail):
Having a link that allows visitors to send email from your website (to send questions or
comments.)
An email link would require the following code:
<a href="mailto:Boutros@hotmail.com"> Email Me</a>
This will result in the visitor's email program opening a new email with your address
already in the “To: field”.
vi. Anchor Attributes
TARGET attribute can be added to a link to select the window or frame where the HREF defined
in the link will be displayed. The default is the current window or frame.
Target=_self (the target will open in the same frame as it was clicked)
Target=_top (the target will open in the full body of the window)
Target=_blank (the target will open in a new window)

vii. Images
To insert an image into the HTML document, use the <IMG> tag. The IMG tag is an empty tag, no
</IMG> is required. The IMG tag has one main attribute, the SRC attribute which should be the
filename of the image (.jpg, .gif, .png..) being inserted
Example: <IMG SRC=“MyPhoto.jpg”>

• Images (Attributes)
The following attributes can be added to IMG tags:
WIDTH image width, in pixels or percentage <IMG SRC="flower.jpg" width=60 >
HEIGHT image height, in pixels or percentage : <IMG SRC="flower.jpg" width=60
height=100>
ALT alternate text <IMG SRC=" flower.jpg" width=60 height=100 ALT= "flower" >
BORDER border surrounding the image, in pixels: <IMG SRC="flower.jpg" width=60
height=100 border=5>
• ALIGN alignment
Align specifies how to align image according to surrounding text.
<IMG ALIGN=BOTTOM SRC="flower.jpg"width=60 height=100>My Flower
(Bottom by default)
<IMG ALIGN=middle SRC="flower.jpg"width=60 height=100>My Flower
<IMG ALIGN=Top SRC="flower.jpg" width=60 height=100>My Flower
• Images Attributes (Align=left or right)
With the align attribute in the <img> tag we can specify to have the image itself aligned to
the right or left margin of the page. But more so, we can have any HTML following it "fill" in
around the empty space.
The HTML to do this is:
<img src="filename.gif" align=right>
<img src="filename.gif" align=left>
One more note. There will be times when the text or other items that are aligned with the
image are rather short and you want to force the next text to jump down below the image.
There is an attribute for the <br> tag to clear the alignment :<br clear=left> <br
clear=right>
• Image Space Padding-hspace in pixels,vspace in pixels
To add more padding or space around your image, add the vspace and hspace to the <img>
tag.
<IMG SRC="flower.jpg" width=60 height=100 hspace=10 vspace=20> flower : <BR>
The part of a plant which holds the seeds <BR>
And which is usually pretty and brightly coloured <Br clear=left > My Flower
• Images and links
To use an image as a link:
<a href=USEK.edu.lb><img src=”cup of coffee.jpg” width=.. Height=…></a>

viii. Tables
A table is made up of rows and cells. Each row needs to have at least one cell.
<TABLE> </TABLE> Table
<TBODY> </TBODY> Table Body
<TR> </TR> Table row
<TD> </TD> Table data (cell- Normal, left)
<TH> </TH> Table header (cell – Bold, Center)
The border=1 attribute in the <table> tag instructs the browser to draw a line around the table
with a thickness of 1 pixel. Border=0 no borders
• Example 1
<table border=1 width=200 height=100>
<caption> Example1 </caption> Example1
<tbody>
<tr>
<th>Row 1 col 1</th> <th>Row 1 col 2</th> <th>Row 1 col 3</th>
</tr>
<tr>
<td>Row 2 col 1</td> <td>Row 2 col 2</td> <td>Row 2 col 3</td>
</tr>
<tr>
<td>Row 3 col 1</td> <td>Row 3 col 2</td> <td>Row 3 col 3</td>
</tr> </tbody></table>
Example 1

• Caption attributes:
1. <CAPTION align=top> (top center by default)
2. <CAPTION align=right>(top right)
3. <CAPTION align=left>(top left)
4. <CAPTION align=bottom>(bottom and center)
• <table> Attributes:
Many other attributes can be applied to the TABLE tag:
Height table height, in pixels or percentage
WIDTH table width, in pixels or percentage
CELLPADDING margin inside cells, in pixels
CELLSPACING space between cells, in pixels
BGCOLOR color of table background
ALIGN alignment of table relative to page
Bordercolor color of borders
• Table (Example 2):
<table border=6 width=200 height=100 cellpading=8 cellspacing=5 align=center
bordercolor=blue bgcolor=yellow> <tbody>
<tr>
<td>Cell1</td>
<td>Cell2</td>
<td>Cell3</td>
</tr>
<tr>
<td>Cell4</td>
<td>Cell5</td>
<td>Cell6</td>
</tr>
<tr>
<td>Cell1</td>
<td>Cell2</td>
<td>Cell3</td>
</tr> </tbody> </table>

• <Table Border Frame=void> means that there should be no outer border.


• <Table Border Rules=none>display external border only
• Attributes for TR:
<TR ALIGN=left| center| right BGCOLOR=#RRGGBB or color name
Valign=top|middle|bottom></TR>
ALIGN horizontal alignment of row contents.
VALIGN vertical alignment of row contents (middle by default).
BGCOLOR color of row background.
• Attributes for TH and TD:
For TR, TH, and TD tags, the attributes BGCOLOR, WIDTH, ALIGN, and VALIGN may be used:
BGCOLOR color cell background
WIDTH width, in pixels or percentage
ALIGN horizontal alignment of cell contents
VALIGN vertical alignment of cell contents
Attributes for TH and TD : Example
<TR>
<th align=right bgcolor=yellow> Once </th>
<th valign=top bgcolor=green> You</th>
<th valign=bottom bgcolor=blue> Set up</th>
</TR>
• Attributes: Rowspan and colspan
For TH and TD tags, two additional attributes ROWSPAN and COLSPAN can be used to
“stretch” cells across rows or columns.
ROWSPAN =number of rows cell should span
COLSPAN =number of rows cell should span
Rowspan and colspan : Example
Here is a small table with cell three stretched across two columns, and cell four stretched
across two rows:
<TABLE BORDER=1 width=100 height=200> <TR>
<TD> One </TD> <TD> Two </TD> </TR>
<TR>
<TD colspan=2> Three </TD> </TR>
<TR>
<TD rowspan=2> Four </TD> </TR>
<TR>
<TD> Five </TD> <TD> Six </TD>
</TR> </TABLE>
ix. Tables and images

• To fill all cells with the same pattern


<table border=3 width=300 height=300 background= “cup of coffee.jpg”>
• To fill all cells in one row
<table border=3 width=300 height=300>
<tr background= “cup of coffee.jpg”>…..
• To fill a single cell a same pattern
<table border=3 width=300 height=300>
<tr > <td background= “cup of coffee.jpg>…..
• To insert an image in a cell
<table…..>
<tr>
<td><img src=”cup of coffee.jpg” width=.. height=…></td>…
• Tables, images and links.
To use an image in a table as a link:
<table…..>
<tr>
<td><a href=USEK.edu.lb><img src=”cup of coffee.jpg” width=.. Height=…></a></td>…
x. HTML Forms

• The <form> tag is used to create an HTML form for user input.
• A form can contain input elements like text fields, checkboxes, radio-buttons, submit
buttons and reset buttons. A form can also contain select menus, textarea, fieldset, and
more elements. Forms are used to pass data to a server.
• <Form>attributes :
Action=URL Specifies where to send the form-data when a form is submitted.
• Method =get | post Specifies how to send form-data.
<Form Method=get Action=Boutros@yahoo.com>......………</Form>
xi. The Input Element

• The input element is used to select user information. An input element can vary in many
ways,
Depending on the type attribute. An input element can be of type:
<input type=text |password |file | checkbox | radio | submit | reset> and more.
<input type= name=“whatever”>
The name attribute specifies a name for an input element. The name attribute is used to
identify form data after it has been submitted to the server, or to reference form data
using JavaScript on the client side
Note: Only form elements with a name attribute will have their values passed when
submitting a form.
The size attribute specifies the visible width, in characters, of an <input> element
The maxlength attribute specifies the maximum number of characters allowed in the
<input> element.
<input type=text name=whatever size=30 maxlength=20>
The value attribute specifies the initial value for an input field
<input type=text name=whatever size=30 maxlength=20 value=M.>
• Input type=text |password |file:
<input type="text" name=x> defines a one- line input field that a user can enter text
into.
<input type=password name=y> defines a password field, the characters in a password
field are masked (shown as asterisks or circles).
<input type="file" name=z> used for doing file uploads in
The <textarea> tag defines a multi-line text input control.
A textarea can hold an unlimited number of characters, and the text renders in a fixed-
width font (usually Courier).
The size of a textarea can be specified by the cols and rows attributes. readonly
specifies that a text-area should be read-only.
xii. Radio Buttons, Checkboxes
<input type=radio name= value=> defines a radio button. Radio buttons let a user select ONLY
one of a limited number of choices.
<input type= checkbox name= value= > defines a checkbox. Checkboxes let a user select ONE or
MORE options of a limited number of choices.
The checked attribute specifies that an input element should be preselected when the page
loads. The checked attribute is used with <input type="checkbox"> or <input type="radio">.
xiii. <select><option></option></select>
The <select> tag is used to create a select list (drop-down list).
<select name= size= multiple>
Multiple specifies that multiple options can be selected
Name specifies the name of a drop-down list
Size specifies the number of visible options in a drop-down list
The <option> tag inside the select element define the available options in the list.
<option value= selected>
Selected specifies that an option should be selected by default
Value specifies the value to be sent to a server when a form is submitted
xiv. Submit and Reset Buttons
A submit button is used to send form data to a server.
<INPUT type =" SUBMIT" value= >
A reset button resets all form fields to their initial values.
<INPUT type =" RESET" value= >
xv. Example
<Html> <head><title> Practice</title></Head>
<Body>
<H3 ALIGN=CENTER> ENQUETE sur la SATISFACTION des UTILISATEURS</H3>
<FORM >
<INPUT type="radio" name="secteur1" value="UNIV" checked>Universitaire <br>
<INPUT type="radio" name="secteur1" value="CNRS"> C.N.R.S. <br>
<INPUT type="radio" name="secteur1" value="INSE"> I.N.S.E.R.M.<br>
<INPUT type="radio" name="secteur1" value="PUBL"> Autre PUBLIC<br>
<INPUT type="radio" name="secteur1" value="PRIV"> Privé<br>
<P align=center> Vos Nom et prénom : <INPUT type="text" name="nom1"
size="40"maxlength=30>
<P> Votre adresse électronique : <INPUT type="text" name="adr1" size="40"maxlength=30>
<P>Je suis belle/beau<INPUT type="checkbox" name="beau" value="beau">, jeune<INPUT
type="checkbox" name="jeune" value="jeune">, riche<INPUT type=checkbox name=riche
value="riche">, en bonne santé<INPUT type="checkbox" name="sante" value="en bonne sante">
<p>Votre opinion <SELECT name="opinion1">
<OPTION>Très satisfait
<OPTION selected>Satisfait
<OPTION>Indifférent
<OPTION>C'est nul !!
</SELECT>
<P> Vos commentaires <TEXTAREA name="com1" rows="3" cols="40"></TEXTAREA>
<P> <INPUT type="submit" value="Envoyer">
<INPUT type="reset" value="Annuler">
</PRE>
</FORM></Body>
</HTML>
xvi. Adding Audio in web page.
The bgsound tag is used to play an audio file when the page loads and has a handful of
attributes to control that audio, including balance, volume, loop and the most important of all,
the src attribute which refers to the file required.
<bgsound balance="value for left/right balance" loop="number of times to loop audio" src="URL
of audio file" volume="volume of audio file">
xvii. Adding video in web page
Video files can be easily included in your pages using the <EMBED> tag.
Important attributes of EMBED tag:
SRC: This is a required attribute and takes the video movie URL as its value.
WIDTH and HEIGHT: Required attributes. They specify the dimensions in pixel values.
AUTOPLAY: Its value can be either TRUE, movie plays when page loads, or FALSE, which waits for
the user to click the play button.
LOOP: Setting this to TRUE (or -1) will play the movie continuously. A FALSE value will play the
movie only once. (loop=1,2,3…)
CONTROLLER: Displays controls. Can be set to TRUE or FALSE.
You may also simply place the URL of your media files (sound, music, and video into the href
attribute of an anchor tag.
<a href="feyruz.wav" title="musique"> Click to listen </a>.
<a href=“film.avi"> click to view </a>

4. References

http://nephi.unice.fr/CoursHTML/
http://www.w3schools.com
Chapter 6: Mobile application
Creating a mobile app – with MIT App Inventor 2 (Android only)

1. Content

• Session 1:
- Brief introduction to programming.
- Basics of MIT App Inventor 2.
- Adding components to the screen.
- Event Handling: Button Click.
- Assigning a value: Label Text.
- Testing the application on a phone.
- Online Tutorial.
• Session 2:
- Small Project.

2. Basic forms

• App Inventor consists of the Designer and the Blocks Editor. These are described in detail
below.
• App Inventor Designer: Design the App's User Interface by arranging both on- and off-screen
components.
• App Inventor Blocks Editor: Program the app's behavior by putting blocks together.

3. Steps – detailed with an example

The steps to build a basic android app called TalkToMe that contains a speech button and a label
are the following:
i. Step 1: Create project
- To start creating an app go to the following website: appinventor.mit.edu
- Click on the create app! button on the appinventor home page.
- You need a google account to log in. This can be a gmail account.
- Click new project on the upper left. Name the app TalkToMe. Note that the app name
cannot contain spaces. The design window will open.
- On the left side, click on the button component then drag it to the viewer and drop it. Do
the same to the label component.
ii. Step 2: connect your phone
- You can see the app on your phone while you are building it. To get your android phone
connected to appinventor, click on Connect menu and choose AI companion.
- In the play store on your phone, search and download MIT AI2 Companion. Start the app
on your phone and click on Scan QR code, then read the code from the computer. Now
your phone is connected in real time to app inventor.
iii. Step 3: Design your app
- Notice that the button has Text for Button 1 on it. To change it, you find on the right the
properties where you can set the properties of all your component in your app. Go to
text and change it to Talk To Me. Notice that it is changed directly on your phone.
- Go to media on the left side, and drag out a TextToSpeech component.
- To specify what the components should do, we click on Blocks on the up right side.
iv. Step 4: Program the blocks
- When you click on Blocks, the blocks editor will open. In the block editor we set the
behavior of the app.
- Click on Button1 on the left side and see all the actions you can do with that button.
Choose when Button1.Click. Then, go to the TextToSpeech1 component, click on it and
choose call TextToSpeech1.Speak and drag it over inside the Button1.Click block. To tell
the speech block what to say, go to Text on the left and that a blank text block and drag it
into TextToSpeech1.Speak. Then type any phrase you like inside that empty text.
v. Step 5: Test your app
- Now you can text the app. Go to your phone and click the button.
- Congratulation! You created your first app.

4. Resources

• Website: http://appinventor.mit.edu/
• Web Application: http://ai2.appinventor.mit.edu/ (need a Gmail account)
• Tutorials: http://appinventor.mit.edu/explore/ai2/tutorials.html
• Mobile Companion for testing: Google PlayStore
• Course: https://sites.google.com/site/wellesleycs117fall11/
Chapter 7: Excel
Excel is a spreadsheet application used to create business programs such as stock, accounting, and
school management…

1. Spreadsheets fundamentals

Before showing how to use spreadsheets, we must first discuss some basic spreadsheets features:
i. Cells and cell addresses
The spreadsheet is divided into rows and columns each labeled with a number or a letter.
The rows have numeric labels and the columns have alphabetic labels. The intersection of a
row and column forms a cell.
Cells are the storage areas in a spreadsheet. When referring to a cell, you use the letter and
the number of the intersecting column and row. For example, cell B7 is the intersection of
column B and row 7. This reference name is known as the cell address.
ii. Ranges
Sometimes it is necessary to specify a range of cells. A range is a group of one or more cells
arranged in a block (cell1 separator cell2) shape that the program treat as a unit during an
operation. Separator (:) means from cell 1 to cell 2, separator (,) means and. Ex.: (B2:D3)
equivalent to (B2, C2, D2, B3, C3, D3)

Relative and absolute addresses:


If you copy a formula or a function which contains addresses, the address may change or not
depending on the presence or not of the dollar sign in the cell address. There are 4
possibilities to write an address: Ex: A1, A$1, $A1 or $A$1. The dollar sign written on the left
of the row or the column address means that the row or the column will not change if you
copy the cell up, down, left or right.
Tip: Press the function key F4 on the keyboard, immediately after writing the address, you
will change this address to an absolute one ($A$1)
iii. Contents of cells

• Each cell can contain: a label, a value, a formula, or a function.


• A Label provides descriptive information about entries in the spreadsheet. A cell that
contains a label cannot be used to perform mathematical calculations.
• A Value is a number entered into a cell to be used in calculations. Values can also be the
result of a calculation.
• A formula is an instruction to the program to calculate a number. A formula generally
contains cell addresses and one or more arithmetic operators: a plus sign (+) to add, a
minus sign (-) to subtract, an asterisk (*) to multiply, and a slash (/) to divide. When you
use a formula rather than entering the calculated result, the software can automatically
recalculate the result if any of the values change. Formulas must be entered without
spaces between the characters.
• A function is a preprogrammed formula. Functions let you perform complicated.
2. Format cells, tables and columns

Formatting a cell is done with the command Format –Cells.


i. Formatting a number
• In Microsoft Excel, the appearance of a number is separate from the number stored in
the cell.
• In most circumstances, although it appears a number is rounding, only the display of the
number is rounded. Calculations that use the number use the number behind the
display.
• You can use number formats to change the appearance of numbers, including dates and
times, without changing the number behind the appearance. The number format does
not affect the actual cell value that Microsoft Excel uses to perform calculations. The
actual value is displayed in the formula bar.
• If a specific format is not defined, the General number format is applied.
• The General format is the default number format. For the most part, numbers
formatted with the
• General format are displayed just the way you entered them. However, if the cell is not
wide enough to show the entire number, the General format rounds numbers with
decimals and uses scientific notation for large numbers.
• Excel contains many built-in number formats you can choose from. To list them, click
Cells on the Format menu, and then click the Number tab. The Special category includes
formats for postal codes and phone numbers. Options for each category appear to the
right of the Category list. The formats appear in categories on the left, including
Accounting, Date, Time, Fraction,
• Scientific, and Text.
• Also you can assign the number of decimal places, the thousand separator, the currency
symbol, the format of negative numbers.
ii. Display of multiple lines of text within a cell
On the Format menu, click Cells, and then click the Alignment tab, under Text control, select
the Wrap text check box. Or at a specific point, click where you want to break the line, and
then press ALT+ENTER.
iii. Copying the formatting to a cell or a range

• Click Format Painter on the Formatting toolbar. Or double-click the Format Painter
button.
• When you finish copying the formatting, click the button again.
iv. Column resizing
By double-clicking on the selected columns. Or Format - Columns (Autofit Selection)
v. Copying column widths
Select the heading of the column that is the width you want to copy, click the Format
Painter button, and then click the heading of the column you want to copy the width to.
3. Editing

i. Entering the same data into several cells at once


Select the cells where you want to enter data. The cells do not have to be adjacent.
Type the data and press CTRL+ENTER.
ii. Filling in data on adjacent cells
Fill in a series of numbers, dates, or other items Microsoft Excel can automatically continue
a series of numbers, number/text combinations, dates, or time periods based on a pattern
you establish. For example, the initial selections in the following table are extended as
shown. Items separated by commas are in adjacent cells.
If the selection contains numbers, you can control whether to create a linear series or a
growth series.
iii. Fill in a series of numbers, dates or other items
Select the cell or cells that contain the starting values.
Drag the fill handle over the range you want to fill.
To fill in increasing order, drag down or to the right.
To fill in decreasing order, drag up or to the left.
Example: If you want the series 2, 3, 4, 5..., enter 2 and 3 in the first two cells. If you want
the series 2, 4, 6, 8..., enter 2 and 4. If you want the series 2, 2, 2, 2..., you can leave the
second cell blank.
iv. Automatically fill in repeated entries in a column
If the first few characters you type in a cell match an existing entry in that column, Microsoft
Excel fills in the remaining characters for you. Excel completes only those entries that
contain text or a combination of text and numbers; entries that contain only numbers,
dates, or times are not completed.
To accept the proposed entry, press ENTER. The completed entry exactly matches the
pattern of uppercase and lowercase letters of the existing entries.
To replace the automatically entered characters, continue typing.
To delete the automatically entered characters, press BACKSPACE.
To select from a list of entries already in the column, right -click the cell, and then click Pick
from List on the shortcut menu

4. Functions

• NOW()
Returns the serial number of the current date and time. If the cell format was General
before the function was entered, the result is formatted as a date
Microsoft Excel stores dates as sequential serial numbers so they can be used in
calculations. By default, January 1, 1900 is serial number 1, and January 1, 2008 is serial
number 39448 because it is 39,448 days after January 1, 1900.
Numbers to the right of the decimal point in the serial number represent the time;
numbers to the left represent the date. For example, the serial number .5 represents the
time 12:00 noon.

• TODAY( )
Returns a number that represents today’s date. The serial number is the date-time code
used by Microsoft Excel for date and time calculations. If the cell format was General
before the function was entered, the result is formatted.
• DATE (YEAR,MONTH,DAY)
Returns the sequential serial number that represents a particular date.If the cell format
was General before the function was entered, the result is formatted as a date.
Year The year argument can be one to four digits. Microsoft Excel interprets the year
argument according to the date system you are using.
Month is a number representing the month of the year.
Day is a number representing the day of the month.
• TIME (HOUR,MIN,SEC)
Converts hours, minutes and seconds given as numbers formatted with a time format.
• YEAR (SERIAL-NUM)
Returns the year of a date.
Serial_number is the date of the day you are trying to find. Dates should be entered by
using
the DATE function, or as results of other formulas or functions.
• MONTH (SERIAL-NUM)
Returns the month, a number from 1 (January) to 12 (December).
• DAY (SERIAL-NUM)
Returns the day of the month, a number from 1 to 31.
• EOMONTH(start_date, months)
Returns the serial number for the last day of the month that is the indicated number of
months before or after start_date. Use EOMONTH to calculate maturity dates or due dates
that fall on the last day of the month.
Start_date Required. A date that represents the starting date. Dates should be entered by
using the DATE function, or as results of other formulas or functions. For example, use
DATE(2008,5,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as
text.
Months Required. The number of months before or after start_date. A positive value for
months yields a future date; a negative value yields a past date. Note If months is not an
integer, it is truncated.
• WEEKDAY (SERIAL-NUM)
Returns a number from 1 to 7 identifying the day of the week of a date.
Return_type is a number that determines the type of return value.
1 or omitted
2
3
Numbers 1 (Sunday) through 7 (Saturday).
Numbers 1 (Monday) through 7 (Sunday).
Numbers 0 (Monday) through 6 (Sunday).
• SUM(NUMBER1:NUMBER2)
Adds all the numbers in a range of cells.
Ex: =SUM(A1:A5), or =SUM(A1,A2,A3,A4,A5) or =SUM(A1:A2,A3:A4,A5)
• COUNT(VALUE1:VALUE2)
Counts the number of cells that contain numbers and also numbers within the list of
arguments.
Use COUNT to get the number of entries in a number field that's in a range or array of
numbers.
Ex: =COUNT(A2:A8) : Counts the number of cells that contain numbers in the range A2:A8
• COUNTA(VALUE1:VALUE2)
Counts the number of nonempty cells.
Use COUNT to get the number of entries in a field that's in a range or array of data.
Ex: =COUNTA(A2:A8) : Counts the number of nonempty cells in the range A2:A8
• COUNTBLANK(VALUE1:VALUE2)
Counts the number of empty cells within the list of arguments.
Use COUNTBLANK to get the number of empty cells field that's in a range or array of data.
Ex: =COUNTBLANK(A2:A8) : Counts the number of empty cells in the range A2:A8.
• MAX(NUMBER1:NUMBER2)
Returns the largest (Highest) value in a set of values. Ignores logical values and text.
• MIN(NUMBER1:NUMBER2)
Returns the smallest (lowest) value in a set of values. Ignores logical values and text.
• AVERAGE(NUMBER1:NUMBER2)
Returns the average (arithmetic mean) of its arguments, which can be numbers or names,
arrays, or references that numbers.
• PRODUCT(NUMBER1,NUMBER2,...)
Multiplies all the numbers given as arguments and returns the product. Ex:
=PRODUCT(A1:A2) is equivalent to =A1*A2 Multiplies corresponding components in the
given arrays, and returns the sum of those products.
• IF(LOGICAL_TEST,VALUE_IF_TRUE,VALUE_IF_FALSE)
Returns one value if a condition you specify evaluates to TRUE and another value if it
evaluates to FALSE. Use IF to conduct conditional tests on values and formulas.
Ex: =IF(A2>=70,"Succeeded","Failed")
Which means that if the content of cell A2 is greater than or equal 70, then we will write
the word “Succeeded”, otherwise we will write the word “Failed”.
• IF(LOGICAL_TEST1,VALUE_IF_1TRUE,IF(LOGICAL_TEST2,VALUE_IF_2TRUE,
VALUE_IF_2FALSE)
Up to seven IF functions can be nested as value_if_true and value_if_false arguments to
construct more elaborate tests.
Example:
If cell A2 is greater than or equal to 90, then we will return an “A”
If cell A2 is between 89 and 80, then we will return a “B”
If cell A2 is between 79 and 70, then we will return a “C”
If cell A2 is less than 70, then we will return an “D”
The function should look like this:
=IF(A2>=90,"A",IF(A2>=80,"B",IF(A2>=70,"C","D")))
• COUNTIF(RANGE,CRITERIA)
The COUNTIF function counts the number of cells within a range that meet a single
criterion that you specify. For example, you can count all the cells that start with a certain
letter, or you can count all the cells that contain a number that is larger or smaller than a
number you specify. For example, suppose you have a worksheet that contains a list of
tasks in column A, and the first name of the person assigned to each task in column B. You
can use the COUNTIF function to count how many times a person's name appears in
column B and, in that way, determine how many tasks are assigned to that person. Note
that to count cells based on multiple criteria, see COUNTIFS function.
The COUNTIF function syntax has the following arguments:
range Required. One or more cells to count, including numbers or names, arrays, or
references that contain numbers. Blank and text values are ignored.
criteria Required. A number, expression, cell reference, or text string that defines which
cells will be counted. For example, criteria can be expressed as 32, ">32", B4, "apples", or
"32".
You can use the wildcard characters — the question mark (?) and the asterisk (*) — in
criteria. A question mark matches any single character, and an asterisk matches any
sequence of characters. If you want to find an actual question mark or asterisk, type a tilde
(~) before the character.
Criteria are case insensitive; for example, the string "apples" and the string "APPLES" will
match the same cells.
• SUMIF(RANGE,CRITERIA,SUM_RANGE)
Adds the cells specified by a given condition or criteria.
Range is the range of cells you want evaluated.
Criteria is the criteria in the form of a number, expression, or text that defines which cells
will be added. For example, criteria can be expressed as 32, "32",">32", "apples".
Sum_range are the actual cells to sum.
Example: We would like to add cells B2:B10 when respective cells A2:A10 is equal to “USD”.
=SUMIF(A2:A10,"USD",B2:B10)
• AVERAGEIF(RANGE,CRITERIA,AVERAGE_RANGE)
Returns the average (arithmetic mean) of all the cells in a range that meet a given criteria.
The AVERAGEIF function syntax has the following arguments:
Range Required. One or more cells to average, including numbers or names, arrays, or
references that contain numbers.
Criteria Required. The criteria in the form of a number, expression, cell reference, or text
that defines which cells are averaged. For example, criteria can be expressed as 32, "32",
">32", "apples", or B4.
Average_range Optional. The actual set of cells to average. If omitted, range is used.
Cells in range that contain TRUE or FALSE are ignored.
If a cell in average_range is an empty cell, AVERAGEIF ignores it.
If range is a blank or text value, AVERAGEIF returns the #DIV0! error value.
If a cell in criteria is empty, AVERAGEIF treats it as a 0 value.
If no cells in the range meet the criteria, AVERAGEIF returns the #DIV/0! error value.
You can use the wildcard characters, question mark (?) and asterisk (*), in criteria. A
question mark matches any single character; an asterisk matches any sequence of
characters. If you want to find an actual question mark or asterisk, type a tilde (~) before
the character.
Average_range does not have to be the same size and shape as range. The actual cells that
are averaged are determined by using the top, left cell in average_range as the beginning
cell, and then including cells that correspond in size and shape to range.
• IF(AND(LOGICAL1,LOGICAL2,…),VALUE_IF_TRUE,VALUE_IF_FALSE)
Returns one value if all arguments are TRUE and another value if not.
• IF(OR(LOGICAL1,LOGICAL2,…),VALUE_IF_TRUE,VALUE_IF_FALSE)
Returns one value if any argument is TRUE and another value if all arguments are FALSE.
• VLOOKUP(LOOKUP_VALUE,TABLE_ARRAY,COL_INDEX_NUM,RANGE_LOOKUP)
The Vlookup function looks for a value in the leftmost column of a table, and then returns a
value in the same row from a column you specify. By default, the table must be sorted in an
ascending order. The V in VLOOKUP stands for "Vertical".
Lookup_value is the value to be found in the first column of the table, and can be a value, a
reference, or a text.
• HLOOKUP(LOOKUP_VALUE,TABLE_ARRAY,ROW_INDEX_NUM,RANGE_LOOKUP)

Working with internal databases:


Field: A field is a column within a database.
Record: A record is a row within a database.
Field name: The top row of a database usually contains field names. It consists of unique text
describing the field.

Database functions:
• DSUM(DATABASE,FIELD,CRITERIA)
Adds the numbers in a column of a list or database that match conditions you specify.
Database is the range of cells that makes up the list or database. The first row of the list
contains labels for each column.
Field indicates which column is used in the function. Field can be given as text with the
column label enclosed between double quotation marks, such as "Salary" or as a number
that represents the position of the column within the list: 1 for the first column, 2 for the
second column…
Criteria is the range of cells that contains the conditions you specify. You can use any range
for the criteria argument, as long as it includes at least one column label and at least one
cell below the column label for specifying a condition for the column.
• DCOUNT(DATABASE,FIELD,CRITERIA)
Counts the cells that contain numbers in a column of a list or database that match
conditions you specify.
• DCOUNTA(DATABASE,FIELD,CRITERIA)
Counts the number of non-empty cells in a column of a list or database that match
conditions you specify.
• DAVERAGE(DATABASE,FIELD,CRITERIA)
Averages the values in a column of a list or database that match conditions you specify.
• DMAX(DATABASE,FIELD,CRITERIA)
Returns the largest number in a column of a list or database that matches conditions you
specify.
• DMIN(DATABASE,FIELD,CRITERIA)
Returns the smallest number in a column of a list or database that matches conditions you
specify.
• PV(rate,nper,pmt,fv,type)
Returns the present value of an investment. The present value is the total amount that a
series of future payments is worth now. For example, when you borrow money, the loan
amount is the present value to the lender.
Rate is the interest rate per period. For example, if you obtain an automobile loan at a 10
percent annual interest rate and make monthly payments, your interest rate per month is
10%/12, or 0.83%. You would enter 10%/12, or 0.83%, or 0.0083, into the formula as the
rate.
Nper is the total number of payment periods in an annuity. For example, if you get a four-
year car loan and make monthly payments, your loan has 4*12 (or 48) periods. You would
enter 48 into the formula for nper.
Pmt is the payment made each period and cannot change over the life of the annuity.
Typically, pmt includes principal and interest but no other fees or taxes. For example, the
monthly payments on a $10,000, four-year car loan at 12 percent are $263.33. You would
enter -263.33 into the formula as the pmt. If pmt is omitted, you must include the fv
argument.
Fv is the future value, or a cash balance you want to attain after the last payment is made.
If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0). For
example, if you want to save $50,000 to pay for a special project in 18 years, then $50,000
is the future value. You could then make a conservative guess at an interest rate and
determine how much you must save each month. If fv is omitted, you must include the pmt
argument.
Type is the number 0 or 1 and indicates when payments are due. 0 omitted at the end of
the period 1 at the beginning of the period.

You might also like