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

Click Start 8 - Unit 1 To 5

ICT

Uploaded by

Brian
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
336 views

Click Start 8 - Unit 1 To 5

ICT

Uploaded by

Brian
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 110

CAMBRIDGE

UNIVERSITY PRESS

Click Start
INTERNATIONAL EDITION

Learner's Book 8
CAMBRIDGE
UNIVERSITY PRESS

University Printing House, Cambridge CB2 8BS, United Kingdom


One Liberty Plaza, 20th Roor, New York, NY 10006, USA
477 Williamstown Road, Port Melbourne, VIC 3207, Australia
314-321, 3rd Roor, Plot 3, Splendor Forum, Jasola District Centre, New Delhi- 110025, India
79 Anson Road, #06--04/06, Singapore 079906

Cambridge University Press is part of the University of Cambridge.


It furthers the University's mission by disseminating knowledge in the pursuit of
education, learning and research at the highest international levels of excellence.

www.cambridge.org
Information on this title: www.cambridge.orgj9781108951944
© Cambridge University Press 2021
This publication is in copyright. Subject to statutory exception
and to the provisions of relevant collective licensing agreements,
no reproduction of any part may take place without the written
permission of Cambridge University Press.
First published 2021
20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
Printed in Poland by Opolgraf
ISBN 9781108951944 Paperback
Cambridge University Press has no responsibility for the persistence or accuracy
of URLs for external or third-party internet websites referred to in this publicat ion,
and does not guarantee that any content on such websites is, or will remain,
accurate or appropriate. Information regarding prices, travel timetables, and other
factual information given in this work is correct at the time of first printing but
Cambridge University Press does not guarantee the accuracy of such information
thereafter.

NOTICE TO TEACHERS IN THE UK


It is illegal to reproduce any part of this work in material form (including photocopying and
electronic storage) except under the following circumstances:
(i) where you are abiding by a licence granted to your school or institution by the Copyright
Licensing Agency;
(ii) where no such licence exists, or where you wish to exceed the terms of a licence, and
you have gained the written permission of Cambridge University Press;
(iii) where you are allowed to reproduce without permission under the provisions of Chapter
3 of the Copyright, Designs and Patents Act 1988, which covers, for example, the
reproduction of short passages within certain types of educational anthology and
reproduction for the purposes of setting examination questions.

Every effort has been made to trace the owners of copyright material included in this
book. The publishers would be grateful for any omissions brought to their notice for
acknowledgement in future editions of the book.
1ntro ducti on
The international edition of Click Start: Computing for Schools is
designed around the latest developments in the field of computer science,
information and communication technology. Based on Windows 7 and
MS Office 2010, with extensive updates on Windows 10 and MS Office
2016, the series aids the understanding of the essentials of computer
science including computer basics, office applications, creative software,
programming concepts and programming languages.

Each level of the series has been designed keeping in mind the learning
ability of the learners as well as their interests. Efforts have been made to
use examples from day-to-day life, which will help the learners to bridge the
gap between their knowledge of the subject and the real world. The books are
designed to offer a holistic approach and help in the overall development of the
learners.

KEY FEATURES

• Snap Recap: Probing questions to begin a chapter and assess pre-knowledge


• Learning Objectives: A list of the learning outcomes of the chapter
• Activity: Interactive exercise after every major topic to reinforce analytical skills and
application-based learning
• Exercise: A variety of questions to test understanding
• Fact File: Interesting snippets to improve concept knowledge
• Quick Key and Try This: Shortcuts and useful tips on options available for different
operations
• Glossary: Chapter-end list of important terms along with their definitions
• You Are Here: Quick recap
• Lab Work: Practical exercises to enable application of concepts through learning-by-doing
• Project Work: Situational tasks to test practical application of the concepts learnt
• Who Am 1?: Biographies to inspire young learners
• Sample Paper: Practice and preparation for exams

The books make learning fun and help the learners achieve expertise in this fast-changing world of
computer science.
ouaruiaw
t
,~~ Snap Recap
Probing questions to I. What do you undcrsrand by lhc
tcnn Open source soflware?
begin a chapter and 2. Which soflware program(.s) do
you generally usc for editing
a document or crcming 3
assess pre-knowledge presentation?

r~iMII!IiC·1m;1=d;W~'ii·1!,1DB~*m'CNm¥11t.
. ~·/
.:,
Learning Objectives You \,. .,_llleam about: '~ r:J'
~anous OpcnOfficc application.s ~
A list of the learning Introduction IO OpcnOfficc Writer ~ -•
::~ c;mponenLo;; of the OpenOfficc Writer
outcomes of the chapter 0
~~;c;crit and Fonnal menus in Open Office
inlroduction to OpcnOffice Impress
creating, _modifying and running a
presentation in OpcnOfficc Impress.

Activity
Interactive exercises
after every major topic to
reinforce analytical skills and
application-based learning

fllin tt..bi.Mks.... ~-
-J
A.

1.(111'Afld~:.brf! ~ .... ttlot

~~ Exercise : ~cr..tur"'~•t•~..:.~;;;;;;;;;~=· ----


The JavaScript files ~ I(J I'
have an extension of .js. ~
and are identified by an •- ..~
~ A variety of questions ..llw==--~~~m.,.,.t~.,..IOI'>'IIoftlll~u,a~~
4.

-R- - ---~--~-
----b~oloedtog/wan.~to~obJf(tJOOIW~
I. Stat.t._wt-...,

l.l'htf.ile-~ot~f!~~OS..ock.

icon iJ'. These files contain just to test understanding l. ~c.w!be~JJf'yrtMT~Mid~('d..,l1>ot~Sonft'VItw


J.Fek~tOI'Uilf~t.tuon.
the code. and no <SCRIPT> tag is
requ1red.

Quick Key
and Try This
Interesting concept-related
Shortcuts and
snippets to improve
useful tips on
knowledge
options available for
different operations
Glossary
Chapter-end list of
important terms along
with their definitions

You Are Here \. Thua.~.JI:~fh·tJOb"*'th.lldoAOCe'J~rocb:ybuc.,.l)lnN~~O


)~JI\tOihc~\~IHnth&:ftciJofiC'Cbnolc."J) .dAJ Wnt£tbrnJ
do:Mn 1n )out rwcbooi.
Summary for a B. Ctc":ut 2}Qb achMl\en'IC'I'It 1n VI~ "-ulbtllc VIIN.;u"~e olpphc.w..,. for one ollhe
idrnuficd job role<- mmllocun1 the lOP 10 ~k•ll• tbt.lhc ~" heed to P'O""':'-"
an order to be rmplo)·.lble. Mili J.f"'C\Cnu.uonon the hrrut.;aUoC~ot'u.:.~.nJAI m
quick recap the C"U~nl \Ccn.&nO. G1"c n.unrlc, from yuur tbil) hk to ~pport IL

Lab Work
.... '
~~ ~
Practical exercises to enable
.. f'"i;
.:--: AQ·!.JB·*"H·i .
Project Work application of concepts
V.<Y\•JI'OIIPI llllV'fii~IOWk.tllfl._ollllcbc .... JOic-.
~r-n..-"
'>Jwdfcw.apc:riodel
.,....arr \-~~«· •*
1 fo~C;,cOrnQG',."(V.!'IIa'IOM«C'IIIc-..rdi10Vrk.

Situational tasks through learning-by-doing


Crnlh'C'wrikr0nr••f"Dik IPIII:JSI*F .. .a~l~ .-:1 ~1<..: "'"') . . . .

-
~V.Ntt.

~rOnt•bodrlipt.ac .,,.-ol:bt~-oktllrrlllCJren(Mfoce
to test practical
"IMIIU!br 0nr•IID~dltle1.1olllld . . ..c,tffubM!Opct.Oer...-c lmpno...
,O.Il::.b('paup>~kl«<IIIC!JP"'ida•~J~-tJcaorrforlbtS.:holoi-.J~a
~pte~•""*oltbc("lau!NIII~cApplo.:.abOG\.
application of the
concepts learnt

PAPER

WHOAMil
l•.uh.fttell....., ~~--~
,_.._........ -*"of,.,.... rrecr-t.·
Sample Paper
Helps to test learners'
,_-
........ ==---!Wih. . . ftl_l'l'<ooo:ls_
.:::_~""- .... -...............,.,.,"'""""v-..-ws
..............~.....~,..,.,..,......,.....,.=~-­
~-----..w..,..,_,.,.I/IJT_...,..

·--. . .
I bot' ~~eencd • :ra-.4 b *'t AdY-=- of hft J. ...... .,. ....._,..._. _ _ . ,__ " ,
~othr.~ta:Wl
understanding at the end of
.=
, ..... INdt' .. ~"''I-C"~Hi.lklr)'-· '~"- -~.._
,_
::011.

the course
o... ...v_
,.,._~....-c.... ...,.,__,
·fj ·EJ
·B ·1:3
WhoAml?
Biographies to
msp1re young
learners
O1 MS Access 2010 .............................................................. 1 O7 Introduction to Python .............................................. 120
o Important database o Creating tables o Features of Python o Operators
terms o Modifying tables and o Writing and executing o Variables
o Functions of DBMS their content commands o Using input() function
o Database objects o Saving a database o How to exit Python for user input
o Creating a database o Opening an existing Shell o Conditional constructs
o Components of the MS database
Access 20 I 0 window o Queries OB More About Python.................................................... 136
o Data Types o Forms o Loops in Python o Jump statements in
o Primary Key o Reports Python
o Changing the View

0 2 Introduction to OpenOffice I ...................................... 32 09 Introduction to Artificial Intelligence ...................... 152

o OpenOffice Writer o OpenOffice Impress


.... o Goals of AI o AI Tools
o Applications of AI o Problem-solving by AI
Domains of AI Limitations of AI
0 3 Introduction to OpenOffice 11..................................... 52 o o

Iii" o OpenOffice Calc o OpenOffice Base 10 Virus and Anti-Virus .................................................. 162
Computer viruses Types of computer
04 Frames in HTML ......................................................... 72 o
o What a virus cannot do
o
viruses
o Frames o Frame tag <FRAME> o How does a computer o Other harmful programs
o Frameset tag o Nested frameset virus spread o Protection against
<FRAMESET> computer viruses

0 5 JavaScript in HTML Documents..............................•. 84 11 Troubleshooting•.•....................................................... 174


o JavaScript o Methods for the window o Computer o Steps for troubleshooting
o Writing a JavaScript object troubleshooting o Common problems and
program o parselnt() and o Why is computer their troubleshooting
o JavaScript variables parseFloat() methods maintenance important?
o JavaScript operators o Areas to troubleshoot

HTML 5 - Introduction ............................................. 105 Sample Paper .............................................................. 185


0B o New features in HTML5 o Attributes in HTML5
o Backward compatibility o Inserting images
o Points to remember for o Inserting audio and
writing HTML5 codes video files
o Tags in HTML5

T r T I) l IJ
MS
ACCBSS
.
, ,

I ·~
2010
. - SNAP RECAP

1. Why do you need to store data You will learn about:


in tables? Give an example.
2. Name some applications you
can use to store tabular data.
• creating a new database in MS Access 2010
• components of the MS Access 2010 window
Introduction • data types and the primary key
A database refers to the • changing the view
arrangement and storage of data in • creating and modifying tables in MS Access
a way that allows it to be retrieved 2010
easily. Microsoft Access is a • saving a database in MS Access 2010
database program that is used for • opening an existing database
storing all kinds of information in • queries, forms and reports in MS Access 2010.
the form of tables, queries, forms,
reports, etc. It has many built-in
features to assist you in constructing and viewing the information stored in the database.
Once the information is stored in the Microsoft Access database, it is easy to find, analyse
and print. This chapter uses MS Access 2010. ForMS Access 2016 updates, go to the
end of the chapter.
Important database terms
Database: A database is an integrated collection of logically related records in the
form of tables. It offers an organised mechanism for storing, managing and retrieving
information related to a particular subject or purpose. For example, a database can be
created for schools, libraries, banks, etc.
Database Management System (DBMS): A DBMS is a set of computer
programs that controls the creation, maintenance and use of the computerised database
by the user. Some examples of popular DBMS software are MS Access, FoxPro and
FoxBASE.
Table: A table is a collection of related information in the form of rows and columns.
For example, the diagram below shows the structure of a School database where
the tables Student, Library and Staff store different pieces of information related to
students, the books in the library and the school staff.

/ School / Database
-----..,;

I Student I I Library I I Staff / Tables

Admission No. Book Code Staff Code


Student Name I Subject Author Staff Name I
Address Publisher Cost Department
Records
Phone Number Issue Date Joining Salary
Class Return Date Date

Structure of a database

Record: A record is one row of a table. It includes complete information arranged


horizontally. For example, the Student table may contain the complete information for a
student, such as Admission No., Student Name, Address, Phone Number and Class.
Field: A vertical column in a table that stores information of the same type. For
example, Admission No. is a field that stores only admission numbers, and Student
Name stores only the names of the students.
Functions of DBMS
A DBMS performs the following important functions to ensure the integrity and
consistency of data in the database:
• Reduces data redundancy: Data redundancy means duplication of data. A
DBMS helps to remove duplicate data. For example, in a library, the name of a book
may occur under the author's name and the ISBN number.
• Facilitates sharing of data: Different users can access and use the same
database. For example, the Admissions department can use the School database for
storing and retrieving Admission No. of the students, while the teachers can use the
same database for retrieving the Student Name.
• Controls data inconsistency: A change in any one file is automatically
updated in all the related files. For example, in a library, if there are two records for
a single book, one under the author's name and another under new stock, the details
might be changed under one record. This may lead to inconsistency as both the
records for the same book would contain different information. A DBMS stops this
from happening.
• Enforces standards: In a DBMS, certain standards can be applied in data
representation, such as the naming, structure and format of data. For example, if
Name of Student is a field in a table, it should be consistent everywhere.
• Ensures data security: The access to any record can be protected in a DBMS.
The files can be accessed only by those who are authorised to do so.
• Maintains integrity: A DBMS maintains integrity by keeping some constraints
when the data is entered. These constraints are rules designed to keep data
consistent and correct. They act like a check on the incoming data.

A relational database management system (RDBMS) was proposed by


E.F. Codd in 1970. It is a type of database where data is organised as related
tables. These databases are more powerful as relevant data can be extracted
and tables extended and modified without having to reorganise the existing tables.
Database objects
The following table identifies the database objects you can use while creating a
Microsoft Access 2010 database:

Table Stores information in the form of rows (records) and columns (fields). For
example, one table could store a list of friends along with their details,
while another table could store their exam marks.
Queries These are used for sorting, grouping or filtering data in the database. For
example, a query might only display a list of students in Class 7 out of all
the school students.
Forms Customised screens to provide an easy way to enter and view data in a
table or query. For example, when you apply for admission in a school,
you fill out an online form. The data that you enter in the admission form
is stored inside the school's database.
Reports These present the data from a table or query in a printed format.
For example, teachers can create a report of all the students opting for
Fine Arts as a subject.

A. Create a presentation on the topic 'Databases and their concepts'. The slides
should include:
1. Key features 2. History 3. Real-life usage
B. List the various types of database programs available along with their latest versions.
C. Think of a Hospital database. What do you think the table names might be in this
database? Suggest the different fields of information in the tables. Draw the structure
of this database using a software program of your choice.
Starting MS Access 2010
Follow these steps to open the MS Access 2010 application.
1. Click on Start button c=> All Programs c=> Microsoft Office c=> Microsoft
Office Access 2010.
2. MS Access 2010 window appears.

Creating a database
In MS Access 2010, a database can be created in two ways:
1. Using a blank database.
2. Using sample templates.

Using a blank database


To create a blank database, you need to follow the steps given below:
1. In the default MS Access window, a blank database is already selected. Also, the
Blank database pane appears on the right.
2. Type a name for your database in the File Name box. The location of your database
appears below this box.

You can change the location of the database by clicking on the ~ Browse icon
in the right pane.

Q Home

81•-w Siat'lkwt-b R.Ktnt Samplt My ttmplatH


~Uio.ISC" data~ templa:.es temptat~

Office.com '"emplates Se.t·ch ~'(.e.com t01 ttmpt.t!es ..

Blank 8,."",.. Sample


~lp database Gon<to, templates
:l-

Email Event Fax Coven F1nancial Food and FOf'ms J


NvtntJon

MS Access 2010 window


3. Click on the Create button. A new database . ;--]
{;(: ~
titled Tablel will be created, as seen in the
Datasheet View (see below). The table has a
The extension of a '\.~~
database file in MS , ., ~
field labelled as ID. The header fields can be Access 2010 is .accdb. • - ~
changed or added by double-clicking on it. '--- .J

~ fx ~ ~~~ f~~
~od;' '-"0 .... 110
loot:..;)\ I) Of' 91 ~.,. . :J ·"'
Proptl'bft ,~

M • l Oll • 1'1 •
T
:..r.oa~ ~--
S..-cb

A new database using a blank database

Using sample templates


1. Click on the Sample Templates in the pane of the MS Access 2010 window.
2. Select the template of your choice, say Faculty, from the Available
Templates section.

Templates ~

I~ :/
Asset:IWI!'b~ CNnt.lbloeCcnnbutlons
~
Cet1:.KtSWtb 0.tmaM:
Wl!'b Oaa~

F•cuny ] c~

Available Templates in the MS Access 2010 window


3. A pane appears on the right as shown on the previous page. Change the name of the
file in the File Name box and change the location of the database using the Browse
button. After clicking on the Create button in the right pane of the MS Access 2010
window, you will get the sample database Faculty List.

{ H A.l<tl'd"'9 I ~, ·,~,Ofl ~ .- Nr" {!jeu~s.] Lfl ~- Rrg~.>;(f


__. ~_, CGPJ i l Ot-mndmg !] A<tf~~ • "" .J1 S.W ~~ • Go To·
P.a~:t J Fon'NI Po)m'ltt f · tr t• ~fi'IO<I .loOf'l ~ T099- ; .:tr ~~ X Dt ttt 8 Moft • PL11d ~ ~CI • D J 1l

Creating a database using a template

Components of the MS Access 2010 window


The Database window has the components (parts) shown below.

Restore Down/
Maximize Ribbon
Close

~
Navigation ,-
Pane
Status Bar

- H ,-:-:c
tof;-:'"""
1 .::-:-,~.~-: :No-:7,._.,: - -------tl1---------·
---:--c, ....... -
II"

Components of a Database window


Title Bar: Shows the name of the database created. The Minimize, Maximize/
Restore Down and Close buttons are also found in this area.
File Menu: The button on the left of the Title Bar. It contains commands like New,
Open, Save and Print.
Quick Access Tool bar: This has some of the most frequently used commands in
MS Access like Save, Undo and Redo. The toolbar can be shifted below the Ribbon,
and more commands can be added to it.
Ribbon: Contains the commands that can be performed on different database objects.
These commands are classified under groups in different tabs.
Navigation Pane: The left pane of the window. Database objects in currently open
or new databases are displayed.
Tabbed Document: The database objects appear in tabs, unlike the overlapping
windows in the earlier versions.
Status Bar: This is found at the bottom of the window and displays the status and
buttons to change the page views.

Data Types
The Data Type for every Field Name describes the form in which the data is accepted.
Descriptions of some of the commonly used Data Type values that appear in the
drop-down list are shown in the table below.

AutoNumber An integer that automatically generates an increasing or decreasing


order of numbers when records are added or deleted. For example,
the roll number of a student can be an AutoNumber.
Text Stores alphanumeric values that is, both numbers and letters.
Maximum 255 characters can be stored. For example, a product ID or
an address.
Memo Used for lengthy text and numbers such as definitions or descriptive
notes. A maximum of 65,536 characters are allowed.
Number Holds numeric data that is used for calculations. Both decimals and
non-decimal digits are allowed.
Date/Time Stores the date and time values in different formats.
Currency Specifies different currencies and displays them in different formats.
Yes/No This can have only one of the two values True/False, Yes/No or
On/Off.
Hyperlink A link to an internet resource.

Commonly used Data Types in MS Access 2010

Setting Data Type


To set a data type for each field, follow the steps given below:
1. Select the chosen field you want to set the Data Type for.
2. Click on the Fields tab ===> Formatting group ===> Data Type drop-down list
(see below). Select the chosen data type from the list. By default, AutoNumber is
selected.

F1elds Table

~ Nomt & Coption R~ Required !"~


0 Un.qut CS
V• lidotlon
~ Indexed
Fteld Vahdabon

:il Tobit!

Setting Data Type

Primary Key
Every table in the database must have at least one field that uniquely identifies each
record in the table. This field is known as the Primary Key. This key should always
have a value that is not repeated for any other record.
For example, in a table of students, it is possible that there are two students with
the same name. Here, you can assign Admission No. as the primary key to identify
each student.
If the primary key is not assigned, it is automatically added as an ID at the time
of creating the table.

You can have multiple primary keys for a table. However, these should
be unique values. To do this you must hold down the Ctrl key and then select
the row selector for each field.

Assigning a Primary Key


To access the Design tab, right-click on Tablel in the left pane, then select the Design
View option.
To assign a primary key to the table fields, select the required field. For example, select
the field and then click on the Design tab ==> Tools group =:::> Primary Key option
(see below).

--~-~-
~~~~~--------------·-
?.:!
Data Type Description
AutoN umber

Assigning a primary key


Select the required field and right-click on it. A shortcut menu opens. Select the
Primary Key option (see below).
tl&_. .. , ~· ' ~atobose3: Om~ (Acco:ss'JJ1J7 -201 Ace .
~,
~
Vi~
...
0 '-"
K
Home

-
~
......
Cftate

~
Pnmary Bu1,dtr Ten \la!td.ltJ On ~
Rulu
External Data

~"' insertRows
~ Oelett Rows
.... Modify lookups
Database Tools

lB lv
Design

Property lnd txes


Sheet
Ei:2 ~
Create Data Rename/Delete
Maaos "' Macro
ct§
R.el4tionshtp s
::B
=
ObJtct
Oependendes
Views Tools Show!H•de Field. Record & Table Events Relationships

All Access Objects


1.-m.
8 «
IP
:l]3

9•1
T~

Field Name Data Type


ALrf't\~umber
Oesaiption .
X

~
Tobles ~
I Primory J>ey
::J Tobld
jl, CU!
c~ ~opy T

Field Prooerties
_j, f ute
Genml lt ootupl
f ield Size ~"" InsMRows
N~Values §i' Qdete Rows
Fo rrNt
Caption ~~ frcperties
Indexed Yes {No Duplicates)
Smart Tags A neld name can be up to 64 Characters long,
TtxtAiign General indud•no spaces. Prtss f1 for help on field
nome<.

Otsign Yt~. ~• Switch ~nes. Fl • Help. I i lll!llllll!!l,fl"

Assigning a primary key using the shortcut menu

A key will be displayed in front of the column name to show that the column is now
working as a primary key in the table (see below).

- -~.-
: £1c~lDG7 ·
-
Crtatt ............ ~tt Too4t
.._ <> 0

- - ·- !1 - ·- :a
-- - -..
}~ m.ttROWI
El !: .../ ~ IJ ~ ~ ::;J

- _..
~~~~
•tdV'
......
"~ttr hklln

--··
CruttO.... ~ t

. ,.
"'

-
!!1.
v- ~R«014&TMkfftftl. -. ,.
:::1 _ -.,
......
AI A(cns Otl1t<U 0•
p f•.-ldN.ant4o _,.,.. ". X

..
r-. AutoNI.Ifl\bet"

:::::1 Ttllltl

Primary key
--
.
~

--
........
.......
.... _
.......
""*'
-
s-.rtl~1
l0ft9~f9"'

THI'to~~
l
..... _c-nM~~~tto .. cNr.ctftl~
I

"""'" ~ ~""""""'· ""'-~


~

II - -
_j I
~""-· "' • Sialllc.OMtt- n • ...,. I a••w:
A column working as the primary key
Removing a Primary Key
To remove a primary key, select the required field and select the Primary Key option
in the Tools group of the Design tab. Alternatively, you can select the field, right-click
on it and then select the Primary Key option from the shortcut menu. The key symbol
appearing next to the respective field will disappear.

Changing the View


MS Access 2010 provides different viewing options for working on the data. The Views
group of the Home tab provides four options in which users can view their data.

1. Datasheet View 2. PivotTable View


3. PivotChart View 4. Design View

The Datasheet View and Design View are the two most commonly used views in MS
Access. The row and column format is seen in the Datasheet View where data can be
added. Descriptions like field names and data types can be added in the Design View.
It is possible to switch from one view to another using the View drop-down list in the
Views group of the:
• Datasheet tab, while switching from Datasheet View to Design View.
• Design tab, while switching from the Design View to Datasheet View.

Creating tables
There are two ways to create a table in MS Access 2010:

Creating a table in Datasheet View


This will give you a blank datasheet with unlabelled columns that looks like an Excel
worksheet. Follow these steps to create a table in the Datasheet View.
1. Open Blank database.
2. Select Fields tab ==:> Views group ==:> View drop-down list ==:> Datasheet
View option.
3. Click on Table in the Tables group in the Create tab.
4. A new tabbed document will be formed. Click to Add field header will be seen next
to the ID field.

[:] a u
Ext<mal Data Databas• Tools Fl<lds Tabl•

!a ~ D ~~::::~ [;l R<port WIZard ~ o$: Modu l<


'--' ~ lab< IS J tJ Clm Modul<
~t~~~n ~=~~ ~More Forms "' Mac.ro ~ Visual Basic
R<port R<port Slank
Form Design Report
Forms Macros & Code

(Ne w)
Cl Tabid

1 of 1 "

Datasheet View option

5. Click on the field header and select the data type. Add the data to the fields.

.
1 11.~ ·Home·I .

~
.
V1ew
AB
Tut
12 ~
Create

Number Currency
Ext• rnal Data

:s::>Dat• &Tim•
f.' Yt S/NO
!u Mor• Fi<lds •
,
Data bas• Tools

Dtltt•
- ..
~ Namt & Caption
';\ Dtfautt Valu•
t'J Fi<l d Sin
~

Ft<lds

2SS
Tabl<
11'6mbase3: Dmbase (Access 2007 · 28idJfMiCIOSijf Aced

J.~
qoo
<:1"

·tod
j~ l:iliT
".!.:mo
looL.ups borus•on Sdt•ngs
Data Typo: Tut
Fo;.' 1.:.

o;:j% '
F, •t•
~J .~
9
.
.
0
0
0
R•qw td
Untqu•
lndu<d
L

~
.
Validation
~~·

Vlt\VS Add&Dtltl< Properties Formattmg Faeld Vahdabon

::I Tabltl ~ ::I - ------....,


All Access Objects
e lp'' . . .
X

1~5<-Jtd\.. 10 Name SUbje ct • crtektoAdd


Tllbles ~ I 1 Sarah
2 John
Computer
English
::I Tabid

=:! Tabl<2 .!.. (Ne w) I

Record: t• • 3 of 3 ., .;, No F1lter SNrcll


Oatashttt View I l r~ ~~~: ..

Creating a table in Datasheet View


Create a table in Design View
With this option you define the structure of the table by specifying the field name, data
types and properties for each column. This is the most common way of creating a table.
Follow these steps to create a table in the Design View.
1. Open Blank database.
2. Select Fields tab ==:> Views group ==> View drop-down list ==> Design View
option.
3. The Design View window is divided into two parts: Field Grid pane and Field
Properties pane. These are discussed below.

~- OoocripOon

--------~-
-._ Field Grid
pane

Creating a table in Design View

Field Grid pane: This pane is used to define the fields in the table along with their
data types and an optional description of the field. You can change the data type of the
field in this view.
Field Properties pane: You can give additional properties to the field name using this
pane. It is used to specify the field properties in detail such as field size and validation.
Some of the commonly used options that can be filled in the Field Properties pane are
explained in the table below.

Field Size Used to set the maximum size for data stored in the field set to
the Text or Number data type.
New Values Used to set the order of numbers in the fields either in an
incremental or random order.
Format Allows you to display data in a format which is different from
the way it is stored. For example, you can choose a predefined
format or other symbols for creating a custom format to define a
currency.
Caption Used to display an alternative name for the field to make it more
explanatory.
Indexed This speeds up sorting but may slow down the database.
Smart Tags Adds tags like date, telephone number, financial symbol or
person name to the field. Each tag is associated with an action or
a list of actions.
Text Align Used for the alignment of the text entered in the field.
Some of the Field Properties in MS Access 2010

4. Enter the required information in the Field Grid and Field Properties panes in the
Design View window (see below). Use the Tab or the Enter key to move through the
different fields.

Home Crute Exte:m11 Data Database Toots Ors•on

Description
Aut oN umber ll

=:I Tab ltl


Name Text
Subject
::l Tablt2
Roll no

Format
Input Mas k
Ca ption
Default Value
Valtdatlon Rule The &U type d ett rmJnes the bnd of ntues
Va ll&tionltxt that users can store in the flt ld. Press fl for
R.equirtd No help on data types.
Allow Zero Length Yt s
Indexed No
Unicode Compression Yes
IMEMode No Control
IMESentence Mode None

Filling the field information

5. Assign one of the fields in the Field Grid pane as the primary key. A key will be
displayed in front of the column name to show that the column is now working as a
primary key in the table (see the figure on the next page).
~ ~ :.J
ObJtct
Primary 1ependend es

key
uataType Description
AutoN umber
Text
Text
0 Tlblt2
Number

General lookup
Fat ld S&:t longlnttgtr
New Values lnatmtnt
Format
Capt1on
Indexed Yes (No Ouplocotu)
Smart Tags A field name an bt up to 64 chiradtn lono.
TotAh gn Gtntrll induding spaces. Press Fl for help on field
n.mu.

A column working as a primary key

Modifying tables and their


i
~(': )
'---'
content A field name in the ~~
Tables created in MS Access 2010 can be database can have a \ ., ~
modified in the Datasheet view. Data types can maximum of 64 characters _._ 9
be changed and columns/fields can be added, in upper, lower or mixed case; letters,
deleted, moved and renamed. numbers and some special characters
The different groups in the Fields tab can be can also be used. However, it cannot
used to modify the table and its contents. have brackets or a full stop and it
cannot start with a blank space.

, _,
·::.- ·

:E j~ r;ii)T ,o::~r. AutoNumber


_,...... f ounan n9

l.~~:up1 b~~~ •on M~~~:g~ • ~ % ~ :A .~


Prooerun Foter.tano f~ldV~

AIAccoss Ob)Kts (3 « ::I T->-':J T*"l~\:":::-:----;::;:::=----::;;:::--:::;:~:-:;:------------------x"tt


~-~-~=====-P::.,I~ 10 • Nome Subjoct • RoiiNo • Clldc roAdd •

T.....
~ T•bld
• • -
:J Tabl~

Rtc.Ofd:. M 1 o1 1 • N • ., Uo Folttr StitCh ----


l i:O • • "'

Fields tab
Changing Data Types
1. Select the chosen column header.
2. Click on the drop-down list next to the Data Type option in the Formatting group
and select the chosen option.

Inserting a new field


1. Select the column header where you wish to insert a field.
2. Click on the chosen field option in the Add & Delete group of the Fields tab.

Deleting a field
1. Select the column header of the field you wish to delete.
2. Click on the Delete option in the Add & Delete group of the Fields tab.
3. Click on Yes in the Microsoft Office Access dialog box.

Moving a field
1. Select the field to be moved. A thick blue
J.
~r: .
'--"
line appears along the left edge of the
Deleting records is ~'- ~~
field.
permanent. It cannot be ,~
2. Hold the left mouse button till the cursor reversed through an Undo .,._ •
changes to ~. operation.
3. Drag and drop the field in the desired
location.

Rows in a table can also be moved using the above steps.

Renaming a field
1. Select the column header whose heading you want to change.
2. Right-click on the column and click on the Rename Field option.

I
Select a column/field. Click on the drop-down arrow next to the column I

header. Sort the data in the column as required. '" j


Design a database for a shop, with three tables named Item, Order and Customer. Add two
columns in each table as shown below. Enter at least eight records in each table.

Quantity in Stock Number Item Ordered Number Order No. Number


Rate per Item Currency Customer No. Text Amount Currency

Saving a database
1. Click on the File menu.
2. Select the Save Database As option from the drop-down list.

liils.vt
lil SOvt Objt<l As
Information about Database4
C:\Users\CYpuset\Doc:uments\Database4.accdb
~so..-
~
~ Opon Save
>ct & R~pair
Database As tent and corrKt databa"' file problems by using Compact and Repair. Y•tw and gdjt database proprQ!tt
~ DmbosM.accdb
~ D~db
option
~ ~cdb
~ FK\Aty.aa:cl) Encrypt with Password
u.., a password to r~ct access to your data~. Files !hat~ w 2007
Info Microsoft Access file format or lat~r ar~ encrypt~.
Encrypt with
Password
Recent

New

Print

Save & Publish

Help

.:l OpQoftS
D Elli

Selecting the Save Database As option


3. The Microsoft Access dialog box appears. It seeks permission to save all the
opened objects before saving the file. Click on Yes.

liil .....
Information about Database2 ·- ~ ~ :: . .....
i\, Savt Objtd As
!£) Savt Database A1
C:\Uws\TEMP.cupuser·PC\Documents\ Ort.bueUccdb
t-
Comp01ct & Rltp.alr

'*
LJ' Oost Databut Help prevmt and corr~ databu t me probltms by using Compa,tt and
Re~ir.
@ O&l!Wisrl_.«db Comp~ct&
Rep.iirDahb.ue
@ DatibiSd..tCCdb

Rocent
'i All open objects must be cJos,ed boefore you Ave the database. II
New Oo you wantMiaosoftAca:s:s todoseal ooenobjects?

Print ~ ~

Save & Publish

Htlp

Microsoft Access dialog box

4. The Save As dialog box appears. Select the chosen location for saving the file and
enter the file name in the File name box. Click on the Save button.

@ MicrO<oftAcc.., ~· Documents library Arrange by. fokltr ..


Includes: 21oull0f'l~

*1::1 Favontcs
O.SI:top
E Name O~e mcdifitd Type

,.t. Downloads My Btuttooth B.o9·2019ll:30 F1lt fokltr

~ Recent Pllcts ~ Ombuel 13-09·2019 U:0-4 Mic~

@)Oatabl:~el
Save
button

... Htdefoldm Tools· ~ ~

Save As dialog box

Opening an existing database


A database saved in MS Access 2010 can be opened by following these steps:
1. Open the MS Access 2010 window.
2. Click on the File menu and select Open from the drop-down list.
3. The Open dialog box appears. Select the location of the database in the left pane
and enter the name of the file in the File name box. Select the file extension from
the drop-down list, if required. Then click on the Open button.

@ ""....,."''"' • Documents library

D•tc mo<fdicd Typt


U·O!H0191HO I"
lJ.Q9.lQ1914:1>& ( Open
13-<19·201914..)2

:'. litw¥MS
GOo<...-
button
•' """'
.: PJCtuta
A,..._
- 1- • - - ·I
Took · ~~

Open dialog box

Queries
A query is a question relating to the data with a specific answer to it. It is a way of
retrieving specific information from single or multiple tables of the database.
Follow these steps to raise a query in MS Access 2010:
1. Open the database.
2. Click on the Create tab and then select the Query Design option in the Queries
group.
--- -- ( ] .;: Modutc
Oa.ssModuJc
Appk(.atlon
Patt1· Mkro ~Vts\UIS..II(
Ttr~~"t&t~ Maaos&Codc
AJI Access Objtcts e « j
-=::~ ·- X

s..m.. p F1eldNam1t Data Type Oesaiption


ii
Tobles
Cl Tabid
• ' 10
Name
AutoNumber
Toxt
Subj~ Toxt
:::1 Tablt2
RoliN~ Numt>.r

l'
~'"'"~li·otuo

··-
fleiCISi::t

...........
DcdeMAHH

C.pbon
....
v_...,
Od.uttvatuc

..
AhridNmtQn~UPtO ... c:NfKttn tonQ.

........
V~61bont~

~tttd No
--·
~SP~U't . FttnflfOtNipontfdd

,.,......,
s..rt Ta91

II
ICe a ·"

Queries group in the Create tab


3. The Show Table dialog box appears. In the Tables tab, select the table from the list
of tables created and click on Add.
4. Repeat the same step to add more tables. Click on Close after the required tables
have been added.
5. The Query tab opens. The upper pane displays the tables selected. The lower pane
represents the Design Grid.
~~· r-• 'I' o.e....s. ~o.c...~.u.'l!t11·2010)·lollooloft~ : !i' !!...
oO
~ ";,,_ ~· cit"~ ;--·; ~ :::J --·~-· - - :l"'-9Ml0n·
:::1 -
.J Q............
,j~ U
..,.._
oCIInYO«At

-
~~ :::,~~ ~:::. ,_~~=a....,,,_, . ~==

·-
Micro !!J'<I'»>MMa-t
.......
rt.,wtel 1161*1

. . Qucton .
-·~ .
.
.
.UACunObftel:J ~
,_
""""" JJ
....,.... ~

::::l-· T-'e io.-'"1.... ]

L_
!

010~
•'· .

~I.
Gl

0 0 0 0 0 0 0 0 0

- Show Table dialog box and Design Grid pane


I ......I

Design Grid pane: The portion of the Query tab where fields and criteria for the
query are added.
Some of the commonly used options that can be filled in this pane are explained in the
table below.

Field Shows the fields in the selected table to be included in the query.
Table Displays the name of the table from which the field has been added.
Sort Determines the sorting order of the data in the datasheet produced by the
query.
Show A checkbox that shows or hides the fields.
Criteria Specifies the condition on which the query will have to be answered.
or For specifying alternative criteria on which the query will be resolved.
Design Grid properties
6. Click on the down arrow in the Field property boxes and add the fields in the chosen
order: The corresponding name of the table will appear in the Table property.

Click on the table name with the asterisk (*) symbol in the drop-down list,
to add all the fields of the table to the query. You can also double-click on a
field name in the upper pane or drag it to the chosen box to add it to the Field
property in the Design grid.

7. Sort the data in the selected field based on your preference using the Sort property.
8. Specify the criterion for the query in the Criteria property box. Add multiple criteria
in the property box.
A ") •

...........
~-·
AIAcuss~

-
ll6tkt: frprl: (btployu ) &pt2: tJti<OMtl b:ptl: [lonuiJ [Xs:ltnd4uru
Tete: Tabid

,_ ~ 0 0 !::! !:I
c.t-
oc

....,
Design grid filled for the query

If required, click on the Save As option from File menu to save the query.
To run a query
Follow these steps to run a query:
Click on the Design tab ===> Results group ===> Run option.

Home Crute External Data Database Tools Design

! '[§11LJ! +! ~ [J 1<,
CDUnoon
• ~ Pau.Through
b ~-a Insert Rows
:"' Ot.cte Ro• .s
"'131" Insert Columns
':Jf Delete Columns
~
L
~
L ?
.]
!!f
..,,
Property Sh«t
..J! Table Na111es'
Run Select ~~~: Append Update Crosrta:b Otlde ~Data Otf.nrt•on ~R<turn: All
Totals Parameters

Show·'Hadt

Tobie! Toblel
Tabla

~
::J Tabid 9 10
:::J Tablo2 Name

LJ
Field: GJ
Subject
Roll No

Show:
Criteria:
EJ 0
or.

Run option

The result for the query appears in the Query window in the Datasheet view.

When two or more criteria are written in the Criteria property line,
the result will show only those entries where all the specified criteria
are met. However, when the criteria is specified in the Criteria and
'or' property line, then the result will show entries where either of the criteria is
met.

Forms
Forms are customised screens for viewing, entering, modifying and deleting data in a
table or a query. You can create a form in MS Access 2010 using the following steps:
1. Open a database.
2. Click on the Create tab ~ Forms group ~ Form option.
.
l ilii' Homt f Crute f Exttmal 01t1 Oatabut Tools Fltlds
"

Tablt
- :..._ '""'==''-
~
~ [§~ Cl ~~ iE ~ LJ (]Nmoation•
~For~Wiard
~
U li_. Rtport Wt:•rd ~ ~ Modult
~ ~ UibtiS ~ O.uModult
......
Appttutlon

TtmpC.t u
Tllblt Tablt SNrtPolnt QutiY Qut!y
Ots~n
Tlblt s
Usts• W\3rd Dtslon
Qut hU
Form o',~:n ~~= ~Mort fornu ..
Forms
Rtport Rtport Slink
Otslon Rtport
Rtports
t.tmo ~VI:su.l 8ulc
~cros&Codt

All ACCt$$ Objt<ts 0 « w ,_\. X

;s.-.. IP 10 - ctcktoAdd
T.t.lcs
Cl Tal>ltl
• • (New)

Rtcord: M 1 of 1
o.t.sh«t vttw
" "- No Flltrr . Surch

I li ~D"

Form option in the Create tab


3. The form title is the same as the table chosen. It opens in the Form View.
4. Move through the different pages of the form using the Navigation bar.
ID~.., . . ... :~(Acc.ss2007· .... . c;o, ffi--e@:!
~. ~-· ·-~t::;.;.~--burnt~O•-;;- ~- J.nan9f
- - ~ ~o "J
OtttbmToou 'Of'"M

~ Q ~ c:::J _J _m 17
}ll...
3 [M [i)fonu.
ljc..., . \.s fibT Aa _] g [TIJ . ::J ..(lflttt
::; .,__j
~

.......
Tht~tl

'nl.fi!ICI
:::>0

COIItiOI
-: tNt "
·~· ·
~DI'lt•nd Tlrllt
l'fUCit• ·Pooltl
f1tKIJ
....
).odt:ldrtu'I9Pr~tty

''"~
-
All Acctn Objtas . " ::l •- 3 - X

"""'-
T- •
p
::J Tablel
-
~
::l•-· N ... ,~•r (New) l

Layout Design
View View
Navigation '
Form i
bar
11fr...c:: . - -- View
-
·-- H
"" ~ No S.wd>
~
Creating a form
5. Save the form using the Save As
option in the File menu drop-down
list. G'----"' ~
6. You can change the view of your You can make changes to the ~ ,:; <.~
form using the icons given in the content of the form. Right click ~~
Status bar. The Layout View can on the logo or the title of the .._ .,.
be used to change the layout. A table and select Properties from the
style can be selected from the shortcut menu.
Auto Format group of the Format Make the required changes in the Property
tab. The Design View can help in Sheet pane on the right side of the screen.
changing the design.
Reports
Reports are the representation of data in a printed format. The size, appearance and
layout of the print can be customised based on the requirements.
Follow these steps to create a report in MS Access 2010.
1. Open the database. Select the table or the query for which a report has to be created.
2. Click on the Create tab ==> Reports group ==> Report option.

Report option in the Create tab

3. A report is created by Access and it will appear on the screen.

Home Crute Exttm JI D1t1 Oat1b1st Tools

Add Exln ano Property


f lt lds Shu t
Thtmts Group•no & Totals ==-------.:.:Co::::.ntr:,::ol:....•_ _ _ _ _ _ _.___;.HtldtJ Foot tr Tools

All Acctss ObJtcts


i.stotth.. y P« ::1 T~-...__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ X
,....---~- u

lllr.T~ob~
ln--------~~~~~
30 S•pt•mb•r 2019
::J Tlbltl
Tablel
17:41:53
Forms
10 \:ame Roll "o
::ID Tobltl

6 = .---1
..JI.[Reema Design
2 Asha
--------------~ Layout View
3 Jay
14
View
Print
Form Preview
View - - --
Lltout Vltw

Report created for the selected table


4. Use the Layout View in the Status bar to format the report.
5. Use the Print Preview to see how the report will look on paper when printed
(see below).
6 . Print the report using the Print option in the File menu drop-down list.

r=.· -· Print Preview r


atobase4 : Datobase (Access '1N1 • 2010)~krosoft Ace
a

~]
~ IJ DO I"' ShO\' Margms

~lo ~pe ~ ~ ~rnw ~ ~~ -


~....1 ~~ ~ ~
.
til
Pnnt
.
Size Mar~ms Print Data OnJy Cgns
Setup
Zoom
...
One
Page
Two More
Pages Pagep·
Refresh Excel
;.u
Text
File
POF E-mail More
orXPS
Close Pr1nt
Prtvin v
Pnnt Page S1U Page Layout Zoom Oat• Clost Prmtw

All Access ObJects


I!S<crdl-

IP
~ Tab!>~ Cl T*-1
.
X

Tables ~ !
;:n Table!
Forms ~I CJ Tablel 30 September 2019
I!
SJ Table! 17:43:38

10 Name Roll NO

I lii Reema II 11 1
!
I 2 11 Asha II 12 1

I 3 II .Jay II 13 1

I 4 11 Adil II 141

I AI

Ready
Pige: 1 .". -~ No Fllttr I I•
I

I eilll\SI 'i: LOO% 0 - 0 - - \ ± ) ·"
~
...

Print Preview of the Report

A query has been generated for a group of related tables in a database. Is it possible to
get a hardcopy of the query? If yes, suggest how.
B. Create a table with the records of sports lovers in your class using MS Access 2010.
Use different descriptive fields such as Student Numbers, Student Names and Favourite
Sports with appropriate data types. Set a unique primary key for the table. After the
table is created:
1. Enter at least 10 records in the table.
2. Change the address of record 3 and favourite sport of record 6 in the table.
3. Delete the last record from the table.
4. Create a query based on the favourite sport. For example, create a query to display
only football lovers.
5. Generate a report for the table.
6. Create a form and enter a new record into the table.
7. Save all changes made to the table.
8. Close the table and the database.

Data type The format in which the data is accepted.


Database An integrated collection of logically-related records in the form of tables.
Database objects Components (parts) of MS Access.
DBMS A set of computer programs that control the creation, maintenance and the use of
databases in the computer.
Field A column arranged vertically in a table that stores information of the same type.
Form A customised screen for viewing, entering, changing and deleting data in a table
or a query.
Primary key A unique value that identifies each record in the table.
Query A question about the data with a specific answer to it.
Record Includes complete information about a particular record arranged horizontally
in a table.
Report The representation of data in a printed format.
~ Table A collection of related information in the form of rows and columns.

G~
~~-/'-----1
1. Microsoft Access 2010 is a database program used for storing information
in the form of tables, queries, forms, reports, etc.
2. A DBMS reduces data redundancy, makes file sharing easier, controls data
1 inconsistency and enforces standards.
3. A new database can be created either using a Blank database or Sample
templates.
4. Tables can be created either in Datasheet View or Design View.
5. The Design View consists of two panes: Field Grid pane and Field Properties pane.
6. Queries are raised to get specific information from a table or tables.
7. Forms provide different views for adding, deleting, formatting and designing the data.
8. Queries, forms and reports created for a table can be saved in a database.

A. True or false?
1. Customised screens that provide an easy way to enter and view data
in a table or query are called reports.
D
2. A new database can only be created using a blank database.
D
3. Queries are raised to get specific information from a table.
D
4. One or more of database objects are found when a database is created.
D
5. The primary key should always have a value that is not repeated for any
other record.
D
B. Match the following.
1. Status bar a. Information arranged horizontally in a table

2. Hyperlink b. Information arranged vertically in a table

3. Field c. Data from a table or query in printed format

( 4. Report d. Displays buttons to change the page views

( 5. Record e. A link to an internet resource

C. State the difference between:


1. Record and Field 2. Table and Queries
3. Forms and Reports 4. Field Grid pane and Field Properties pane
5. Datasheet View and Design View
D. Answer the following questions.

1. What is a DBMS? Discuss its functions.


2. Suggest two ways to create a database.
3. Discuss two ways of creating tables in MS Access 2010.
4. What are Data Types? Name some commonly used Data Types in MS Access 2010.
5. What is the importance of the Primary Key?

A. Create a database to maintain the library records of your school. Design a form
for new students joining the library.
B. Prepare a table listing the names and taste of your ten favourite food items. Delete
the rows in which the names of junk food items have been listed. Insert new rows
and complete the list with healthy foods.
C. Create the following tables in MS Access 2010.
US States US Cities
S_Code S_Name C_Code C_Name
GA Georgia Atlanta 9 Augusta ME
MA Massachusetts Boston 10 Atlanta GA
ME Maine Augusta 11 Boston MA
RI Rhode Island Providence 12 Cambridge MA
WI Wisconsin Madison 13 Madison WI
14 Milwaukee WI
15 Providence RI

• Assign Primary Keys to both the tables.


• Add five records in both the tables.
• Generate a report.
Create tables to store the details of the students going to visit a monument. The number
of tables and their contents should be discussed in the class. Create a form and enter
one more record into your table(s). Create a report to generate a printed version of the
database.

WHO AM I?
I was born on 16 July 1951 in Philadelphia, Pennsylvania, USA.
I co-created the software program VisiCalc, the first electronic
spreadsheet.
I am also known as 'the father of the spreadsheet'.
I received the Grace Murray Hopper Award in 1981 forVisiCalc.
lam ........................................................................... .

~--------------~l·~------------~
,~~~ MS Office 2016
~.!! Updates
MS Access 2016 has the same layout as MS Access 2010. There are a few minor
differences listed below.
• The default window of MS Access 2016 is given below. It gives you multiple templates
to select from.
p

---- w......-
• In Access 2016, the top menu has a background color so that it can be easily
differentiated from the rest of the screen. In MS Access 2010, there was no difference
between the color of this menu and the rest of the screen.
~
,_. - '-
. ··- ·- -·-·-· --~· ·-. " ...... -
....... 0.. O....T... .... ~ ....
,, ..
p , ... - -... - ....

-...
;".}
-
-
A/IAccessOb_re
-:::.
-·-
e .. ~
p 0 ~ •
,_
Introduction to
OpanDffica 1
, .
. f

. SNAP RECAP

1. What do you understand by the You will learn about:


term open source software? • various OpenOffice applications
2. Which software program(s) do • introduction to OpenOffice Writer
you generally use for editing • main components of the OpenOffice Writer
a document or creating a window
presentation?
• File, Edit and Format menus in OpenOffice
Writer
• introduction to OpenOffice Impress
Introduction • creating, modifying and running a
OpenOffice is a collection of presentation in OpenOffice Impress.
application software just like
Microsoft Office. It is compatible
with many operating systems like Windows, Linux and MacOS. Sun Microsystems
released the first version of OpenOffice 1.0 but it was taken over by Apache
Foundation in 2011. The software was renamed as Apache OpenOffice.
OpenOffice is an open source software application, and its source code is available and
can be freely downloaded from openoffice.org. It consists of six applications as shown
in the table.
.. -
~

_-OpenOffice Application Used for Logo .1

Writer Processing text documents

Calc Creating spreadsheets

Impress Making presentations

Math Editing maths formulae

Draw Drawing diagrams

Base Creating tables and databases

OpenOffice applications

Open Office Writer


OpenOffice Writer is a word processor used to create, edit, format and print a
document. It is just like MS Word with similar features but with a different layout.
The extension of the file created in OpenOffice Writer is .odt.
It can be used to create and edit:
• documents with text, images and charts
• brochures and invitations
• newsletters with multiple columns.
Main components of OpenOffice Writer window
To open OpenOffice Writer, after downloading it, click on Start button~
OpenOffice ~ OpenOffice Writer. The main components of OpenOffice Writer
window are shown below.
Gi ..-u.o 1 • OpenOftoOt Wnt« 0 X
fik 1• r- ~ ~ tabh took ~ HdP
~ · C! · .. li!I G .9- ~::! C ·4 ·· • ~ ·..,•e>a lii •Q. f:l ., •""' -•~ .
• ,.,......,,_ • 12 • B I l! a " • a !~ :~ e e A·"" ·Ia. • "'
X "-
- --._, --~~ ." cl Tut C

-- · - ........... ~ T!tnti~loOfNI'I v l 12., e


8/ll·-.<a Llt C.: 'A'
Menu Bar ...-
Standard ( Ruler 1
~~ U· A· ., .
0
Title Bar 1.. _ 0

Tool bar

--
alEJI•

.. · ·=· e-c.

=....= : -=
ee+-~

....
*
,. . = ....
: !- o.co·

Slide Bar . .... 0

Status Bar
.•
N5tT STD

OpenOffice Writer window

Title bar
This is the bar on the top of the application window with the document name
Untitled 1 and the program name OpenOffice Writer.

Menu bar
This is made up of several drop-down menu tabs: File, Edit, View, Insert, Format,
Table, Tools, Window and Help.

Standard toolbar
This includes tools for frequent tasks such as open, save, copy, cut, paste, etc.

Ruler
Both vertical and horizontal rulers are available to show dimensions, tabs, columns,
margins of the page, etc.

Slide bar
This contains frequently used tools grouped in a deck.
Status bar
This bar displays information about the current page, current template, zoom percentage,
insert or overwrite mode, selection mode, unsaved changes and digital signature.

Menus in OpenOffice Writer


The Menu bar in Open Office Writer consists of various drop-down menu tabs like File,
Edit, View, Insert, Format, Table, Tools, Window and Help. Let us discuss some of
these menus in detail.

File menu
The File menu in OpenOffice Writer is shown below, with a list of the various options
available.
f.it £0t ~ J!$crt ~ TJblc l oob ~ l::ldp

C! ~~oo · ~ OIS<~ ::l lti · 4 · ·•!!!l · v • 0 a li • Q. O., •...


C! =:~trt·O. rii'MS Ncw Rcma.n ... 12 .., B I .u • JE Jl • l:: :: e € A . • . k . •
(::;. yti:.trds . • 1 . . -: .-. -..2. . . . ·. l . ·• · . . . ·.. • . - . . . . ;. s · · .. · . . · . 6 ·.!;7 ' '' '• A -
X '

Ill """ rt~,~!f;~~:• "·,:: ·~· ~, :' :•,· ·, ·~''" ;r:- •.•• _., ~:· :\"''·~~'"'' ":"" ~:":~::' "C'~ • •.c;~0'117,H ~ Tat
,_.._......., ::Jil v
0
11:1
S.-~ Ctr•·S ~="""'--'=----""'-"--"-'--""-'---'-'-~-----------'--"--,

g s-a.- ""'"""' '


.....
a- B /11 · - 41

~e,;.

:o· :o ·
U· 4· • ·

e>D ·
IJt& ~
z
" (,!)

........ : -~ o.co· :

(9.
~anWdlolrowwr

Pf911 PIWI!tW
. "'.... : ,-o:co--
0 frio<- ,,...
l!il ........ ..........
. . ... , ....Q

NSAT STD I
orom e__,__il """

File menu in OpenO.ffice Writer

New: Creates a new file.


Open•.• : Opens an already created file.
Close: Closes a file.
Save: Saves the changes in an already created file.
Save As... : Saves a new file for the first time or saves an existing file with a different
name.
Save All: Saves all open files.
Page Preview: Previews the document before taking a printout.
Print... : Prints a document.
Printer Settings... : Changes the printer settings for a document to be printed. When
clicked, it opens the printer setup dialog box which shows you the name of the
printer and its details, such as Status, Type and Location. You can also change printer
properties from here.
Exit: Exits OpenOffice Writer.

Edit menu
The Edit menu in Open Office Writer is shown below, with a list of the various options
available.
tiUrltaS«< 1- ~Writer - 0 X
f4rtfdit~-"""' ~ IY...... l:lolp
l ltl
i.,
:...........
-'QI,f:1t{...,;.
c;, · * · · • Cll • ;.; • 0 a li • o. Q 10 ,.,. El • • •
w~ ~~~· r-----------------------~~----~----~--~~-- ~

-~ : :. ==-- ~ "y~ ~
--
•--.. c.t--·•
.... 1'(1 : " '

_ . . . . __
.. """.!II

"""""
""'"9-1"!•1

c....
B I U · - 41

e,......,.
l.r U fl:

-----
• JE • •

.f'o6......... _ """'
~ AutolqJ- Ctrf.o.Fl
::· 1:· e-[J·

' ....... : -l ....


.I"'..,. :r Q.OO·

::. · ~o.oo·

.•
..- -- - - -- - - ___,......,.=!U!AI=-------'IQI STO..:.....'---'---------------~illlll£!m==....e~._. ~e """
'"-'-='"-'----- - - - - -=""=

Edit menu in OpenOffice Writer

Undo: Used to undo the last action in a document. This can also be done by using the
undo tool from the standard toolbar.
Restore: Used to redo the last action in a document. This can also be done by using the
redo tool from the standard toolbar.
Cut: Cuts the selected text and places it in the clipboard.
Copy: Copies the selected text in the clipboard.
Paste: Pastes the cut/copied text from the clipboard into the document.
Paste Special... : Pastes the formatted or unformatted text in a document.
Select All: Selects the complete document.
Find & Replace ... : Searches for a selected word and replaces the searched word with a
new word.

Launch OpenOffice Writer using the Start button of your computer. Write a letter to a friend
or relative. Try using different commands that you have learnt so far.

Dragging and dropping a selected text in OpenOffice Writer is equivalent


to cutting and pasting into the same or another document.
• Select the text you wish to move.
• Place the mouse pointer anywhere on the selected text without clicking.
• Left click and drag the selected text to the new location.
• During this process, the mouse pointer changes to a box with a small white arrow
over it, indicating that you are dragging text.
• When you reach the new location, release the mouse button to drop the text.

Format menu l!l~l · CIM<CIIIOI-


tJoU.r-~,_t....,._I_.,_tto~~o

t: · • · ._.. ~,__.e»ow tt. · - e a - .., a ~ a fiiii • I\ G ., .. . . . A

-e
The Format menu in r.=-.:-=---·
.. r--lli ·-
.. - . . Cbooo<too-

::: ....--...
u
:
- I I
;
U •

• • •
·'
.: :: '\i
.
la. · • ·a,· a
.• . . • • • ..'lol • .'
I ~ ~ ·r--------------------------. .".
OpenOffice Writer is I /U · - 4t, ~.l ~

--
.,
.... ~-.---. ,,1
shown on the right, with a
list of the various options
available.
,__

--..
- --
:u
i.ll-X'
•=-:o·
«:ott ..,
:-JD.:C'
: r .-·

Character... : The ·~·

formatting related to
the character like Font,
Font Effects, Position,

Format menu in OpenOffice Writer


Hyperlink and Background. The Character dialog box is shown below.
!character X
Font Font Effects Position Hyperlink Background

font !ypeface
~imes New Roman Regular 12
~II ..!¥J3MJ.!..@!. ... ,
Trebuchet MS Italic
TwCenMT Bold
I
Tw (en MT Condensed
Tw (en MT Condensed Extra Bold
Bold Italic

Verdana
I
Viner Hand lTC
1.anguage
~~ English (USA) v :

The same font will be used on both your printer and your screen.

~-------------------Tmn~NewR~L-------------------~

OK uncel !:felp

Character dialog box in the Format menu

Paragraph... : The formatting related to paragraph Indents & Spacing, Alignment,


Text Flow, Outline & Numbering, Tabs, Drop Caps and Borders can be done using the
paragraph dialog box.

Paragraph X

Background
Indents & Spacing Alignment Text Flow Outline & Numbering Tabs Drop Caps Borders
Indent
Jiefore text ~.oo·
..
After !ext o.oo · ..
first line o.oo ·
'----
..
O!utomatic

Spacing - -
AbQve paragraph 0.00.
,.....,
~
Below .11.aragraph o.oo ·
line spacing
Single v cf :I
Register· true
0Aftivate

OK Cancel !::!elp Reset I


Paragraph dialog box in the Format menu
Bullets and Numbering...: An ordered or unordered list can be created by using bullets
and numbering. Open Office Writer has different ways of representing bullets and
numbers as shown below.
Bullets and Numbering X

Bullets Numbering type Outline Graphics Position Options


Selection - - -- - - - - - - - - - - - - -- - - - - -

. - • • • I
I

• • • I

. ---
• • • -----

X
"
~ }>

-- --- --- -

X
"
~ ~

~ -
--
-
-
}>
X IJ
OK Remove Cancel

Bullets and Numbering in the Format menu


Page... : Changing the page borders and background, margins, applying columns and
adding headers and footers, etc. can be done using the Page Style dialog box.
Page Style: Default X

Organizer Page Background Header Foot~r Borders Columns Footnot~

Paper format

D
f ormat

'!'{rdth 8.50 . ..
'7'1
!:!eight 11.00 "
~
Orientation @ £ortrait
0 l~ndscape Paper tray I[From printer settings] -v.,
Margin s - layout settings
!,eft 0.79 " . I
Pag~ la:tout IRight and left vi
Bight 0.79 " .. Fof!!!at ,1, 2, 3, ... vi
Iop 0.79 . .. 0 Register·try~

!!,ottom 0.79 " .


---
Reference ~tyle

OK Cancel !::!elp

Page Style dialog box


Change Case: Converts the text into uppercase, lowercase, toggle case, title case or
sentence case.
Columns... : Creates multiple columns
on a page. It is used to create articles
just like a newspaper column.
Alignment: Aligns the text as left, right,
center or justified.

OpenOffice Impress
OpenOffice Impress is a presentation tool used to create multimedia presentations. It
is a part of the Open Office suite. Presentations can be used by professionals in offices
or by students in schools and colleges. It is an easy way to present a topic with lots of
multimedia effects.
A presentation consists of one or more slides with different elements like text, bulleted
or numbered lists, tables, charts, clipart and a wide range of graphic objects. The
default extension of a presentation in OpenOffice Impress is .odp. Let us now learn how
to use OpenOffice Impress.

Creating a presentation
To create a presentation, click on Start ~ Openoffice.org ~ OpenOffice
Impress. It opens by showing the wizard as below, which gives three options.
9 Presentation Wizard X

Type
@ fmpty presentation
0 .Erom template

0 O~ten existing presentation

0 Previ~
0 Qo not show this wizard again

r rI
!:felp ...__ Cancel J .___<_<_~_ck
_ __. '-----"~
=ext=>~"'--_,1 L !;reate J
Selecting a presentation from the Presentation Wizard
These options are:
• Empty presentation: Creates a blank presentation.
• From template: Provides some predefined templates to choose from.
• Open existing presentation: Opens presentations which were created earlier.

1. Select Empty presentation and then click on Next>>.


2. Select a slide design according to the suitability of your presentation. Click on
Next>>.
9 Presentation Wizard X

!Presentation Backgrounds

<Original>
Black and White
Blue Border
Blue Lines and Gradients
' .t.•~-_£ •• .j! .. - • .

Select an output medium


Qng1na @ Screen
0 ~ead sheet 0 Sli!le
0 PJP6

tlelp Cancel J[ « B:a<:k

Selecting a slide design f rom Presentation Wi~ard

3. First, Select a slide transition and then Select the presentation type. Click
on Create to create a presentation with the settings done using this three-step
presentation wizard.
9 Presentat,on Wizard X

' ,-,l ,-,,


.. 3. .
Select a slide transition
fffect [No Effect ~
Speed ~edium - ~
Select the presentation type
@Qefault
0 Automatic

Dllrat10n of page !00:00:10

Dutat1on of pause
:====
1._00:_.00:_._10_ __
"' Sh.Qw logo

tlelp J[ Cancel ll « ,&.ck t,reate

Creating a slide using Presentation Wizard


4. After you click on Create you will get the OpenOffice Impress window as shown
below.

l·e"""""',."""""'"""""""' " X I
fH £"" ! { - """' ....... !oob I'd<"- - l:ldo
e · C! · .. liil a.o;o = ~t~
· · tA I:!l · • 019- · o . l!ii - SI - 11!-<t ..
II!J ~~ ':;. • ~ 0.00' : ~ 01 '"" vjc:::::::J I!Iu«l""'vl .. 40

D
Side X NonMI ~ Nots H1tw1out SlideSott:1r
X '
r

Click to add title


DD
DB
Du
Click to add text D~
r:-;-- =:]
Task Pane

~ / -+~::~• T ..! · "1. · • - 8 - .. -• -!iii -* - rZ-' m~a {P!oo - a -


·c l.Suu7 ,~o.oo.o.oo SWtl/1 Dd. .

New Presentation window in OpenOffice Impress

The OpenOffice Impress window can be divided into the following three components:
• Slides pane: This is on the left side of the window. It shows a thumbnail of all the
slides in the presentation. The slides are in the order of creation. You can drag and
change the order of the slides.
• Workspace: This is the main area where you can design your slides.
• Task pane: This displays different tasks like Properties, Slide Transition, Custom
Animation, Master Pages, Styles and Formatting, Gallery and Navigator which can
be used to design slides.
I I )

Select Tools ==> Options ==> OpenOffice Impress ==> General


==> untick Start with wizard to skip the three steps of Presentation
Wizard to create a new presentation.
Presentation views
The workspace window in OpenOffice Impress provides five different view tabs, as
described below:
Normal: A slide can be created, edited and viewed. It displays the complete slide with
text and graphics.
BUMIIIolllll·o..oac....,_
~ t* i - ...... ,.._., 1. . ..,.,,._ ..... l:iolllll
- 0 X

IS · II · ii - ;;i &l ~:::! C • · ... . . . ~!J. · G • &; · i!ii · la.,. ,

-- [Ej];;.
LJ
'

Introducing a New Product


LJ D
LJ b
LJ c: e

T it le
0 '---J

LJ ~

L-----------------------~~~,~~·~~~·e~~~
. w~
.· ~ '~e--==------ - - - - - ' · - . - - _ _ _ . _ , ... ,.j

Viewing presentation in the normal view

Outline: This view can display only the text of the slides. It can be used to plan the text
and rearrange the content on a slide.
~U....I·~--- - - - - :_ 0 X
911 Uc ~ ..... ,..... ! .... ,....,._ ...... !:to~!~

E: · l!l ·ii "" lil A 11:::! e S · 4il . tl n .a l!l w .


·- ~ t, llttl.a ... . ..

·• Introducing a New Product


Title
·• Long-term Goal
• State the intended goal
·• Customer Wishes
• Describe customer needs and wishes

'0
• Explain the requirements
==-=--=-- ·• Fulfilling
•~
Customer Needs
• Describe the main attributes of the product
• link the product attributes to customer needs
·• Cost Analysis
';. -5
--
:·::.--..
• Indicate the financial advantages for the customer

Viewing presentation in the outline view


Notes: This view is used to add extra notes to the slide. It acts as reference for the
presenter during the slide show.
l fik
e~"'*'1·~~moms - 0 X
f.ckl ~ ,_. kttmet Jooil SJidt~ rt_._ ~

B · llt ·Q .... .. .:::. ;,!:! t;; '0 · · ~1!:1 - e 0.9- · 0 & ·51 · 111- *•
.......... .'
·---·~
~

e
·-- ;
.........
~
e
1' 1

• CUJtomwHobtles
• • D--..~tl>..O.....,.-.
• · t~··~...,._-
...
•J

I
...
•• 'iJ
This slide gives i.nformatioo about cus.
tc.:oero.·ishes

Sickl /7

Viewing presentation in the notes view

Handout: This view creates a handout with more slides on one page. It displays the
layout with single, two, three, four, six or nine slides per page.
!l~.t~t>Otc11•(1ptft0f1.c.~ 0 X
~ [die x-- jriMrt Fgmwr looO Sick~ ~ndow ~

B· I3 ·Q .... .o':~ ;, ::; C. <0 · · A C!I · e

- X'

Viewing presentation in the handout view


Slide sorter: Displays all the slides of the presentation in a miniature form. We can
rearrange the slides in this view.
~
a~
~~
-~-~
~~ ~
-------------------------------------------------------~o -x-

E* flk :~- tnMn: Ftrm« 1... sw.s.- ~ ~ )C

1! · 13 -Q ... ~ 0 ::! ~ :l;o • ·


. ~ . . a. ~ • ISW.. • a

. . . 11 1~

Viewing presentation in the slide sorter view

A slide master is a slide that controls all information about the Theme, Layout, Background,
Color, Fonts and Positioning of all slides. The settings that we select in the Slide Master
will be applicable to all the slides created in a presentation. Go to View ===> Master ===>
Slide Master. Make the following changes in the Slide Master:
• Change the Title of the slides to font size = 50, bold, Comic San MS, Color = Purple.
• Change the font settings of the content to different bullets, colors, sizes and types.

Go to Edit===> Navigator in OpenOffice Impress to display all the


objects contained in a presentation. It provides a convenient way view
all slides and its objects. You can also use the navigator button on the
standard toolbar.
Slide layouts
The basic elements of the slides are Title, Content, Footer, Header, -
.. ._.. .'
Slide Number, Graphics and Images, Charts, Table and Movie. All
these elements can be arranged on a slide in different layouts. Some of
u 8 ~
the layouts available in OpenOffice Impress are shown on the right. o I el l ~
LJ L=J ~·
These Slide Layouts are available in the Task Pane on the right side
of the window. In case it is not visible, select Format ==> Slide u LJ 0

Layout. t=J t:J


Slide transition
uCJ
The motion effect of the slides during the slide show is the Slide
Transition. It is how one slide changes to the next during the
presentation during the slide show. We can add transitions in the Slide
Sorter view or in the Normal view.
Various Slide
Slide Transition can be applied by Selecting Slide Show menu ==> Layouts
Slide Transition...
G !
l
NolranSitJOfl
w.,.u,.
w,......,. l it

Select Slide Transition from the Task Pane on the right side of the W.pelcfc

llie Wffi
OpenOffice Impress window. WhHI CloclaMsc,.l Spob:s
Wheel ClocltMst-.l Spota
Vw'hHIClockwtst. Ai Spotes
_.._.
"""'Clod<wo<.a,.....
From the Slide Transition window (on the right), you can select """""''"'
UncowrRigtlt

transition, speed, sound, etc.


-
""'-""
Uncowr left:·Down

........_.
Unc~LcfHip

Custom Animation --
Uncovcr~Up
R.ndom 8MI Vtftiu,l

...............
Sound <NoSowld>
vi
------:::)

This is a set of animated effects that can be applied on objects like


titles, content and graphics. Animations can make a presentation --
®Onmouw cict:
t ut'lloln< md

more lively and memorable. Animation effects are applied from


Normal View so you can select individual objects on a single slide.
Custom Animation can be applied by selecting Slide Show menu
..., --
Selecting Slide
==> Custom Animation...
Transitions

Select Custom Animation from the Task Pane available on the right side of the
OpenOffice Impress window.
Steps to apply Custom Animation
1. Select the element to which an animation is to be applied, then click on the Custom
Animation tab.
2. Click on the Add button to add animation effects (on the left below). It opens
another window with the list of effects as shown on the right below.

Custom AnirMtion X If,.


Custom Animation X
Modify e ffect

IM l fiJ Entnnce Emphasis Exit Motion Paths Mise Effects


.Bomove ~ I Appear ,., I

Effect- ~I Box
~tart
Checkerboard
~ Circle
Diagonal Squares
Prop•rty ~ Diamond
,..._,; Dissolve In
Sp~ Flash Once
<!)
[ E Fly In
I Fly in Slow
Peek In
Plus
Random Bars
Random Effects
Forst s•loctth• sl•d• •l•m•ntand
th•n click Add ... to add an Split
an,mat1on eff~ct. Venetian Blinds
Wedge
Wheel
I Wioe
~peed Fast v
~---------------
0 Automatic preview

!;21 Automatic pr~ew OK Cancel [ tf~p

Custom Selecting custom animation


animation window

3. Select an effect, for example, Flash Once. Select the speed of the effect as Very
fast, Fast, Very slow, Slow and Medium. Click on OK.
4. This will bring you back to the Custom Animation window. Now you can select
options for Start, such as On click, With previous or After previous depending
upon whether you wish to start the animation by clicking the object, or with the
previous effect, or after the previous effect has stopped playing.
5. Click on the Play button to see the animation effect applied.
Running a presentation
While running a presentation, the slides appear one by one on the screen showing the
transition of the slides with the animated text and graphics. This is called a Slide Show
of the presentation.
You can run a slide show in three different ways:
• By pressing the FS function key.
• By going to the Slide Show menu ===> Slide Show option.
• By using the Slide Show tool on the Toolbar.
l li:l Untitled 1 • OpenOffice Impress 0 X I
-
-Fil• f.dit -View Insert FQrmat Tools ~id•
-
Show Window Help
- X

~ · ~ ·Q ~ ~ ~ ~ SideShow FS ~ ·
. lj11!!3 • ~ e; ~ . f) .:J~~ · ~ · ~Iil ~ ~

jCJ Blu• classitv I ~ ~


S!id• Show Settings••.
j§;l ~ ':« · 1---v ~= ~ Rehearse Timings !Color '

]
Slides X ~ Slid.__c
lnteracbon ...
I
1
~ Custom Animation ... ,-Slide Show ;k toaddtiUe I"
~
Slide !ransition...

1 _., j " =
w:(
I•
Shol!!Siid•
-
-
• Jiid• Slid•
~ustom Slid• Show...
.
r ~
v
I < > ~
.1...........>

~ /-+liil@ T ...z. · ~ · • · e · ~ · llll · lji · 'k · e. .P ID~I:I fl- ~ · 0 ·


b ·15.00 /2.40 l 0 0.00 X0.00
. Slid• I /1 Dofault
l:!cJ
0
--- 0 20%

Running a slide show

To run a Slide Show in OpenOffice Impress

OpenOffice An open source software application which can be used on any operating
system like Windows, Linux and MacOS.
OpenOffice Impress A presentation tool used to create multimedia presentations.
OpenOffice Writer A word processor used to create, edit, format and print a document.
1. The extension of files created in OpenOffice Writer is .odt.
2. The File menu in OpenOffice Writer consists of various options for
creating a new file, saving and printing it.
2 3. The Edit menu in OpenOffice Writer includes options to Cut, Copy, Paste,
Find & Replace, etc.
4. The Format menu in OpenOffice Writer provides options like Character,
Paragraph, Bullets & Numbering and Change Case.
5. The default extension of a presentation in OpenOffice Impress is .odp.
6. OpenOffice Impress starts with Presentation Wizard, which is a three-step
procedure for creating a new presentation.
7. The window of OpenOffice Impress is divided into three parts: Slides
Pane, Workspace and Task Pane.
8. The workspace in OpenOffice Impress provides five different view tabs:
Normal, Outline, Notes, Handout and Slide Sorter.

EXERCISE
- • n uv-
-
,.'- J
flt: J
,.g~
, ....
1
o --
A. Fill in the blanks.
1. Cut and Paste are found in the ............................... menu.
2. To create and edit a document we use OpenOffice ............................... .
3. The ............................... view shows all slides in a presentation in a miniature form.
4. The ............................... option in the File menu will save the file for the first time.
5. The ............................... is used to give animation to the objects on the slides.

B. True or false?
1. The file extension of OpenOffice Impress presentation is .ods.
D
2. Slides can be easily rearranged and deleted in the Slide Sorter View.
D
3. F6 is used to run a presentation.
D
4. New slides cannot be added after a presentation is saved.
D
5. Justified alignment arranges the document on both left and right margins. CJ
6. The Page Preview option can be used to print a document. CJ
C. Match the following.
[ 1. Slide Transition a. Runs a presentation

[ 2. F5 b. Changes font size, type, color

( 3. Slide Show c. Displays only text

( 4. Outline View d. Custom Animation

[ 5. Format~ Character e. Effects on slides

D. Answer the following questions.


1. Why do we use OpenOffice Writer?
2. Explain any two options found in the Format menu of OpenOffice Writer.
3. Describe three different ways to run a presentation.
4. What is a Slide Transition? Name any two effects.

A. Create an Open Office document on the topic 'The importance of healthy food' .
Use the internet to get some information and pictures.
B. Create a presentation on 'The Place I visited in My Summer Holidays'. Use the
internet to get some information and pictures.
Work in groups of four. All the groups need to come up with a newsletter for the school
and make a group presentation in front of the class using Open Office Applications. Each
student in the group should take up one of the below roles.
Researcher: Gathers news about various events, competitions, etc., in the school for a
period of 15 days. Use OpenOffice Writer to store the research work.
Creative writer: Puts the text together in a concise and organised way using OpenOffice
Writer.
Designer: Designs the layout of the newsletter in OpenOffice Impress.
Animator: Decides the text and graphics effects in OpenOffice Impress.
Introduction to
OpanDffica 11
r r

. . SNAP RECAP

1. What is open source software?


2. Explain the difference between
open and closed source software.
• formatting the cells in OpenOffice Calc
• renaming a worksheet in OpenOffice Calc
• writing functions in OpenOffice Calc
OpenOffice Calc • some functions in OpenOffice Calc
Open Office Calc is part of the • charts in OpenOffice Calc
OpenOffice suite and is used as a • reasons for creating a database
spreadsheet tool. A spreadsheet tool is • Open Office Base as a relational database
a common name given to a computer management system
application that stores and displays • creating a new database
information in a tabular form. We • database objects and elements of tables.
can also use some built-in features of
the software to do calculations and
analysis of the data.
.. . w i /U • • • •
• t•:• :. .., · ~ · ·Q.
.A S\1'~ 2 4141C ·a.·&· .
•. . . ¥ •••

The layout of the Calc window


;..c, ~ .

(shown on the right) is the same 1 1 u·- " ( ._.,


as that of other applications in the 110...,._
. .. '
:I -
•••• - • .$

OpenOffice suite. • i """

~-

A file in OpenOffice Calc is referred


to as a workbook with the default
name as Untitled 1. It is saved with
an extension of .ods. A workbook can -'"~
~-
... . ......
OpenOffice Calc window
have multiple sheets named Sheet1, Sheet2 and Sheet3, etc., as default. Each sheet is
divided into a grid of rows (horizontal) and columns (vertical).
A row is labelled as numbers starting from 1, 2, 3, ... with the last row as 1048576.
A column is labelled as letters starting from A, B, C, ... with the last column as AMJ.
A cell is formed by the meeting of a row and a column and is referred to as A 1, B6,
G32, etc.
A collection of the cells together will form a cell range, for example, A 1:A5, B 1:0 7.

Entering data in a cell


You can fill a workbook by entering data in the cells. Data in a cell can be in the form
of text, numbers or a combination of both. The default alignment for text is left, while
for numbers, it is right.
In order to enter data in a cell, follow the steps given below.
1. Select the cell where you want to enter the values.
2. Type the value that you want in a cell.
3. Press the Enter key or click on another cell to move to the next cell.
~ Untitled 1 - OpenOffice Calc 0 X
f ile t;dit '[lew )nsett FS!rmll I ools Qata lllindow l:lelp X
,,. . »
: ~· ~ · Q ~ ~ Find Tm lilt

: !§;) Arial

Ell X '\. !

Name Subject · 8 Alignment


Carlos M.~o;_
Science i£3i~iil
~
Aflya English
I Left 1ndent O:t!:raptoxt
loP~ Mergecl!:lls
.., TextR,rientation:

>I _._/'.. -.
Sheet 1 {3 De!au~ INSRT STD • Sum:O 9 0 100%

Entering data in cells of the Open Office Calc window


The cells can be formatted by changing their font name, size, color, etc. either by
using the Formatting toolbar or by selecting Format menu ==> Cell option.

Using the AutoFill feature


In a spreadsheet, you can generate a series of number or text values by using the
AutoFill handle. This process of automatically generating the series is called the
AutoFill feature of a spreadsheet.
Follow these steps to generate the S.NO (Serial Number).
1. Write 1 in cell C5 and 2 in cell C6 and select them.
2. Click on the fill handle at the bottom-right comer of the selected cells. Drag the
mouse as far as you want to generate the series. In the above case, drag until
cell C9.
3. The series will be generated automatically as shown below.

~ Untitled 1 • OpenOffice Calc 0 X


file £dit l[oew Insert FQrmat Iools Qata Window t:lelp X

l ~ - ~ -Q ~ l!r'l a IS' ~ ~ ).( ~ ~ • ~ ~ • - ~ ~' !' ~ v • 0 a ii q. : ~ Find Text »

l (iJ Arial .... 10 .... B I .u E 3E :II • [!'!! ... ~ SJI ~ !.!5 ·~ -(!: 0 . ~ • A .
C5:C9

t=l=~==~~==JI~~~-=:J~J:~==J::J==JC:Jc=JC~~ G Te~
Aria I

.. A.
' G Alignment 0

~-§II· -=-=_,
I left Jndent: 0 J,'irap text
Opt
DMergecells
..., Text ~rie:ntation:
• · ··· ~< >I ~
Sheet 1 / 3 Default Sum=1S 0 e 100"

Using the AutoFillfeature to generate S.NO

Formatting cells
The data in a cell can be formatted by using the tools found on the Formatting toolbar
or by selecting the Format menu ==> Cells option. This window has a number of tabs
to do different kinds of formatting. Here we will explore some of them.
Format Cells X
Numbers Font Font Effects Alignment Bc<den Boctground Cdl Prot<Cbon

l:;ategory F~rm&t

Number
1. To change the number formatting
by putting a currency sign in front
Ptrctnt

o... -S1,234
..
.$1,234.00

Tim< -S1,234.00
Scimtific
of amount, select the cells you fr•<t•on
-S1,234
-S1.234-00
Boolean VJ1u~ v -S1,234.- _ _ _
c..:.=:.;:__ - I 2.00 1NR

want to format, then go to the Options


0
Numbers tab in the Cells option Q«.1mal places tlogotivo numbor> rod

leading teroes 0 Ihous.ands ~rator


and select Currency in Category, Eo~ code

change Format code to dollars and


Decimal Places as 2.
L __ _ _ _ _ _ _ _ _
~ C.ncd J:jdp 8...t

Numbers tab in the Format Cells dialog box


Format Cells X

Numbers Font Font Effects Alignment Bordm Bldc:ground Cd Prot«bon

font Iypdoc• itt•


Sl!'lJ Rogulor 11

~UM!ij.~-----1-lAI NP
2. To change the font name and size
of the text, select the cells you want
jA.naiBiack
Ari,l N1rrow
Mol Roundod MT Bold
Arimo
Bold
Italic

Bokttt.ahc
[J
16

to format, then go to the Font tab


~hnschrift
Aa,ho.scbrift Condensed v
I '-------
18
'""'-2D- - - '

in the Cells option; select Font as '0' English (USA)

Arial, Typeface as Regular and Size The wmt font wiU be~ on both your printer 1nd your screen.

as 14.

Font tab in the Format Cells dialog box

Format Cells X

Numbor> Font Font Effects Aignment Bo<dors Boctground Cdl Prot<Ctlon


Text alignment

3. To change alignment of the data in Horit;ontal indel"'.t ~ertical

~De~-- __ ~pt : ~~·u~K----~


~
the cells, select the cells, then go Tct~n
0 V<{ticolly stockod
to Alignment tab (shown on the -...' \ I I / ,.

~
right) and change the Horizontal :
~
A8CO
' Reference edge
"' i \ ' lf1Joo
and Vertical alignment to align Properties

the data. Then select the checkbox 0 Yi.rop teet outomaticolly

Wrap text automatically to wrap 0 ~nk to frt ceU size

the text on the next line in the same


cell if there is too much text to fit on
one line.
Alignment tab in the Format Cells dialog box
4. To change the cell background, select the cells you want to change, then go to the
Background tab, select the color of your choice and click on the OK button.
Format Cells X

Numb~ Font Font Effects Alignment Borders Background Cell Protection

!No Fill I
OOOlJO·······--
o•••••••o•
• •oD• o
o••••••• •••o
oo••
••••••••••••
••••••••••••
••••••••••••
••••••••••••
••••••••••••
••••••••••••
o•••••••o•••
DOD o•DoDooo
DD•• DD• • • • • o "
No Fill

I OK I Cancel J !::!elp Beset

Background tab in the Format Cells dialog box

Renaming a worksheet
The worksheets are automatically named Sheetl, Sheet2, Sheet3, ... in OpenOffice
Calc. If you want to change the name, follow the steps given below:
1. Right-click on the Sheetl tab.
2. Select the Rename Sheet option to display the window shown below.
I ~ Untitlod 1 • OpenOffice Calc D X I
[ole fdit ~ew Insert F.2rmat !ools Jl.ata lt{lndow !::!elp X

i: ~ · 12! · Q C30 >> ~ Find Text »

i ffi;l Aria!
'"''
812 v h ~ =

!nsertSh~..
Qelete Sheet_ BI.u.·-~ ~ n.r
.Bonome SM&..
Move/Copy Sh~.. . A.
Select All Sheets

!abColor.••

1)( Cut 1
left !ndent OJ!troptoxt
lltll -'.opy !opt M..-g• cells
ftl faste v Text .Qrientation:
:.....,.,~""""l't~,......_, <>I I /""\ -.
Sheet 1/3 STD • Sum:O 0 0 ,100%

Renaming a worksheet in OpenO.ffice Calc


3. The Rename Sheet dialog box will Rename Sheet X
appear as shown on the right. Change Name OK
the Name to MyFriends and click MyFriend~
Cancel
on OK.
Help

Writing functions
Rename Sheet dialog box
A formula is an expression that begins
with an equal to(=) sign. You can enter a formula in a cell to do calculations on data.
Sometimes you may not remember a formula or it may be a tedious job to write the
addition formula for 100 rows; in that case, you may use built-in formulae available in
OpenOffice Calc to perform calculations. These formulae are called functions.
A function can be entered either through the Function Wizard or by typing the function,
beginning with an equal to sign, with the values in a cell.
Function Wizard X

Functions Structure Function result

£ategory SUM
IMathematical SUM( number 1; number 2; ... )
function

ISECH
SERIESSUM
SIGN
,.. I
Returns the sum of all arguments.

SIN
SINH
SQRT
SQRTPI
SUBTOTAL

SUM IF
SUMIFS Formula Result IErr.520
SUMSQ
TAN =
TANH
I I
TRUNC

'--
O~rray
L tlelp l r Cancel l L___<_<_~_
ac_k~ [ Nat» ~ ~~ _
__ _ _! J
Function Wizard dialog box in OpenOffice Calc

To open the Function Wizard, select Insert Menu ~ Function option.


There are ten categories of functions and each category available in OpenOffice Calc
includes a long list of functions for different types of calculations.
A formula or a function can contain:
• Numbers = 45 + 12 • Cell address = A 1 + B4
• Cell range = Sum (D2:D5) • Both = 34 + E6 + F6 + 25
When we type a formula in a cell and press Enter, the formula will no longer be visible.
Only the result of that formula will be visible in the cell. The formula can be seen in the
Input Line of the Formula bar. We can edit the formula in the Input Line of the Formula
toolbar when the cell is selected or we can double-click the cell. The value changes
automatically with the change in the formula.

How to use functions in a workbook


The step by step procedure to create a sample worksheet for the analysis of students'
results is given below:
1. Create a worksheet with S.No, Marks 1, Marks 2, Marks 3 for result analysis.
B Untilled 1 • OpenOtfiu Clk - 0 X

!JI< 1"' l6<w !""" ...,... 1... ~"' !t~Mow l:f<lp

~ •~• Q co B l:l. f9. ~ = )(


ftl lti • 4 "it • · • :' :' It! lJ " 0 a ii C\. ~ .. ! '""'r"' :
!!J AN~ ~ 10 ~ 8/l! ,.,. . , . -' " \!' ~lii.;!~ D · l!!. · A · ,.

X '1.

v
8-
J il'§!l.

Opt

>I ~· ~· . _,
ID ~ ~- ..
Sheet Z/) STl> . e- - -e ,.. ,.
""""'
Creating a worksheet fo r result analysis

2. Enter the formula =D5+E5+F5 or =SUM(D5:F5) in cell G5 . As soon as you press


the Enter key, the formula disappears to the formula bar and the result appears in
the cell.
I:!J Untid<d 1 • Op.nOffi<• C<k - a x
I fH , .. l6<w - ,..,... looh ~... - l:f<lp

ll • ~ ~ . Iii 0.0 1:,) ~ [9. ~ = )( ' It; • (/ '9 • . • l' !' [6 lJ . . 0 a lj (\. ~ • ! Fmd Tat :

j i!J Ari<l ~ 10 ~ B/ l! IE:EJI• -' "\!'~lll•l~ D ·l!!.·A· ~


X '1.

,....., ~

9-_
SNo Name Morlcs 2 MorlcsJ Tc<ol B I l! .... ~ lltO:
!Alex 76 67 88 231 ....
2 ,!m
lE&gfj)
89
88
78
98 ~c:::::::l A·
4Maty 88 76 88 ~
0
5.s!sio)lj 98 ~ 89
~~~ tx
6~
7XJ.w!t
~
88
67
78
96
92 .....~~-~~·
Ol!l""""
Opt
!dfl'if: C:iltll
U<
'
H •• H\ Shttt1\.S*'.21Shfttl /
~ / liii8 -.! T ~ • -e -.. · a · li · • ·
>I
-- v

Sheft 2/ l ...... --, ID~


STl> . • "'""'0 e 0 100 "

After entering the fo rmula for Sum in a worksheet


3. Copy the formula in the rest of the cells toG 11 either by dragging the Autofill
handle on the right side of the selected cell G5 or by using a copy and paste option.
0 X
VI• £dit ~..,.. lnJttt FAn"Mt Ioolt ~· W'II'Mfow ti.lp
~ • (<! • Q a loll .!:!. ~ ~ ::£ ~ fl,b ltl • 4 '0 • • • t& !& !A >? . . (2) a liJ Q. : FlndT<>d •

\1' ::0 :If •::i ~ 0 • ~ • .6, • "'


1
ljj;) 8 I lJ 1:11 .lo "

;1
' Arial Y 10 Y IE ,.; ,_ •
--"'----

~ e-=:-
GS:Ci11

ANII ..,
c: 1

SNo Name "'"""', Mari<s 2 Mari<s3 8 I lJ -- ~ [ :»r


I Alex 76 67 ·~,#

2J. . . 8ll 78 67 , - .6.·


3E8!gap 68 98 67i
4Mary 88 76 :e-, c 0
SAAIOY.i
6Ano1N
7Xuout
98
87
88
87
67
78
:!i
96,
92'' -- ..B:!'lo
••;w• ~ . ..&")
OW:r•,:
"•' : OM""

v r-'\ Od~
" ••\ St.eet1fShHtlljlJ < •I \I
~ / WI- ~TIC< + · 0 - ~ · ll:l · ii! · • ·
ShHt 1/) STD • s..n.1nz '0 · G> 100Y.

Using the Autofill option to copy the Sum formula in a worksheet

4. Next, insert the percentage column and write the formula for percentage
=(GS/300)*100 in cell H5. Repeat the process of copy and paste to copy the formula
from cell H5 to H11.
~ Unlitled 1 • Opoo<lfficc Calc - 0 X
filot(dot- !nscrtf<l<matioolsQat•-~ )(

~ - t! ·Q~ IDH:!ai9o ~= )( ltlltl -4 CD · - • ~' !& I*'-' • 0 a Iii ~ G " i ~... r... <&o •
iJ ..,.. y 10 v B I U • lE • • .A "\!'~ :!!@@ o · rll ·A· ..
Hll )( ..

a ~

~ 10 v

Namo Mattes 1 Molb2 MotbJ Toto! Percentage B I .u-- ~ ljfCA


1 Alex 76 67 88 n1 n
2Jave
JEI!!l@O
89
68
78
98
67
67
234
233
78
n 66666667 A·
4Mary
SN<•(r(i
6&1!11M
7~
88
98
87
88
76
87
67
78
88
89
96
92
252
274 91 33333333
2SO 83 33333333
258
84

86
II!.JI.
S .u,n.-t

left-
~~~
:::1

01!£r>p1...
Opt M~N.ItCt
• • • " n;;;;tj\Sheet2 l She<tlf u< •I - ...
; ~ / s:oJ e .t T ~ + ·• · • · Cl • j j · * · ID ~__o.
STD • SumooO 0--.---0 100"

After entering the formula for Percentage in a worksheet

5. Format the number up to 2 decimal places, either by selecting Format => Cells
=> Numbers => Category: Number.
G
By selecting the Number Format: Delete Decimal Place tool found on the
Toolbar.
6. Now insert the Grade column and write the formula =IF(H5 > 40;"PASS";"FAIL") in
cell IS to display PASS or FAIL on the basis of the percentage calculated.
7. After all the calculations are done, the spreadsheet will appear as shown below.
Cl X

f~e £dit Y'"teW insert f2fl'Nt Ioots J2at• Window t:ldp X

lii7 .!:.!. ~ ~ ::i ~ Et.'l ~ • # CD • • e ~' ~' ~ V . . 0 1C1 ti q, ~ ! F;ndT"" <!> :


v 10 v B I .1.1 IE 3E :11• .l " \l't:. :if € € O·~·A · ,.
H13

Name Maries 1 Matlts2 Marks3 Total Percentage Grade


1AJex 76 67 88 231 n .oo PASS
2J~ 89 18 67 234 78.00 PASS
3f.wm 68 98 67 233 n.67 PASS
4Mary 88 76 88 252 84.00 PASS
5&\iold 98 87 89 274 91.33PASS
6~Qi~ 87 67 96 250 83.33 PASS
7 )jj$!Jl 88 78 92 258 86.00 PASS

14 4 · • .:, \ Shed1 \.Sheetl l Sheetl I U<


L ,I
! ~/ iiie ..t T ~ ~ · @ · ~ · li! · lj.il · '!ll · "'
s.- 21 3 --------.= ~o~.~
- ~~--~

Final worksheet for result analysis

Some common functions


Some of the commonly used functions in OpenOffice Calc are given below, with
examples.
• SUM(): It adds up the values given as parameters in the function. The parameters
are separated by a semicolon(;) in between. These values can be the cell address,
cell range or number.
For example,
=SUM(D5 ;E5 ;F5) will give the answer 231
G
=SUM(D5 :F5 ;D 12)
• MAX(): It returns the highest value from the list of the values given as parameters
in the function.
For example, to find out the highest marks in Marks 1 in the list created above:
=MAX (D5:Dll) will give the answer 98
G
=MAX (D5;D6;D7)
• J\UN(): It returns the lowest value from the list of the values given as parameters in
the function.
For example, to find out the lowest marks in Marks3 in the list created above:
=MIN(F5 :Fll) will give the answer 67
G
=MIN(F5;F6;F7)
• AVERAGE(): It calculates the average of the values given as parameters in the
function.
For example, to find out the average of Marks2, use the formula:
=AVERAGE(D5:Dll)
• IF(): It evaluates the condition given as the first parameter. If the condition is true,
then the second parameter will be evaluated, otherwise the third parameter will be
evaluated.
For example, to display PASS or FAIL based on the condition given for the above
worksheet will be:
=IF(H5>40, "PASS","FAIL")

Charts
Charts are graphical representations of data in a spreadsheet. You can create a chart of
existing data in OpenOffice Calc by using the Chart tool lib found on the toolbar or
by selecting the Insert menu ===:> Chart option.
It will display the Chart Wizard. In order to create a complete chart, you need to follow
the four steps to select the criteria shown below.
x' """- X

-
Slmt a.-.......
1.01M\TJIPI: Doto-
~ ... SShfttt.S&S.UZS11 :a:
~ p;,
~a- l C..Sono< oo...--·ro-s
1~ :;'($<_,
~ llubWt .I
'-"""- @)c.t. ..... s.......

- ""' I
Oll>loot ~ 86nlro..•llbll
::!1 ""
·· ..........
~;a c
9>...
o .... - .. -

ll«t••

Chart Type
X
Data Range
-
X

+f*'l a

- - - <<loq

- c-.1 ]

Data Series Chart Elements

Chart Wizard in OpenO.ffice Calc


Complete the following activity.
1. Create a list of shopping items purchased, with the following columns - Item code,
Narne, Quantity purchased and Price of each item.
2. Make a new column Amount per item to calculate the amount purchased of each
item; use the formula =Rate*Quantity.
3. Make a list of ten items purchased and calculate the Total Billing Amount. If the
Billing Amount is more than $100, then give a discount of 15% or 5%.
4. Calculate the actual bill after deducting the discount.

(' )

~
Save the file you created in the previous activity by selecting File c=:> Save As : fCI• ~
c=:> tick the checkbox Save with password. Set password to open file c=:> OK.
.. _ cot
Now close the file and try to open it. What will happen?
Find out if you can save a file with permission to open and view but cannot modify the
content.

OpenOffice Base
Open Office Base is a powerful application software used for storing and maintaining
data in the form of rows and columns. The data stored can be retrieved in the format of
reports or queries.
A database is created in OpenOffice Base with the extension .odb.

OpenOffice Base as a Relational Database Management System


(RDBMS)
OpenOffice Base is a relational database management system. This means that data
is arranged in the form of rows and columns. This data can be accessed by multiple
users, and different tables created in a database can be linked together on the basis of
a common column. This feature helps to retrieve and manipulate data from multiple
tables at one time. The other RDBMS available are Oracle, Microsoft Access, MYSQL,
SQL Server and many more.
Creating a new database
1. Click on File==> New==> Database to create a new database. A Database
Wizard will appear as shown below.
9 Database Wrzard X I

Wecome to the OpenOffice 0~ WIDRI

'ftrummm Use the Data bas. Wrzard to create a ni!W database, open an existing databas. f~e,
or connect to a databas. stored on a seiVer.
2. Save and proceed

What do you want to do?


@ Create a n_cw databa..
0 Open an existing database file
Becently used

I I I
1
<? OJ!en.

0 Connect to an <!isting database


jmsc

.!::!elp _j I << Bac.!; . JI Hext >> I . - - -finish J[ Cancel J


First step of Database Wizard in OpenOffice Base

2. Select Create a new database if a new database is required, or select Open an


existing database file if the database has been created earlier. Click on Next>> to
open the next step of the Database Wizard.
19 Database Wrzard
X I
Decide how to proceed after SiiYing the database

1. Select database
Do you want the wizard to register the database in Open Office?
. Save and proceed
@Yes, register the database for me
0 N.Q.. do not register the database

After the database file has been saved, what do yo u want to do?
0 Open !he database for editing
0 £reate tables using the table wizard

Click 'Finish' to save the database.

,
~ J::!elp « Bac.!; finish I[ Cancel

Second step of Database Wizard in OpenOffice Base


3. Select Yes, register the database for me and tick Open the database for editing
option. Click on Finish. This will open the Save As window (see below). Assign a
new name: School and click on Save.
9 Save As X

- 1' > ThisPC > edupub(\\ 192.168.22.71) (Z:) > ClickStort v ~ Search Cick Start p

Organize • New folder

~ Docum~ts "' Name Date modlf1ed Type St:;:e


~ Downloods
No Items match your search.
J> Music
.:: Pictures
• Videos
~ OSOisk (C:)

% Fileshores ():)
2 HI.RES (\\192.1E
% edupub (\\192.1

r;; Networic
... <

File name: I New Database11


Sovus type ODF Dotabose

0 Automatic file name


Save Cancel
"' HideFoldor. extens1on

Saving a database in OpenOffice Base

4. After you save the database it ----/,.


will display the main window of G~~
'---'
OpenOffice Base (below). This All files created in the ~ ~@
window is divided into three parts: OpenOffice suite are saved as an 1 l
Database Tables, Tasks related to ODF (Open Document Format) • - w
each object, and Object Instances document.
created in each database. '--
·~-~
s-o £ott 1- ~
...
looll ....... ):tllp
- 0 X

m· C! · "' · e ,

..
S tt-TIII6t"'Oott9'"--
!$~'Mutlt'OC..Ul.tlle.­
._ .......

Main window of Open Office Base


5. Now click on Tables object. The Tasks will show three different ways of creating
tables in OpenOffice base. Select Create table in Design View. It will open the
Table Design window where you can design the structure of a table.
9 -
E.. £.,.
o.-·--'
x-- I- -
Table! - ()p<nOffic<...., Tobie o..gn
!jdp
- 0 X I

e ro •
r!-
f-
r-
f-
r-
t-
I-
I-
I-
I-
I-
t- +
<

.-----J

Table Design window of OpenO!fice Base

6. Let us now design a Student table (see below). In the Field Name type Admission
Number and Field Type will display the list of different data types with Text
[VARCHAR] as default in the drop-down list. Select Text [VARCHAR]. Select
Description to write a few lines to describe the column created. The description of
a column is optional.
9 Nr~r o~ta~lo.ocrb; ~, ·OpenOtfiCI!' Base: table~ - 0 X

f,.. £"" 1- lools 'ff""""' !jdp

': Q ~ 'i ..

r!- AdmissionNumb..j Tat]VARCKAR]

r-
f-
r-
r-
t--
f-
r-
r-
t--
f-
r- ~

1. .

L"'9"' 50

·= - - -- - - ~ r~ J
'--- - - - - -

Creating a Student table in OpenO!fice base


7. Right-click on the green arrow key in front of the Admission Number. This will
open a shortcut menu as shown below.
' 9 _ _,._,,....,.--.o<r.. s--.Oaoon - 0 X

--
E• fdit ~-- loots !fn*M

-
tidp

Q ,;;) )( ~ liD ..
FCidTYP<
.
r"
r !'"'_._.
;-
l!d«•
~ ~~.y
-
1-
r-
r-
1-
1-
r-
.
r-
(

fooy-

L'"9'h
!!d.........
j...
50
~
:
El -- .
)

.
I

................
·~ I r . .
Selecting Admission Number as primary key

8. Select the option Primary Key from the menu to make Admission Number the
primary key. A small key appears infront of the Admission Number column to
show that this has been selected to save unique values in the table.

9 New Database10.odb: Table1 - OpenOffice Base: ... 0 X


file f_dit Yiew !ools Y{lndow J:!elp

< >
Field Properties

J.ength 50

Qefault value

Format example

< >

Admission Number as the primary key


9. Now create a few other columns with different data types in Table Design as
shown below and save the table with the name Student and click on OK.
0 X
file .f.art :{oew Iools ll{ondow l:ltlp

FoeldNo,.,. F"ltld Type [ l


r-! Admission Numbct Tecti VARCHAR1
Student No,.,. Tect I VARCHAR 1
r- Oo!• of AdmisSIOn Oot.rr.,. I TlMESTAMP 1 X
r- Phono Numbct Numbct I NUMERIC 1
r;
r-
Finol p.,<ontogo O..:omol I OEOMAL1 !.::.
01( Uncd ] [
r-
____
field
= Propatios

INo

Creating more columns in the Student table

10. Close this file by selecting File ~ Close to display the window shown below.
Repeat the above process to make one more table titled Library. The structure
of the table can be modified by adding a new column anywhere in the structure,
deleting any column and changing the existing column in the Table Design View.
I a - . OponOffi<o- 0 X
5I< £<fft :{.... (Mort !ools - Jjtlp X

! 1!1 • t! · It!! · ~' !' G • G lot ! b EH!f 'l!ll

1:3 trut••-w.o.s.gnv...,_
~ [S !!<o WOMd to c..... T--
~ " Crut~t V"trW-

.......

~··*=H=·~--------~----------~----------__J

Creating a Library table


11. Either select Open from the Shortcut menu or double-click on the Student Table
to open Table Data View. This view is used to add, modify and delete records in a
table. We can only see this view after the structure of a table is designed using the
Table Design View.
12. Enter the records of your choice and save them in the table.
9 Student - New OatabaselO - OpenOffic• Base: Table Data View 0 X
file Edit Y,ew Insert !ools Y{lndow l:felp

lfi{i) .. ti} • ~ ~~ il ~

Arshio
__j

Record of 2

Student table in Table Data View

When designing the table structure, do not select a column as primary key.
Save the table. Enter the records. What did you notice? Give reasons
for this.

Create a table titled Teacher with the columns Teacher code, Name, Subject, Classes taught
by, etc., using the Use Wizard to Create Table option. What steps did you follow to create
the structure and records in the table?
To open a new OpenOffice file
To open an existing OpenOffice file

AVERAGE() The function that calculates the average of the values given as parameters in
the function.
Column The arrangement of related data vertically in a table to form a field.
Data The smallest piece of information in a table.
Database A collection of many relevant tables together will form a database.
IF()The function that evaluates the condition given as the first parameter. If the condition is
true, then the second parameter will be evaluated, otherwise the third parameter will be
evaluated.
MAX() The function that returns the highest value from the list of the values given as
parameters in the function.
MIN() The function that returns the lowest value from the list of the values given as
parameters in the function.
OpenOffice Base A powerful software application used for storing and maintaining the data
in the form of rows and columns.
Open Office Calc Part of the OpenOffice suite used as a spreadsheet tool.
~ SUM() The function that adds up the values given as parameters in the function.
(~
--~-~~ ~---
YOUARE 1. A file in OpenOffice Calc is referred to as a workbook with the default
HERE name Untitled 1.
2. A spreadsheet is created in OpenOffice Calc with the extension .ods.
3 3. In a spreadsheet, you can generate a series of number or text values by
using the AutoFill handle.
4. A function can be entered either through the Function Wizard or by typing the function
beginning with an equals sign with the values in a cell.
5. Charts are graphical representation of data in a spreadsheet. You can create a chart of the
existing data by using the Chart tool.
6. A database is created in OpenOffice Base with the extension .odb.
7. Open Office Base is a relational database management system.

i
l;fJ .
,~\._/

EXERC SE s-~
-· UY i~<
Q-·
A. Fill in the blanks.
1. The ....................... object of the database displays the formatted data from the table.
2. Rows in a database are also called ....................... and co lumns are also called

3. A database can contain ....................... tables.


4. A spreadsheet is a representation of data in the form of ....................... and

5........................ is the graphical representation of data in a spreadsheet.

B. Match the following.


1. Extension of database a. Displays the total of the values

2. Tuple b. Forms

3. Database Objects l c. Displays the maximum values


4. Max()
J d. Rows in a table

5. Sum() l e. .odb

c. True or false?
1. After a table structure is created, it cannot be modified later.
D
2. Text in a spreadsheet is by default left-aligned.
D
3. A cell can have any type of value in a spreadsheet.
D
4. We can do a calculation on a text value.
D
5. We cannot delete a record in a table created in OpenOffice Base.
D
D. Answer the following questions.
1. Explain the difference between a formula and function, with an example.
2. Explain the Autofill feature, with an example.
3. Explain the different elements of a database, with an example.
4. What is a primary key? What is the advantage of creating a primary key in a table?
5. Give brief reasons for creating a database.

A. Create a table in a spreadsheet (at least 10 records) with the following columns-
Employee Code, Employee Name, Basic Salary, 20% Inflation Allowance, 30%
Housing Rent Allowance, 20% Tax Deducted, Gross Salary (Basic+ Allowance),
Net Salary (Gross-deductions).
B. Use at least three different charts to represent the above data in a graphical form.
Format the charts created using different colors Try swapping the rows and
columns of the tables on the x and y axes of the graph to see the difference in the
appearance.

Create a database for the smooth running of a shop. Include tables like stock details, items
details sold in a day, details of employees, salary calculation employees, and any other tables
you can think of. Design the structure of each table and add at least five records in each.
Frames in
HTML

1. What are HTML tags and attributes? You will learn about:
2. How do you execute (run) a HTML script? • creating frames in HTML
3. How can you create lists and tables on a • <FRAMESET> Tag
web page? • <FRAME> Tag

Introduction
In this chapter, you will learn to open multiple HTML documents in a browser window.
This is done by dividing the window into different blocks and then opening a different
web page in each block.

Frames
Frames allow you
to divide the web
page into several
independent parts or
panes. Each of these
is called a frame.
For example, the web
page shown on the
right has three frames
marked on it.

A web page divided into frames


The frames work as independent windows allowing multiple views at one time.
They allow one part of the web page to remain static while allowing other parts to
change. For example, when you click on the refresh button, you can reload one frame
without having to reload the entire web page.
The following tags are used to create frames in HTML:

<FRAMESET> tag <FRAME> tag

Frameset tag <FRAMESET>


A frameset is defined as a set of frames inserted in a HTML web page. These frames
can be in the form of rows and columns in different proportions. A frameset tells the
browser how to divide the screen into split windows. The <FRAMESET> tag divides
the web page into rectangular areas where an individual HTML document can be
loaded for each area using the <FRAME> tag. It contains one or more frame tags.
One frameset tag can also be used within another frameset tag to form a nested
frameset. This is required to further divide one block into small blocks that can be
arranged by row or column.
The following are the attributes of the <FRAMESET> tag:
• Cols: Specifies the number and size of columns in a frameset. Its value can be a
specific percentage of the web page or in pixels. The default value is 100%
(1 column).
• Rows: Specifies the number and size of rows in a frameset. Its value can be a
specific percentage of the web page or in pixels. The default value is 100% (1 row).
• Border: Specifies the thickness of the frame borders in pixels for all the frames
in the outermost frameset. The default value is 5 pixels. It can be used only for the
outermost frameset.
• Bordercolor: Specifies the color of the border of the frame.
• Frameborder: Specifies whether the border should be visible or not. Its value can
be either Yes or No.
The <FRAMESET ... > tag is used instead of the <BODY ... > tag. The frameset file has
no content of its own, so it has no need for a <BODY ... > element. For example,
<FRAMESET rows="45%, *" cols="*, 50%" frameborder="yes" border="?"
bordercolor="bl ue">
Frame tag <FRAME>
The <FRAME> tag defines what goes into each frame of a HTML web page. This is
an empty element. Each frame works as an independent browser window with its own
default properties. These properties can be altered by using the frame attributes.
The following are the attributes of the <FRAME> tag:
• Src: Specifies the URL of the initial file to be displayed in the frame.
• Name: Assigns a name to the frame that may be used as a target for links.
• Frameborder: Specifies whether the border should be visible or not. Its value can
be either Yes or No.
• Bordercolor: Specifies the color of the border of the frame.
• Scrolling: Specifies the scroll information for the frame. It can have a value Yes,
No or Auto. Yes means scrollbars are displayed. No means scrollbars are never
available and Auto means provides scrolling if necessary. Auto is the default value.
• Marginheight: Specifies, in pixels, the space to be left between the frame's
contents at top and bottom margins.
• Marginwidth: Specifies, in pixels, the space to be left between the frame's
contents at its left and right margins.
For example,
<FRAME src="A.HTML" name="F1" frameborder ="Yes"
bordercolor="Red" scrolling="No" marginheight="30" marginwidth="30">
Let us try the following examples using the frame and frameset tags.

Before you try the following examples, make sure you have four separate
HTML files, named Frame l.HTML, Frame 2.HTML, Frame 3.HTML and
Frame 4.HTML already created.
These can be any other HTML files that you want to use as frames. Specify
their complete path in the src attribute.

Example 1: The HTML code for creating frames in the form of two rows is given
below.
<HTML>
<FRAMESET rows="35%,*" border="2"> Frame 1
<FRAME src="Frame1.HTML" name="Frame 1">
Frame 2
<FRAME src="Frame2.HTML" name="Frame 2">
</FRAMESET>
</HTML>
Example 2: The HTML code for creating frames in the form of two columns is given
below.
<HTML>
<FRAMESET cols="S0%,50%" border="l">
<FRAME src="Framel.HTML" name="Frame 1"> Frame 2 Frame 2
<FRAME src="Frame2.HTML'' name="Frame 2">
</FRAMESET>
</HTML>
Example 3: The HTML code for creating frames in the form of both rows and columns
is given below.
<HTML>
<FRAMESET rows="45%, *" cols="*, 50%" frameborder="yes" border="?">
<FRAME src="Framel.HTML'' Name="Fl" scrolling= No>
<FRAME src="Frame2.HTML" Name="F2" scrolling= No> Fl F2
<FRAME src="Frame3.HTML" Name="F3" scrolling= No>
<FRAME src="Frame4.HTML" Name="F4" scrolling= No> F3 F4
</FRAMESET>
</HTML>

_j
If the source file mentioned with the src attribute is not available, then a
message would be displayed 'Files Not Found'.

~
.....~ w t....
Try following the HTML codes using frames of your choice.
1. <HTML> 2. <HTML> ,
& - ~
<FRAMESET rows="SO%, 50%"> <FRAMESET rows="SO%, 50%">
<FRAME noresize="noresize" > <FRAME>
</FRAMESET> </FRAMESET>
</HTML> </HTML>
Nested frameset
Creating one frame within another frame is known as a nested frame set. This is done
by using the nested frameset tags in the main window. One of the most popular uses
for frames is nesting the frameset tags to design a complete website with the homepage
on the left frame and the content, selected from the list in the homepage, on the right
frame. An example is shown below of how to create a complete web page.
Example 4: The HTML code for creating three frames in the form of both rows and
columns is given below.

Example of a nested web page

Creating a web page My Class.HTML


<!This file divides the browser window into different frameset.>
<HTML>
<HEAD>
<TITLE> MY CLASS<ffiTLE>
</HEAD>
<FRAMESET rows="15o/o,*">
<FRAME src="Heading.HTML" NAME="F1" scrolling="No">
<FRAMESET cols="30o/o,*">
<FRAME src="Mainlist.HTML'' Name="F2">
<FRAMESET cols="l 00%,*">
<FRAME src="Details.HTML" Name="F3">
</FRAMESET>
</FRAMESET>
</FRAMESET>
</BODY>
</HTML>

Creating a document for the topmost frame, Heading.HTML


<!This is the heading file in the topmost frame.>
<HTML>
<BODY bgcolor="cyan">
<CENTER><Hl >MY CLASS
</H 1></CENTER>
</BODY>
</HTML>

Creating a document for the second frame, Mainlist.HTML


<!This is the homepage displayed in the form of list in the left frame.>
<HTML>
<BODY bgcolor="lime">
<UL>
<LI><A href="DETAILS.HTML'' target="MAIN">ABOUT CLASS</A>
<LI><A href="SUBJECTS.HTML'' target="MAIN">SUBJECTS</A>
<LI><A href="TESTS.HTML'' target="MAIN">TESTS</A>
<LI><A href="ACTIVITIES.HTML" target="MAIN">EXTRA CURRICULAR ACTIVITES
</A>
</UL>
</BODY>
</HTML>
Creating a document for the third frame, Details.HTML
<!This is the file displayed in the right frame when any of the list is selected in the
homepage.>
<HTML>
<BODY bgcolor=.. #FFOOFF .. > A target attribute
I study in class 8. <BR> is used to show
My classmates are very helping. <BR> on which page the
information will be
</BODY>
displayed.
</HTML>
Example 5: Another example of a complex nested Frameset is given below. The HTML
code for the various files created is given below.

A File B File

C File D Left File D Right File

D Bottom File

Example of a complex nested frame set

Creating document Mainfile.HTML


<!This file divides the browser window into different framesets.>

<HTML>
<FRAMESET rows= .. SOo/o,SOo/o cols= .. S0%,50%.. border= .. ? .. bordercolor= .. Biue .. >

<FRAME src=..AA.HTML.. name= .. top_left .. >

<FRAME src= ..AB.HTML.. name=.. top_right .. >


<FRAME src="AC.HTML'' name="bottom_left">

<FRAMESET rows="50%,50%" border="?" bordercolor="green">

<FRAMESET cols="50%,50%" border="?" bordercolor="red">

<FRAME src="BCA.HTML" name="bottom_right_left" scrolling="No">

<FRAME src= "BCB.HTML" name="bottom_right_right" scrolling="No">

</FRAMESET>

<FRAME src="BCC.HTML" name="bottom_right_bottom" scrolling="No">

</FRAMESET>

</FRAMESET>

</HTML>

Creating document AA.HTML


<!This file opens in the top left frame.>

<HTML>

<BODY>

<CENTER><FONT color="blue"><H1 >A File</H1 ></CENTER></FONT>

</BODY>

</HTML>

Creating document AB.HTML


<!This file opens in the top right frame.>

<HTML>

<BODY>

<CENTER><FONT color="blue"><H1 >B File</H1 ></CENTER></FONT>

</BODY>

</HTML>
Creating document AC.HTML
<!This file opens in the bottom left frame.>
<HTML>
<BODY>
<CENTER><FONT color="blue"><H 1>C File</H 1></CENTER></FONT>
</BODY>
</HTML>

Creating document BCA.HTML


<!This file opens in the bottom right left frame.>
<HTML>
<BODY>
<CENTER><FONT color=red><Hl >D Left File</Hl ></CENTER></FONT>
</BODY>
</HTML>

Creating document BCB.HTML


<!This file opens in the bottom right frame.>
<HTML>
<BODY>
<CENTER><FONT color="red"><H 1>D Right File</H 1></CENTER></FONT>
</BODY>
</HTML>

Creating document BCC.HTML


<!This file opens in the bottom right bottom frame.>
<HTML>
<BODY>
<CENTER><FONT color="Green"><Hl >D Bottom File</ Hl ></CENTER></FONT>
</BODY>
</HTML>
A. Create the following framesets:

c
1. A A 2.
D B

A B c
3. 4.
D E B D
E
B. Create a web page titled 'Book Review'. The page should be divided as shown below.

• Book Name 1 Details of the book selected


• Book Name 2
• Book Name 3
• BookName4
• BookName5
Made by: Student name
Contact: [email protected]

Frames They allow us to divide the web page into several independent parts.
<FRAME> tag The tag that defines what goes into each frame of a HTML.
Frameset A set of frames inserted in a HTML web page.
<FRAMESET> tag The tag that divides the web page into rectangular areas, where an
individual HTML document can be loaded for each area using the
<FRAME> tag.
Nested frameset Creating one frame within another frame.
1. Attributes of a <FRAMESET> tag are Cols, Rows, Border, Bordercolor
and Frameborder.
2. Attributes of a <FRAME> tag are Src, Name, Frameborder, Bordercolor,
4 Scrolling, Marginheight and Marginwidth.

A. True or false?
1. Frames allow you to divide the web page into several independent
panes.
D
2. You need the <FRAME> and <TABLE> tags to create frames in HTML.
D
3. An important attribute of the <FRAME> tag is src.
D
4. Creating one frame within another frame is called a nested frame.
D
5. Scrolling in the <FRAME> tag specifies scroll information for the frame.
D
B. Give one word for the following.
1. The attribute that specifies the URL of the initial file to be displayed in
the frame. ....................... .

2. The attribute that specifies the color of the border of the frame.

3. The tag that is used to divide a webpage into rectangular areas.

4. The attribute that specifies that a frame is not resizable.

5. The tag that defines what goes into each frame of a HTML
webpage.
C. Explain the difference between the following tag attributes:
1. Cols and Rows of the <FRAMESET> tag.
2. Border and Bordercolor of the <FRAMESET> tag.
3. Src and Name of the <FRAME> tag.
4. Margin height and marginwidth of the <FRAME> tag.

D. Answer the following questions.


1. Why do you need to create frames in a HTML window?
2. Discuss the <FRAMESET> tag and its attributes.
3. Discuss different attributes of the <FRAME> tag.
4. What is a nested frameset? Give an example.

A. Create a website on the topic 'Football World Cup 2018'. The browser window
should be divided into three frames: heading frame; list of matches as hyperlink
in the left frame; the list of participating countries in the right frame. The
information should be displayed only when a hyperlink is selected.
B. Design a website about the importance of hygiene.

Create a web page about electric cars. It should contain information using bullets, tables,
images and backgrounds. The web page should contain frames. Use the internet to gather
information.
Jauasc:ript in
HTML
I
Documents
. SNAP RECAP

1. List the elements of HTML you You will learn about:


have learnt so far. • the importance of JavaScript
g -M
2. What do you think is a • writing a JavaScript program
limitation of HTML script? • using an external JavaScript file
• the object model in JavaScript
• the document. write() method
Introduction • JavaScript variables and operators
HTML is a very limited document • using the window.alert() and
formatting language. It is based on tags window.confirm() methods
that instruct the browser how to display • using parselnt() and parseFloat( ) to do
text or an image. As such, HTML is arithmetic calculations.
limited to a static, one-way interaction
with the user.
To add functionality to your web page you need a scripting language. J avaScript is one
of the most popular scripting languages for the internet. It works in all major browsers
such as Internet Explorer, Firefox, Chrome,
Opera and Safari. In this chapter, you will
learn to add functionality to your web pages
by using J avaScript. Do not confuse
JavaScript with Java
Java Script language. Both share
similar names but are different in
JavaScript is a scripting language with a very
most aspects.
simple syntax. It is used to add interactivity
to your web pages. JavaScript is set to execute when changes need to be reflected on
the web page, such as, when a page has finished loading or when a user clicks on a
HTML element. This type of interaction requires knowledge of constructs such as
IF statements and FOR loops which are not part of the HTML syntax.

J avaScript provides web page authors with the power to reach a very high level of
interaction between the user and the document.

The importance of JavaScript


JavaScript is used because:
• It helps to add interactive elements to HTML pages.
• It is a scripting language which is also a lightweight programming language.
• Everyone can use J avaScript without purchasing a licence.
• It is supported by all major browsers, such as Internet Explorer, Firefox, Chrome,
Opera and Safari.

Writing a JavaScript program


JavaScript is lines of executable computer code usually embedded directly in
HTMLpages.
JavaScript statements can be included in HTML documents by enclosing the statements
between an opening <SCRIPT> tag and a closing </SCRIPT> tag.
The section between the opening <SCRIPT> tag and the closing </SCRIPT> tag is
called the script block. For example,
<SCRIPT language="JavaScript">

[JavaScript statements]

</SCRIPT>
The <SCRIPT> tag may be placed in either the head or body of a HTML document.
The script code can be broken into smaller parts and placed in different sections of the
HTML document. To have different script sections, start each with the <SCRIPT> tag
and close it with the closing tag </SCRIPT>. However, it is recommended to keep all
the JavaScript code together in one single section of the document. This is done for
better readability and understanding.
<HTML> <BODY>
<HEAD> <SCRIPT language="JavaScript">
<language="JavaScript">
</SCRIPT>
</SCRIPT> </BODY>
</HEAD> </HTML>

Using an external JavaScript file


If you want to run the same J avaScript on several pages without having to write the
same script on every page, you can write a J avaScript in an external file. The external
file is simply a text file containing JavaScript code with a .js file extension.
To use the external script, point to the .js file in
the 'src' attribute of the <SCRIPT> tag.
For example,
r.f:.!
......__...
JavaScript files have a~~
<SCRIPT language="JavaScript" an extension of .js, l · ~

src="scriptFile.js">
[additional JavaScript statements]
</SCRIPT>
and are identified by an .,._ "
icon ~. These files contain just
the code, and no <SCRIPT> tag is
;
j
required.
The Object Model in JavaScript
Like most other programming languages of its generation, J avaScript is characterised
by the Object Model. This means that you think about your JavaScript program in
terms of the objects you want to work with. For programming purposes, the browser
window, the HTML document, forms, etc., are the objects which in tum are formed of
other objects such as Text Boxes and Radio buttons.
You can access information about the objects with the help of methods. Methods are
functions associated with objects. In other words, the actions you can perform on or
with objects are called methods. Here, you will learn to use simple objects and methods
to write programs in JavaScript.
For any object that has a method, type the name of the object, followed by a dot (.),
then the name of the method and a set of parenthesis. In other words, object.method().
For example, if you have an object named Car and you want to define a method, say
Travel, you would type:
Car.Travel()
Let us study some simple codes for J avaScript.
document.write() method
The document. write() method is used for displaying the text on the browser window. It
uses an object called 'document', which refers to the current document on the browser
window.
This object manages many of the instructions that JavaScript can handle for HTML.
One of the methods, write(), of this object is to display a string or text on the screen.
For example, document. write("Welcome to J avaScript")
This will display the message "Hello friends!" on the browser window.

A simple JavaScript program


To display a simple text on the browser window as shown below, the following script
has to be written.
<HTML> <SCRIPT language="JavaScript">
<HEAD> document.write("Welcome to
<TITLE> Welcome</TITLE> JavaScript");

</HEAD> </SCRIPT>

<BODY> </BODY>
</HTML>
IIIII - 0 X

+-~·- ft*(l
-~ ----

Welcome to Ja\"aScript

Displaying text

Using HTML tags in JavaScript


HTML tags can also be included in the J avaScript
code to generate HTML elements that will be
displayed in the browser window. All HTML tags
are valid in J avaScript. Once the browser receives
method as required.
a string from the document.write() method, the
browser accepts the string enclosed within the parentheses and double-quotes, and
treats it as HTML code. The string without the HTML tags is accepted as a simple text.
The browser treats each HTML tag accordingly.
For example, here is the script for the output as shown in the screen below.
<HTML>
<HEAD> <TITLE> Using HTML Tags<!TITLE> </HEAD>
<BODY>
<SCRIPT language="JavaScript">
document.write("<Hl >Every dark cloud has a silver lining</Hl >");
document.write("<H2><U>Fortune favours the brave</U></H2>");
document.write("<B>An apple a day keeps the doctor away</B><BR>");
document.write("A friend in need is a friend indeed");
</SCRIPT>
</BODY>
</HTML>

Every dark cloud has a silver lining


Fortune favours the brave
.An apple a day keeps the doctor away
A friend in need is a friend indeed

Using HTML tags with JavaScript

Rules for writing a JavaScript program


You should follow the rules given below when writing a program using JavaScript:
• The scripting language has to be written within <SCRIPT> ... </SCRIPT> tags in a
HTML document.
• The <SCRIPT> ... </SCRIPT> tags can either be written in the <HEAD> or
<BODY> of a HTML document.
• A program can have more than one of the <SCRIPT> ... <!SCRIPT> tags.
• JavaScript is a case sensitive language.
• Using a semicolon at the end of the statement is optional. Using semicolons makes
it possible to write multiple statements on one line.
Before you learn more about methods in J avaScript, you will learn how to add
comments to the J avaScript code.

Adding comments to JavaScript code


A comment is a line of code that is not interpreted by the browser. The browser ignores
any text that is written as a comment. Comments can be added to make the code more
readable.
There are two different types of comments in JavaScript:
• Single line comments: These are used when the comment entry has to be
given in one line. These comments begin with double slash (II). For example,
//This is comment line 1
• Multiple line comments: These are used when the comments extend beyond
one line. The comment block is enclosed between I* and *I. For example,
/*This is comment line 1
This is comment line 2 *I

If you do not wish to use a part of a code, you should make that part a
comment rather than deleting it. It is then not executed but can be read
and used when needed.

Some examples of J avaScript are given below.


The script for the output shown in the screen on the next page, is given below:
<HTML>

<BODY>

<SCRIPT language="JavaScript">
document.write("<H1 >This is a heading</H1 >");
document.write("<P>This is a paragraph.</P>");

document.write("<P>This is another paragraph.</P>");

</SCRIPT>
</BODY>

</HTML>

nus IS a paragraph.
nus IS another paragraph.

An example of output using JavaScript

The script for the output as shown in the screen on the next page is given below:
<HTML>

<HEAD>

<SCRIPT language="JavaScript">

document.write("<H3>This is a script written in head part</H3>");

</SCRIPT>

</HEAD>

<BODY>

<SCRIPT language="JavaScript">

document.write("<H3>This is a script written in body part</H3>");

</SCRIPT>

<H3> This is a text written using HTML without scripting </H3>


</BODY>

</HTML>

This is a script written in body part

This is a text written using llTML without scripting

An example of output using JavaScript

Create a webpage including the following:


1. Display a 'Hello' message using the heading level of your choice. It should be bold and
underlined.
2. Display your name in the centre of the web page in blue.
3. Display the heading 'I am learning JavaScript' in a bigger font size, centre aligned and
underlined. Now write its definition on a separate line using different colors.

JavaScript variables
Variables are the names assigned to a memory location that can be used for storing
data. Its value can change during the execution of a script. A variable can have a short
name, like x, or a more descriptive name, like Fname. These variables, by default, hold
only one value at a time. If you try to assign another value then the previous one is
overwritten.
The rules below should be followed when assigning a name to a variable:
• A variable name is case sensitive (y andY are two different variables).
• It can contain letters (A... Z, a ... z), digits (0 ... 9), and underscores(_) only.
• It must start with a letter or an underscore character.
• It cannot contain empty space (white space).
• It cannot have more than 255 characters.
• It cannot be one of the language's reserved words (keyword), such as var, alert, etc.

Declaring variables in JavaScript


You can declare a variable in JavaScript by using var along with the variable name.
For example, variables nl, fname and age are declared below. These variables are
empty by default with no value:
var n 1, result
var fname
varage
Values can be assigned to variables at the time of declaring them or later. In the
example below, the value "Putri" (i.e. a first name) is assigned to the variable fname.
var n1 =2
var fname= "Putri"

Use double quotes to assign a text value to a variable.

Let us write a small program to see how variables are used. The output of this program
is shown below.
<HTML>
<BODY>
<SCRIPT language= "JavaScript">
var fname="Daniel"
document.write("Hello" + fname + "<BR> Welcome to Lab");
</SCRIPT>
</BODY>
</HTML>

Hello Daniel
Welc~toLab

Using variables in JavaScript


JavaScript operators
An operator is a symbol applied to data values like variables and constants that causes
the computer to carry out a specific operation on that data. The different types of
operators available in JavaScript are:
• Arithmetic operators • Comparison/Relational operators
• Logical operators • String operator

Arithmetic operators
Arithmetic operators are used to perform arithmetic calculations using variables or
constants. Different types of arithmetic operators are given in the table below.

+ Addition 2+4 6
Subtraction 6- 2 4
* Multiplication 5*3 15
I Division 15 I 3 5

% Modulus 10%3 1

Types of arithmetic operators

The HTML code using arithmetic operators to give the output as shown in the screen
on the next page is given below:
<HTML>
<BODY>
<SCRIPT language="JavaScript">
var a=2
var b=1 0
document.write("The addition of two numbers is=");
var result= a+ b
document.write(result);
document.write("<BR> The multiplication of two numbers is=");
result= a* b
document.write(result);
</SCRIPT>
</BODY>
</HTML>

The multiplication oftwo numbers is = 20

Using arithmetic operators

Comparison operators
Comparison operators are used to test if two variables relate to each other in the
specified way. These return values which are either True or False.

is equal to (equality operator) 10==20 returns False


,_
.- is not equal 10!=20 returns True

> is greater than 10>20 returns False

< is less than 10<20 returns True

>= is greater than or equal to 10>=20 returns False

<= is less than or equal to 10<=20 returns True

Comparison operators
Logical operators
The logical operators perform logical operations on variables.

x=2
&& and y=3
(x < 10 && y > 1) returns True
x= 12
II or y=3
(x==5 II y==5) returns False
x= 12
not y=3
!(x==y) returns True

Logical operators

String operators
A string is a set of characters. To join two or more string values together, you use the
plus '+' operator. This is also known as the string concatenation operator.
For example, a HTML code using the string concatenation operator for the output in
the screen on the next page is given below:
<HTML>
<HEAD>
<BODY>
<SCRIPT language= "JavaScript">
var str1,str2
str1 ="Hello"
str2="Friends"
document.write(str1 +str2+" </Br>");
/Ito add a space in between
document.write(str1 +II II +str2);
</SCRIPT>
</BODY>
</HEAD>
</HTML>
- [J X

f--f. _ h * l l
~~---------- ~-- -
HelloFriends
Hello Friends

Output using string operators

Methods for the window object


Let us now learn to write some more JavaScripts
using various methods for the window object.
The alert window
window.alert () method stays on the top of
window. alert () is a method of the window object. all other windows
It is the simplest dialog box used to display a until it is closed by clicking
short message to the user in a separate small on the OK button.
window. The dialog box contains the text given as
a parameter to the alert() method and a button labelled OK.
The syntax for the alert box is:
window.alert (message)

alert (message)

It is not necessary to specify the window object, you can leave it out of
the code.
For example, the HTML code using the window.alert () method for the output shown in
the screen below is as follows:
<HTML>
<HEAD>
<TITLE>Using window.alert(}</TITLE>
</HEAD>
<BODY>
<H2>alert window demo</H2>
<SCRIPT language="JavaScript">
alert(" Hi! \n JavaScript is very interesting")
</SCRIPT>
</BODY>
</HTML>

alert window demo


M~sage from webpage

Hi!
Ll_ Java Script is very interesting

OK

Output using the window. alert() method

In the above code \nor newline is used instead of the <BR> HTML tag.
HTML tags are not supported with the object window because it opens as a
separate pop up window, not as a separate web page.

window.confirm() method
The confirm dialog box is also a method of the window object. The conf1Tll1 box
includes both OK and Cancel buttons. This method returns the value True if OK is
pressed and False if Cancel is pressed. Confirm boxes are different from alert boxes
because they evaluate a value, based on a decision made by the user.
The syntax for the confirm box is:
window.confirm(message)

confirm(message)
For example, the HTML code using the window.confmn() method for the output shown
in the screen below is shown here:
<HTML>
<BODY>
<SCRIPT language="JavaScript">
var reply= confirm("You must always follow the traffic rules")
document.write(reply);
</SCRIPT>
</BODY>
</HTML>

MI!Ssage from webpage

8 You must always follow the traffic rules

OK jj Cancel

Output using the confirm() method

In the above example, the value returned when OK is clicked is True, but whereas
when Cancel is clicked the value, is False.
window.prompt() method
The prompt dialog box is another method of the window object. This method is used
for obtaining input from the user. It displays an Explorer User Prompt dialog box
with a message and an input field.
It is similar to the confirm box, except that it returns the value of the input field, rather
than True or False.
The syntax for the prompt box is:
window.prompt (message, default value)

prompt(message, default value)


where

message: This can be any text to be displayed in the prompt window.
default value: This can be any default value given in an input box before the user
enters a value.
For example, the HTML code using the window. prompt() method for the prompt box
(see below) and the output shown below is given here:
<HTML>
- C X

+--> ~ ~ 1'1*0
<BODY>

<SCRIPT language="JavaScript">
var name1 ~I
name1 =prompt(" Enter your
friend's name","abc")

document. write(" <FONT


color='blue' size='6'> Hello Prompt box
"+name1 +"!<BR> Which book .~ ~ -x­

+- -> ~~1'1*0
did you read today? ~ ~~
HdloM.Jck\'1
</ FONT><BR> "); \Vbicb book dad you read tod.sy~

</ SCRIPT>

</ BODY>
Output to the program
</ HTML>
If you click on the Cancel Button for the prompt box, the value returned will
be null.

n l
"'.., ·c; t: ) .,.
~

.----------------------------------------
.;

A. Input a name, class and section from the user. Display the message "Hi, <name>.
<BR> you study in class <class> section <section>." Choose colors of your choice.
B. Accept the radius of a circle and display the area and circumference in an alert box.

parselnt() and parseFioat() methods


parselnt() and parseFloat() methods in JavaScript are used to convert a non-number
value into numbers. parselnt() converts a string value into integers (numbers without
decimal places) and parseFloat() converts a string value into floating numbers (numbers
with decimal values).
The parselnt() method starts with the character in position 0 and checks that it is a valid
number, if it is not a valid number it returns NaN. For example,
var x= parselnt("32.87") I I returns 3 2
vary= parselnt("B-1122") II returns NaN
var z= parselnt("14square") II returns 14
A HTML code using the parselnt() method is given below:
//This is to display the sum of two numbers entered by the user.
<HTML>
<BODY>
<SCRIPT language="JavaScript">
var n 1~n2 1 tot
n 1=prompt(Enter first number 0) I

n2=prompt(Enter second number 0) I

tot=parselnt(n 1) + parselnt(n2) document.write(The total is +tot);


</SCRIPT>
</BODY>
</HTML>

Explor~r User

1~

The total is 30

Using the parselnt() method

The parseFloat() method works in a similar way to parselnt(). It starts looking at each
character string in position 0 and continues until it finds the first invalid character.
The decimal point is a valid character the first time it appears. If there are two decimal
points, the second is considered as invalid and the parseFloat() method converts the
string until the first decimal point.
For example,
var a= parseFioat("32.45.98") I /returns 32.45
var b= parseFioat("14square") I /returns 14.0
var c = parseFioat("32.76") I /returns 32.76
var d = parseFioat("0789") I /returns 789
var e = parseFioat('Vijay") //returns NaN

Try the above HTML code using the parselnt() method instead.

document. write() method Used for displaying the text on the browser window.
parseFloat() Converts the input into a numeric value.
parselnt() Converts a text value into an integer value.
Script block The section between the opening <SCRIPT> tag and the closing
<!SCRIPT> tag.
window.alert() method Displays a short message to the user in a small window.
window.confirm() method Returns true if OK is pressed and false if Cancel is pressed.
window.prompt() method Used for getting input from the user.
String concatenation The operation of joining character strings end-to-end.
~
(~
~~-!--~~-------------------------------------------------
1
I 1. JavaScript is a scripting language with a very simple syntax. It is used to
add interactivity to a web page.
2. The <SCRIPT> tag may be placed either at the head or body of a HTML
5 document. The script code can be broken into smaller parts and placed in
different sections of the HTML document.
3. If you want to run the same JavaScript on several pages, without having
to write the same script on every page, you can write a JavaScript in an
external file with .is extension.
4. JavaScript is characterised by the object model. This means that you think about your
JavaScript program in terms of the objects (the things you want to work with).
5. HTML tags can also be included in the JavaScript code to generate HTML elements
that will be displayed in the browser window.
6. Comments can be added to make the code more readable.
7. You can declare a variable in JavaScript by using var.
8. A string is a set of characters. To join two or more string values together you use the +
operator. This is also known as the string concatenation operator.
9. The confirm dialog box is another method of the window object. This method returns a
True, if OK is pressed, and False if Cancel is pressed.
10. The prompt dialog box is also a method of the window object. This method is used for
getting input from the user. It displays a prompt dialog box with a message and an input
field.
_)

A. True or false?
1. JavaScript is a very complex scripting language.
D
2. The actions you can perform on or with objects are called methods.
D
3. A program can have more than one <SCRIPT> ... </SCRIPT> tags.
D
4. Single line comments end with a double-slash (II ).
D
5. JavaScript helps to add interactive elements to HTML pages.
D
B. Give JavaScript statements to perform the following tasks.
1. Concatenating (joining) two strings: "Click" and "Start':
2. Using single line and multiple line comments.
3. Declaring four variables: length, breadth, height and volume.
4. Display a confirm dialog box with the message "Plant more trees':
C. Describe the use of the following methods in JavaScript.
1. document.write() 2. window.prompt()
3. window.alert() 4. window.confirm()
5. parselnt() 6. parseFioat()

D. Answer the following questions.


1. What is JavaScript? Why is it important?
2. Discuss object model in JavaScript.
3. How can you use HTML tags in JavaScript?
4. How do you declare variables in JavaScript?
5. Discuss various types of operators in JavaScript.

A. Write a JavaScript program to input marks of all your subjects and then calculate
the average.
B. Write a JavaScript program to take user inputs of sides of a rectangle and
calculate its area.
C. Input the first name and last name from the user and display a message ''The
name you entered is <first name><last name>".
D. Input your school name and display it in red and in a bigger font size.

A. Write a JavaScript program which takes a random integer between 1 to 10, and the
user is then prompted to input a guess number. If the user input matches the random
number, the program will display a message "Good Work" or otherwise display a
message "Not matched".
B. Write a JavaScript program to convert temperatures to and from Celsius and Fahrenheit.

You might also like