C A CBSE Code 165
C A CBSE Code 165
Computer Applications
CBSE Code: 165
Class IX and X
Contents
Class IX and X ......................................................................................................................................... 1
Introduction ............................................................................................................................................ 2
Class IX .................................................................................................................................................... 2
UNIT 1 ..................................................................................................................................................... 2
Chapter (1) - Computer System .......................................................................................................... 2
Chapter (2) – Components of Computer ............................................................................................ 4
Chapter (3) – Computer Software....................................................................................................... 9
Chapter (4) – Operating System (MS Windows) ............................................................................... 11
Chapter (5) – Computer Networking ................................................................................................ 14
UNIT 2 ................................................................................................................................................... 20
Chapter (6) – Cyber Security ............................................................................................................. 20
UNIT 3 ................................................................................................................................................... 25
Chapter (10) – Spreadsheet- OpenOffice.org Calc............................................................................ 34
UNIT 4 ................................................................................................................................................... 39
Chapter (11) – Scratch ...................................................................................................................... 39
Chapter (12) – Introduction to Python ............................................................................................. 43
Class X ................................................................................................................................................... 50
UNIT 1 ................................................................................................................................................... 50
Chapter - 1- Introduction to the Internet ......................................................................................... 50
Chapter - 2- Internet and Web Services............................................................................................ 53
UNIT 2 ................................................................................................................................................... 57
Chapter – 3 - Introduction to HTML .................................................................................................. 57
Chapter – 4 - Formatting in HTML .................................................................................................... 58
Chapter – 5 - Images, Links and Lists in HTML .................................................................................. 60
Chapter – 6 – Cascading Style Sheets ............................................................................................... 62
UNIT 3 ................................................................................................................................................... 67
Chapter – 7 – Cyber-ethics ................................................................................................................ 67
UNIT 4 ................................................................................................................................................... 73
Chapter – 8 – Scratch Programming - II ............................................................................................ 73
Chapter – 9 – Python Revision .......................................................................................................... 77
Chapter – 10 – Python Level - II ........................................................................................................ 83
1
Computer Applications CBSE Code 165
Introduction
With sudden increase in the usage of computer and software globally, schools are focusing on
computer education with the BEST (BEYOND IMAGINATION, EXCELLENT,
SYSTEMATIC, TEACHING PLAN) learning technique. But the study material used was not
fulfilling the requirement of modern BEST based training, followed with traditional
educational methodology with outdated software versions.
Computer Applications for Class IX is the latest and advanced computer book which has
been prepared, keeping in mind the interest of students and teachers in the field of
Information Technology. In compliance with the prescribed curriculum, this book covers
basics of information technology, cyber safety, Office productivity tools and programming
basics with Scratch and Python.
The book is designed with an interactive and hands-on approach to communicate the
essential aspects of computer. We have used simple language in the entire series for precise
and better understanding.
Class IX
UNIT 1
2
Computer Applications CBSE Code 165
Software: These are the set of (computer) programs. These are used to do work on the
computer.
3. Three parts of CPU are: Arithmetic and Logic Unit, Control Unit and Registers (Memory
Unit).
4. It is a type of memory which is primarily used by CPU for booting of system and
temporarily storage of data for processing. For example, RAM.
5. ROM helps the computer to start up. It contains a set of start-up instructions called,
“bootstarp loaders”. These instructions help the computer to start up or boot itself, when
we switch it ON.
6. Differences between RAM vs ROM are:
RAM ROM
i. It is volatile memory. i. It is non- volatile memory.
ii. It is primarily used by CPU for ii. It is used by CPU for booting of
temporarily storage of data for processing. system.
iii. Some types of RAM are SRAM, DRAM, iii. Some types of ROM are EPROM,
etc. EEPROM, etc.
7. Computers are being used to develop computer-based training packages, for e-learning
and online education (using Internet). Now, students are exposed to the internet and it
helps them to improve and update their knowledge.
8. Computers are used for research and experiment purposes. Weather forecasting,
automobile designing, nuclear weapon designing and testing, space research, aircraft
simulation designing and much more scientific research areas are there, where computers
(super and mainframe computers) are being used.
Computer Aided Designing (CAD) and Computer Aided Engineering (CAE) are few
tools used in to assist in the creation, modification, optimization of a 2D and 3D design
and to analyze the robustness and performance of components and assemblies/ products.
9. Computers are proving a very big means of communication. Along with e-mail service,
text, voice and video chatting are very popular way of communication now-a-days.
10. Computers are used to handle the accounts of customers. These days, all the nationalized
banks are computerized and centralized. We can see ATMs around us to withdraw cash
from our bank account without going to bank. E-banking or internet banking and mobile
banking are widely used widely by masses, and have numerous benefits to offer.
11. Using computer we can play games (on Internet also), listen to music and watch music.
Computer also helps to create cartoon movies (2D and 3D). Use a computer we can
generate special effects on a movie.
12. Computer plays the major role to develop crucial military weapons. Whether it is missile
system, tanks, sun-marines, War ships etc. computers are used (with special hardware and
softwares).
13. Computers are used by police to monitor speeding vehicles as well as to monitor people
violating law. Advance computer techniques like DNA and finger print matching
techniques can be used to identify the criminals.
3
Computer Applications CBSE Code 165
4
Computer Applications CBSE Code 165
11. (a) Dot Matrix printer 12. (c) Plotter 13. (d) RAM
14. (d) Cache 15. (a) Blu-ray Disc 16. (c) Bit
B. Short answer type questions.
1. (a) Difference between mechanical mouse and optical mouse.
Mechanical Mouse Optical Mouse
(i) It has a rubber or metal ball on its (i) It has a LED (laser) on its underside.
underside.
(ii) A sensor within the mouse detects the (ii) It detects the movement of mouse
motion of ball and moves the pointer. relative to the surface by sensing changes in
the reflected light.
5
Computer Applications CBSE Code 165
1. Five examples of input devices are keyboard, mouse, scanner, OCR and MICR.
2. Joysticks are often used to control video games. Joysticks are also used in civilian and
military aircraft, cranes, underwater unmanned vehicles, wheelchairs, surveillance
cameras and zero turning radius lawn movers.
3. Microphones are used in many applications such as telephones, tape recorders, hearing
aids, motion picture production, live recording and audio engineering, in radio and
television broadcasting and in computers for recording voice.
5. Four example of output devices are monitor, printer, speakers and plotter.
6. A Pen drive is a USB flash memory. It is a portable storage media. It can store up to 1 TB
data. (Kingston’s DataTraveler HyperX Predator 3.0 can store up to 1TB).
7. A memory stick is a removable flash memory card format, digital data storage device
which is used in digital cameras, digital music players and camcorders.
C. Long answer type questions.
1. (a) Difference between Hard Disk and Pen Drive.
Hard Disk (internal) Pen Drive
(i) It is non- portable device. (i) It is portable memory.
(ii) It is generally used to store data in (ii) It is used to transfer data form one
6
Computer Applications CBSE Code 165
7
Computer Applications CBSE Code 165
8
Computer Applications CBSE Code 165
9
Computer Applications CBSE Code 165
10
Computer Applications CBSE Code 165
11
Computer Applications CBSE Code 165
9. Right click on the Desktop → Select the Personalize option → Select the required
wallpaper from the available themes.
10. To arrange icons by name, type, date, or size, right-click on blank area on the desktop. →
click Sort option → Click the required option (e.g. Name, Size, Item type and Date
modified).
11. Microsoft Windows is an operating system. It contains the instructions for your computer
to open, manage and store its directories and files. A Window is the part of MS-Windows
that can be called an application window or main window. It typically has a frame with a
title bar, Minimize and Maximize buttons, and other standard UI elements.
12. Windows operating system has some inbuilt application and utility tools that are known
as accessories. It contains some important applications such as Notepad, CMD,
calculator, WordPad, System Tools, etc.
C. Long answer type questions.
1. Below given are mouse (click) functions:
Clicking (left clicking) – Left- click of the mouse is used to select and click items,
position the cursor in a document, and drag items.
Right- clicking – Right- click of the mouse is used to display the context menu of tasks
or options that changes depending on where you click.
Dragging - Dragging (sometimes called dragging and dropping) is most often used to
move files and folders to a different location and to move windows and icons around on
the screen.
2. Icons - Icons are the small graphical symbol of a program on the desktop. It give you the
quick access shortcut of the installed application in the computer system. You can show
them all or hide them all, if you prefer a clean desktop. You can also resize them.
Wallpaper - Wallpaper is an image used as a background of a graphical user interface on
a computer screen or mobile communications device. On a computer it is usually for the
desktop, while for a mobile phone it is usually the background for the 'home' or 'idle'
screen. Though most devices come with a default picture, users can usually change it to
files of their choosing.
Gadgets - These are the small and helpful technical objects. They have their specific
function. It is very useful for giving technical help to users like watching time, calendar,
weather, puzzle games, and many more.
Taskbar - This is a bar that is usually found at the bottom of the screen. It has the start
button, the clock and some toolbar and the buttons corresponding to all open windows.
3. The steps to change system date and Time are:
i. Click on time and date on the Taskbar.
ii. Click on ‘Change date and time settings’ link, the Date and Time dialog box appears.
iii. On Date and Time tab, click on ‘Change date and time…’ button, the Date and Time
Settings dialog box appears.
iv. Set the date and time in the given controls and click OK button, the current dialog box
disappears.
iv. Click on OK button on Date and Time dialog box.
12
Computer Applications CBSE Code 165
4. Computer window provides access to the files and folders that are stored in the memory.
We can view, delete, copy or move files and folders using this window.
Several parts of Computer window are,
i. Address bar- It displays the address of the selected drive or folder.
ii. The Search box- It helps to search about files and folders in the computer.
iii. Navigation pane- Using navigate pane, we can navigate through all the memory
drives.
iv. Toolbar- It provides the tools related to the selected drive and folder to work with
them.
v. Details pane- It gives the details of the selected drive, folder and file like- drive size,
total number of items, date of creation, date of modified, etc.
5. Steps to copy a folder from the Desktop to D: drive are,
i. Select the folder from the Desktop and right click on it.
ii. Choose the Copy option from the shortcut menu.
iii. Open the D: drive of the computer using Computer window.
iv. Right click on the empty area in the drive and choose the Paste option from the
shortcut menu.
6. Various parts of a window are –
Title Bar - The title bar tells you the name of the application. There is an exception
however; Windows Explorer will not show its name in the title bar. The tile bar also
contains 3 sizing buttons, at the top right corner.
Maximize Button - Click on this button to enlarge the window to fill the entire desktop.
Minimize Button - This button is used to reduce the size of the window to a button on
the taskbar. Minimizing a window does not close it; it simply hides it from you.
Resize Button - This button is used to restore the window to its original size i.e., to the
size before you maximized it.
Close Button – This button is used to close active window.
Menu Bar - Below the title bar is Menu Bar. This displays the various menus available to
you. When you click on a menu option, says File, all the sub-options appear as a drop
down menu. You can select any one of them by pointing to it with the mouse pointer and
then clicking it.
Horizontal Scroll Bar – This is used to move the page from left side to right side.
Vertical Scroll Bar - This is used to move the page from top to bottom.
Workspace – Workspace is the area of a window where a user can perform the task by
entering the text.
7. Steps to apply the screen save are –
i. Right click on empty area on the Desktop and select Personalize option.
ii. A window appears to ‘change the visuals and sound on your computer’.
13
Computer Applications CBSE Code 165
iii. On the right-bottom corner, click on Screen Saver icon/link, the Screen Saver Settings
dialog box appears.
iv. Select the required pre-installed screen saver from the list in Screen Saver section.
vi. Set the timings for the screen saver using Wait text box.
vii. You can see the preview of the screen suing Preview button.
viii. Click on Apply button. Click on OK button.
8. (c) Wi-Fi 9. (d) ARPANET 10. (a) Modem 11. (b) Infrared
12. (c) Data 13. (a) Multimedia
B. Short answer type questions.
1. Modem is a device that is used to connect a computer on internet with the help of a
telephone line.
2. Communication media is a way through which a communication channel can be
established between devices to communicate and sharing the data.
3. An Ethernet cable is one of the most popular forms of network cable used on wired
networks. Ethernet cables connect devices on local area networks such as PCs, routers
and switches.
4. Bluetooth is a wireless technology standard for exchanging data over short distances from
fixed and mobile devices and building personal area networks (PANs).
5. IR wireless is a wireless technology in the devices or systems that convey data through
infrared (IR) radiation.
Disadvantages:
i. Infrared communication span very short distances.
14
Computer Applications CBSE Code 165
ii. Infrared signals cannot penetrate (come through) walls or other obstructions and work
only in the direct ‘line of sight’.
6. Interspace is a client/server software program that allows multiple users to communicate
online with real-time audio, video and text chat in dynamic 3D environments. Inter space
provides the most advanced form of communication available on the Internet today.
C. Long answer type questions.
1. Advantages of computer networks are :
i. Share printers and other peripherals to cut down the cost of individual equipment for
each machine
ii. Backups across the network of all machines with a click of a button or automatic to
ensure all the data are stored in case of fire or theft.
iii. Internet, Point Of Sale programs and accounting programs can be shared across
multiple computers for multi-user access
4. Sensitive files and programs on a network are password protected so that all the
information must be secured on the network.
iv. The main advantage of a computer network is that it allows a user to file sharing and
remote file access from one computer to another computer.
2. LAN - Local Area Networking is used primarily in small areas such as schools, hospitals
and office buildings. Local Area Networking is one of the older types of networks.
TCP/IP is used as the method of communication between computers in Local Area
Networking.
MAN - Metropolitan Area Networks are not commonly used these days, they are used to
create communication between systems in an entire city. Hence a Metropolitan Area
Network area falls between the sizes Local Area Networks, and Wide Area Networks.
WAN - Wide Area Networks are used to connect server machines and computers across
countries for sharing the information and updates. Wide Area Networks, are used across
the globe, many networks connect with one another across countries to create one giant
Wide Area Network. Internet is the example of WAN.
3. Modem: Modem is a device that enables a computer to transfer the data through telephone
cables. The modem changes these digital signals to analog signals that can be transmitted
through the telephone cables.
Network Interface Card (NIC)/ LAN card: A Network Interface Card (NIC) is a computer
hardware device designed to allow computers to communicate over a network.
Repeater: A repeater is a network device. It receives a signal and regenerates it. It then
transmits the signal at a higher level or higher power onto the other side. So, the signal
can cover longer distance without any change.
Hub: A hub is a component that duplicates the information and makes the data available
to all systems. A hub has multiple ports. When a data packet arrives at one port, it is
copied to other systems.
Bridge: A bridge is a device used to connect two local area networks (LANs) or two
segments of the same LAN that use the same protocol. It forwards data depending on the
destination address in the data packet.
15
Computer Applications CBSE Code 165
Switch: A switch is a device used to transmit the data received from several input ports to
the specified output port, which in turn sends data to the receiver's system. It identifies the
output ports' addresses by using the MAC address in a LAN and by using the IP address
in a WAN.
Router: A router is a device used to forward the data packets. It finds a specified path to
send data through networks. It can be used to connect a LAN to a LAN, a WAN to a
WAN, or a LAN to the Internet.
4. a) The differences between wired and wireless network are –
WIRED NETWORK WIRELESS NETWORK
i) If you can see the network cable going i) Wireless networks sometimes connect
to a location, that location can be locations that you cannot visibly see.
connected to the network. Additionally, wireless networks might
not connect locations that you cansee
visibly.
ii) All of the nodes on a wired network ii) Many nodes on a wireless network
can hear all other nodes. cannot hear all of the other wireless nodes
on the same network.
iii) The presence of one wired network iii) One wireless network can affect the
has no effect on the performance of performance of other wireless networks.
another wired network.
iv) Wired network performance is not iv) Wireless network performance can be
affected by the atmosphere. affected by the atmosphere.
16
Computer Applications CBSE Code 165
connect directly with each other often used for, accessing the internet.
wirelessly.
ii) It is used to connect the devices on a ii) Wifi is used to connect the devices on
PAN network a LAN network
iii) Bluetooth allows devices to share the iii) Wi-Fi allows the devices to connect
files such as music, photos and allow over the internet.
speaking with wireless headset.
iv) Bluetooth provides a short range to iv) Wi-Fi single can be picked up to 300
connect the devices. (30 feet). feet to connect devices.
5. Optical fiber technology uses glass (or plastic) threads (fibers) to transmit data. A fiber
optic cable consists of a bundle of glass threads, each of which is capable of transmitting
messages modulated onto light waves.
Fiber optics has several advantages over traditional metal communications lines:
• Fiber optic cables have a much greater bandwidth than metal cables. This means that
they can carry more data.
• Fiber optic cables are less susceptible than metal cables to interference.
• Fiber optic cables are much thinner and lighter than metal wires.
• Data can be transmitted digitally (the natural form for computer data) rather than
analogically.
Its advantages are:
• It is expensive than other wired media.
• It has higher installation cost.
6. We can use Internet in different ways. Some of the uses of Internet are given below:
i. E-mail and Chatting- You can send and receive instant messages (e-mails) using
internet. Various things such as pictures, videos, songs, e-cards can be added along with
email messages. Your messages are delivered instantly to people anywhere in the world,
unlike traditional mail that takes a lot of time. E-mail is now an essential communication
tools in business. It is also excellent way of keeping in touch with family and friends. The
advantages to email is that it is free (no charge per use) when compared to telephone, fax
17
Computer Applications CBSE Code 165
and postal services. We can chat with our friends using ‘chat room’ and stay in touch with
the friends.
ii. News and Information- The internet provides facility to read different newspapers
online and get the information regarding various topics of our interest such as science,
technology, sports, education, etc. It also keeps us updated on current events. The Internet
is a virtual treasure trove of information. Any kind of information on any topic under the
sun is available on the Internet. The ‘search engines' on the Internet can help you to find
data on any subject that you need.
iii. Services- Many services are now provided on the internet such as online banking, bill
payments, job seeking and applications, and hotel reservations, railway and air tickets
booking etc. Often these services are not available off-line or cost more.
iv. Online Shopping- The internet is a very effective way to buy and sell products all
over the world. Along with getting information on the Internet, you can also shop online.
There are many online stores and sites that can be used to look for products as well as buy
them using your credit card. You do not need to leave your house and can do all your
shopping from the convenience of your home.
v. Communities- Communities of all types have sprung up on the internet. It's a great
way to meet up with people of similar interest and discuss common issues.
vi. Software Downloading- You can download free games, videos, software,
educational information and music from internet.
7. Multimedia means media or medium of communication that uses multiple forms of media
such as text, audio, images, video, animation and interactivity. Multimedia softwares are
computer applications which can process information. The information can be processed
in a number of media formats. The addition of animated images (for example, animated
GIF on the Web) produces multimedia, but it has typically meant one of the following:
• Text and sound
• Text, sound, and still or animated graphic images
• Text, sound, and video images
• Video and sound
• Multiple display areas, images, or presentations presented concurrently
D. Match the following –
COL-I COL-II
1. - d.
2. - c.
3. - e.
4. - f.
5. - b.
6. - a.
18
Computer Applications CBSE Code 165
19
Computer Applications CBSE Code 165
UNIT 2
Chapter (6) – Cyber Security
A. Choose the correct answer.
1. a) Cyber-safety
2. d) Online Advertising
3. a) Trojan
4. b) Phishing
5. c) hardware, software
7. a) Identity theft
8. d) Socket
9. c) Undesired emails
10. a) Parents
Home user, professionals, students, industries and government, everyone needs to have a fundamental
understanding of cybercrime, online threats and their preventive and countermeasures. Knowing the
threat and what to do once it occurs is the important part of digital literacy.
Worms are the program codes that replicate over a network from one computer to the other and make
the computers slower and sluggish in speed.
IP Address, HTTP Referrer, Cookies, Fingerinting, User histroy tracking, online advertising,
analytics.
20
Computer Applications CBSE Code 165
i. Never give away any sensitive information related to finance and security in reply to undesired
emails and never on phone.
ii. Always cross check the source of email and phone call with the concerned agency
Online predators are individuals or groups who lure children into any unethical activity through
games, live video chat, mind affecting videos and music, thought provoking speeches. Children suffer
mental stress and sometimes nervous breakdowns due to threats.
Any sort of threat, scare or harassment over internet is the act of cyber bullying. Undesired messages
in bad taste and intentions, online mockery in friend groups or circles, stalking someone's online
profile and trying to post unwanted updates, sending unsolicited private messages, videos, and
pictures.
Do not use cell phone everywhere – keep your senses free to perceive other stimuli like while crossing
road, driving, using escalators, crowded areas etc.
Cyber-safety generally refers to a set of discipline, measures and actions taken to protect personal
information and your computer from attacks. It also involves the practice to respect others'
information privacy and not to indulge knowingly in divulging any information not meant for
unauthorized entities.
Considering the size, span, variety of technologies and devices, fighting and preventing cybercrime is
a challenge. Policies, regulations, strategies and implementations of practices, discipline and
technology to prevent or fight cybercrime is called cybersecurity.
Unauthorised access to one's information online and exploiting it to bully, commit fraud and extortion
is called cybercrime.
Internet is “network of networks”. That means it is spanned all over the world with several networks
connected to it. Across the world there are thousands of computers and other communication devices
which are connected and online over the internet at a given point of time. Identifying each of these
devices needs a system. IP address is that technology. IP address is a unique code assigned to each
21
Computer Applications CBSE Code 165
device over a network. One part of IP address identifies the netwrok and the remaining part identifies
the device in that network. It is like Street Number and House Number. Network address is Street
Number and device address is House Number. This way, IP address of user's device identifies that
user on the Internet.
Cookies or HTTP cookies is the most traditional and common way to track information about us such
as website visiting time, duration and frequency, products added in the shopping cart while online
shopping, data entered into form-fields like name, address, and passwords etc. Later, on next visit of
the user such information is extracted from the cookies created during last visit on user's computer.
Cookies are not harmful since they store small piece of information in plain text form which does not
affect computers in any way.
4. What do you mean by fingerprinting. What is the basic difference between active and passive
fingerprinting?
Techniques using fingerprinting tracking are done without storing cookies on user's device. Here, a
user, device or combination is identified by the information that user reveals unsuspectingly.
Fingerprinting can be done in two ways:
Passive fingerprinting: In this technique, website visited by the user observesuser's browsing, the links
and choices clicked and from that, create a unique identifier for the user-device combination. With
this fingerprint, tracking websites follow users for longer periods of time.
Active fingerprinting: In addition to passive fingerprinting, websites send some queries to the user's
computer without user being aware about themand some of the information like name and version of
the operating system and browser, fonts etc. is collected.
A firewall provides another level of protection to prevent incoming attacks. Operating system
provides firewall protection which can be activated to filter unwanted access and attack to the
computers over a network. Private networks use firewalls to keep unwanted IP addresses filtered out.
A firewall provides a security combination of hardware and software that is used to protect a server
and network resources from unauthorized access and intrusion. Firewall checks the incoming data
packets over the networks and filters out which do not have suitable and sufficient permission to
access the network. This way an extra level of protection is created right at the gates of the network.
Hardware firewalls are more powerful and effective and they are easy to setup and configure.
Hardware firewall is a dedicated computer that provides firewall protection to the network. Software
firewalls needs to be installed on each computer. On a network, software firewalls are installed at the
gateway server.
6. What is the technique of eavesdropping called? How can we protect against it?
Spyware is used for the purpose of eavesdropping. It installs itself on the computer without user's
knowledge and monitors keystrokes, takes screenshots, reads chat, collects devise and user
information and forwards it to the malicious owners of such program.
22
Computer Applications CBSE Code 165
Protection
Never give away any sensitive information in reply to undesired emails and on phone.
Download and use registered secured apps on your mobile phones like BHIM instead of unknown
apps.
Phishers address their targets with fancy terms like "valued customer" but genuine agency will
address you by your correct name, username, customer ID etc.
Phisher's message could be slightly rude in informing you cancellation or suspending your account.
Check the website's certificate icon of a closed padlock in the address bar.
Online predators lure children online whose young immature minds can be affected by unethical
games, live video chat, mind affecting videos and music and thought provoking speeches.
Cyber bullying threatens and affects young minds intensely even up to the threats of death. Undesired
messages in bad taste and intentions, online mockery in friend groups or circles, stalking someone's
online profile and trying to post unwanted updates, sending unsolicited private messages, videos, and
pictures distress the children mentally.
I. Keep track of your credit transactions and do not authorise anyone else to access yur card.
II. Share information online with care.
23
Computer Applications CBSE Code 165
III. Educate yourself about cyber frauds. Do not ignore but read and understand the security
guidelines sent by authorized agencies like banks and government.
IV. Avoid keeping sensitive information in the form of images and editable documents n a public
domain.
V. Avoid automatic online transaction settings. Always take pain of entering the details for each
transaction.
10. List any 5 ways to use your mobile phone responsibly.
24
Computer Applications CBSE Code 165
UNIT 3
Chapter (7) – Word Processor- OpenOffice.org Writer-I
25
Computer Applications CBSE Code 165
12. Margin refers to the blank white area near the edges (top, bottom, left and right) of the
page in the document.
C. Long answer type questions.
1. The main parts of Writer window are,
• Title Bar: It is located at the top of the window. It displays the name of the application
and the document.
• Menu Bar: It contains menus such as File, Edit, View, Insert, Format, Table, etc.
• Standard Toolbar: It contains standard options like New, Open, Save, Cut, Copy,
Paste, Spell Check, etc.
• Formatting Toolbar: It contains formatting options like Font type, Font Size, Font
style, Alignment, etc.
• Ruler: The ruler is used to scale the document. There are two rulers- horizontal ruler
and vertical ruler.
• Scroll Bars: Scroll bars are used to navigate throughout the document. There are two
types of scroll bars: horizontal scrollbar and vertical scrollbar.
• Help: The Help option is used to show the help dialog box.
• Text Area: The text area is used to create the document.
• Status Bar: Status bar displays information such as current page, column, line number
at which the cursor is currently placed, text insert mode, zoom percentage etc.
• Zoom Control: It is used to increase or decrease view of the window contents.
2. Writer provides Spelling and Grammar Checker which enables us to search for and
correct all spelling and grammar mistakes in your document. Word is intelligent enough
to identify misspelled or misused, as well as grammar errors and underlines them as
follows.
• A red underline beneath spelling errors.
• A green underline beneath grammar errors.
• A blue line under correctly spelled but misused words.
The following methods to fix the spelling mistake are:
Ignore: If you are willing to ignore a word then click this button and word ignores the
word throughout the document.
Add to Dictionary: Choose Add to Dictionary to add the word to the Word spelling
dictionary.
Change: This will change the wrong word using the suggested correct word.
AutoCorrect: If you select a suggestion, Word creates an AutoCorrect entry that
automatically corrects this spelling error from now on.
3. Using Font tab on the Character dialog box we can format characters/text by setting
appropriate values of various options. The Word processor provides ways to apply the
various font formatting options (or character formatting options) to your text. Many of
these options are displayed directly in the Font tab.
26
Computer Applications CBSE Code 165
The formatting options that you can configure on the Font tab influence the appearance of
the individual characters in your text.
4. A Subscript or Superscript is a number, figure, symbol, or indicator that is smaller than
the normal text and is set below or above the text. Subscripts appear at below the
baseline, while superscripts are above the baseline. Subscripts and superscripts are best
known for their use in formulas, mathematical expressions, and specifications of chemical
compounds.
For example, Superscript- (3)2 - (4)2 = (3 – 4) (3 + 4)
Subscript- H2O
5. Alignment refers to the arrangement of the text and graphics relative to the margin. There
are four types of paragraph alignment are available in Microsoft Word left-aligned,
centered, right-aligned, and justified.
Aligned Left: A paragraph's text will be said left aligned if it is aligned with left margin.
Centered: A paragraph's text will be said center aligned if it is in the center of the left
and right margins.
Align Right: A paragraph's text will be said right aligned if it is aligned with right
margin.
Justified: A paragraph's text will be said justify aligned if it is aligned with both left and
right margins.
Alignment using Format menu:
i. Put the cursor in the paragraph that is to be aligned.
ii. Click on Format menu and select Paragraph option.
iii. In the Paragraph dialog box, click on Alignment tab.
iv. Click on the desired alignment option.
Alignment using Format toolbar:
i. Put the cursor in the paragraph that is to be aligned.
ii. On the Format toolbar, click on the desired alignment option.
6. Paragraph Indentation determines the distance of the paragraph from either the left or the
right margin. Within the margins, you can increase or decrease the indentation of a
paragraph or group of paragraphs.
Before text: Before text indentation means to indent from the left page margin.
After text: After text indentation means to indent from the right page margin.
First Line: It specifies the first line indent. For positive indent we need to provide a
positive value and for negative indent we need to provide negative.
Automatic: It automatically indents the first line according to the font size and lines
spacing. Indent setting of First line box is ignored.
D. Write the steps to do the following.
Note: Practical steps.
27
Computer Applications CBSE Code 165
28
Computer Applications CBSE Code 165
29
Computer Applications CBSE Code 165
2. Mail merge is a feature that produces multiple documents from a single template form
and a structured data source. The letter may be sent out to many "recipients" with small
changes, such as a change of address or a change in the greeting line. MS Word Mail
Merge allows a user to send letters or documents to many people simultaneously; users
simply create one document that contains the information that will be the same in each
version, and then add placeholders for the information that will be unique to each version.
The different components of mail merge are –
Main Document - This is the document contains the original message that needs to be
sent to multiple persons.
Data Source - It is a data base link that contains the personal information of the persons
in tabular format.
Merge Field – These are the fields that needs to be merged in main document from data
source to insert the personal information of the recipient. For example first_name,
last_name, address, ph_no, city, etc.
Merged Document - This is the main document that contains the message and
information of the recipient.
3. Perform the following steps to create mathematical expression in the document:
i. Click on Insert → Object → Formula option.
ii. The equation editor opens with at the bottom of the document with Formula Elements
window.
If Formula Elements window does not appear, click on View → Formula Elements
option.
- Top of the Formula Elements window shows the formula or symbols.
- Bottom part shows the formulas or symbols available in the selected category (at the
Top).
Now, type the equation in equation editor (for example, +a/a-b).
iii. A box appears in the document containing the formula inserted in equation editor.
After inserting the equation, click anywhere in the document, both equation editor and
Formula Elements disappears.
D. Write the steps to do the following.
Note: Practical steps.
30
Computer Applications CBSE Code 165
31
Computer Applications CBSE Code 165
4. Custom animation is used to apply different types of animation to the graphics, charts and
pictures so that they become animated during a presentation. Many presenters make use
of this feature so as to make their presentations interesting and dynamic.
Different options available in custom animation are Add, Change and Remove the
animation (effect), Set Start, sound (using Property) and Speed properties.
5. A new slide can be inserted in the presentation by clicking on Insert menu and choose the
new slide option. OR By pressing CTRL+N key from the keyboard.
6. To delete a slide from the presentation, select the slide in the Slide pane and press Delete
key on the keyboard.
7. Sound and timing on an object can be applied by using the Modify effect pane in custom
animation.
8. Rehearse Timings Tool is used to insert the timings for a slide to be appear on the screen
during the slide show view.
9. Graphics mode in Picture toolbar is used to adjust the graphics mode of a picture in a
slide i.e. default, grayscale, black/white and watermark.
C. Long answer type questions.
1. The components of Impress window are-
i. Title Bar - It display the name of the current presentation.
ii. Menu Bar - It displays the various options like File, Edit, Insert, Format etc.
iii. Toolbars – They contain the shortcut buttons of various commands available in
options of menu bar.
iv. Slide Pane - The Slides pane contains thumbnail pictures of the slides in your
presentation, in the order they will be shown.
v. Task Pane - It has the various panes, such as Master Pages, Layouts, Table Design,
Custom animation and Slide Transition, etc.
vi. Slide View - This contains the different views to see the presentation i.e. Normal,
Slide Sorter, Outline, etc.
vii. Workspace – It display the current slide according to a selected view.
viii. Drawing Toolbar - This toolbar contains various graphical objects i.e. textbox,
shapes, etc.
ix. Status Bar - The status bar, positioned at the bottom of the Impress window, contains
information that you may find useful when working on a presentation.
2. A slide view is the way to view the content on a slide. Different types of slide views in
Impress are –
i. Normal View: It allows inserting text, graphics, objects and animation effects in the
slide. It is the default view in which a presentation is opened.
ii. Outline View: It shows the contents of all the slides in outline form. This view is
used to editing of the text only.
iii. Notes View: This view is used to add some notes related to the slide. These notes will
not be displayed in the slide show.
32
Computer Applications CBSE Code 165
iv. Handout View: This view is used to adjust some slides on a single page which is
meant to be printed.
v. Slide Sorter View: This view shows all the slides that you have created in a small
size. You can quickly look at and recognize all the slides and rearrange them
according to your requirement.
vi. Slide Show View: In a slide show all the slides in your presentation are displayed one
by one in full screen. A slide show can be a very useful tool for teaching, sharing and
learning.
3. A Filter tool in the picture toolbar is used to format a picture according to the user
requirement. It has the various options to change the look and appearance of the picture.
Different tools available in Filter tool are –
33
Computer Applications CBSE Code 165
34
Computer Applications CBSE Code 165
be viewed, edited and printed. Data can also be viewed in pictorial form by using charts
and graphs. With electronic sheet one can easily get formatted reports. Some examples of
spreadsheet usage are-
i. Spreadsheets act like a calculator automatically while doing calculations.
ii. Spreadsheets are used for tracking personal investments, budgeting, invoices,
inventory tracking, statistical analysis, numerical modeling, address books, telephone
books, printing labels, etc.
iii. Spreadsheets are used in almost every profession to calculate, graph, analyze and
store information
iv. Spreadsheets are made up of columns, rows, and cells (intersection of a column and
row. A cell can contain data including text (strings or labels), numeric data and
formulas (mathematical equations).
2. In Calc, there are some predefined operators to perform calculations. The addition,
subtraction, multiplication and division operators return numerical results. The Negation
and Percent operators identify a characteristic of the number found in the cell, for
example -37. The example for Exponentiation illustrates how to enter a number that is
being multiplied by itself a certain number of times, for example 23 = 2*2*2.
Operator Name Example
+ (Plus) Addition =1+1
- (Minus) Subtraction =2-1
- (Minus) Negation -5
* (asterisk) Multiplication =2*2
/ (Slash) Division =10/5
% (Percent) Percent 15%
^ (Caret) Exponentiation 2^3
3. Editing - When it comes to editing the contents of a cell in Excel you have a number of
different options depending upon whether you wish to completely replace or just modify
the current contents. To work with data on a worksheet, you first have to enter that data in
the cells on the worksheet. Then, you might want to adjust the data so that it is visible,
and display it just the way that you want. Editing in spreadsheet can be done in many
ways i.e. Replace the Current Cell Contents with New Data, Change Part of the Cell
Contents, Copy contents of a cell. Move the contents of a cell, Delete the contents of a
cell etc.
Formatting - Formatting means the general arrangement of data. With formatting we can
make some data to be bolder, rotated or in different color. So basically formatting
provides worksheet a neater and more attractive look.
4. Difference between terms –
a. Difference between Relative and Absolute cell reference.
35
Computer Applications CBSE Code 165
36
Computer Applications CBSE Code 165
37
Computer Applications CBSE Code 165
Gridlines - These are the horizontal and vertical lines in the plot area. The gridlines are
inserted in the chart to enhance the readability.
Plot area – This is that area of chart in which your data is plotted.
6. The IF() function returns one value if a condition you specify evaluates to TRUE, and
another value if that condition evaluates to FALSE. For example, the formula
=IF(A1>B1;"Cell 1 is greater";"Cell 2 is greater") returns "Cell 1 is greater" if A1 is
greater than B1, and "Cell 2 is greater" if A1 is less than B1.
Syntax - IF (logical_test; [value_if_true]; [value_if_false])
=IF(A1>B1;"Cell 1 is greater";"Cell 2 is greater")
The IF function syntax has the following arguments:
logical_test - Any value or expression that can be evaluated to TRUE or FALSE. For
example, A1>B1 is a logical expression; if the value in cell A1 is greater than B1, the
expression evaluates to TRUE. Otherwise, the expression evaluates to FALSE. This
argument can use any comparison calculation operator.
value_if_true - Optional. The value that you want to be returned if the logical_test
argument evaluates to TRUE.
value_if_false - Optional. The value that you want to be returned if the logical_test
argument evaluates to FALSE.
D. Write the steps to do the following.
Note: Practical steps.
A. Fill in the blanks.
1. Workbook 2. Cell 3. 1048576, 1024 4. Cell reference
5. Cell Name Box 6. Functions 7. Formula 8. Chart
B. State true or false.
1. True 2. True 3. False 4. False 5. True 6. True
7. True 8. True
38
Computer Applications CBSE Code 165
UNIT 4
Chapter (11) – Scratch
A. Choose the correct answer.
1. d) software 2. b) sprites
3. a) blocks 4. a) 0, 0
5. c) event 6. b) looping
Sprites are various objects that together make your animation and found in Sprites library while
Blocks are the building components of the animation script.
3. Which blocks help in handling events in scripts. Give 3 examples of such blocks.
Event blocks help in handling events in scripts like When this sprite is clicked, when ___ pressed,
when animation button (flag icon) is pressed.
By using Motion block Move ___ steps and setting steps to 100.
6. How will you add two sprites from People category in sprites library?
Above the Sprites pane, click on Sprites from library icon. Sprites library will be displayed where
sprites are organized in various categories. Click on People category and double click on the desired
sprites to add them to the stage.
Division operator block ____/____ takes two values or variables and returns the division between the
two.
39
Computer Applications CBSE Code 165
The statements in if-then block execute only if the condition associated with it is true. if-else block
has two parts: if and else. Statements in the if part execute only if the condition associated with it
returns true. If condition returns false then the statements in the else part are executed.
Coordinate system on Scratch stage is Cartesian coordinate system that includes 2 coordinates - x
(horizontal plain) and y (vertical plain).
The center of the stage is denoted with x=0, y=0. The screen is a rectangle of dimensions 480 X 360.
Across the horizontal plain, maximum value of x is 240 and minimum is -240. Across vertical plain,
maximum value of y is 180 and minimum is -180.
To run certain statements in Scratch infinitely we need to place the required statements in forever
block.
1. Describe the role of stage and sprite in writing your script in Scratch.
Stage is the place where animated output of the script is displayed. All the sprites are placed on stage
and they appear according to the flow of the scripts. Coordinate system on Scratch stage is Cartesian
coordinate system that includes 2 coordinates - x (horizontal plain) and y (vertical plain).
The center of the stage is denoted with x=0, y=0. The screen is a rectangle of dimensions 480 X 360.
Across the horizontal plain, maximum value of x is 240 and minimum is -240. Across vertical plain,
maximum value of y is 180 and minimum is -180.
2. Describe any two commonly used blocks in Motion, Event and Control categories.
Motion blocks:
move ____ steps – This block takes a number as value of the steps to move the sprite. Sprite moves in
a particular direction.
point in direction ____ block – This block turns the sprite into these 4 directions: 90 (right), -90 (left),
0 (up), 180 (down). Before moving the sprite, we can turn the sprite in desired direction using this
block.
Event blocks:
when ____ is clicked – This block allows running the script by the press of given key on the
keyboard. User can select the required alphabet, arrow key, space bar etc. from the drop-down list of
choices.
40
Computer Applications CBSE Code 165
when this sprite clicked – We can use this block when script needs to be run when user clicks with
mouse on the corresponding sprite.
Control blocks:
repeat ___ - This block executes the given statements repeatedly as many times as the value set by the
user.
forever – This block executes the given statements repeatedly until the script is forcefully closed or
any stop block is encountered.
3. What is the basic difference between turn block and point in direction block?
Turn block turns the sprite around by given degrees while point in direction block turns the sprite in
only one of the 4 directions - 90 (right), -90 (left), 0 (up), and 180 (down).
To control the flow of animation many times certain checks need to be done and depending on the
situation or scenario the change needs to be brought in the animation.
Checking certain condition and deciding the course of the script is called taking decisions. For
example, we can check the direction of the sprite and if it is not moving in the desired direction, we
can change it. Similarly, we can check for the size, position or costume of the sprite.
Executing any statement repeatedly is called reiteration or looping. Scratch provides two types of
loop.
repeat ___ - This block executes the given statements repeatedly as many times as the value set by the
user.
forever – This block executes the given statements repeatedly until the script is forcefully closed or
any stop block is encountered.
An event is any action occurring at any point of time before, after or during animation. For example,
user clicks on stage, a key is pressed on the key board, when green flag (play animation) button is
clicked etc.
Scratch lets us decide what to do when a particular event occurs. For example, if a sprite is moving
and user clicks anywhere on the stage, we can decide to stop the animation or let the sprite do
something.
The basic approach towards event handling is to identify the logical sequence of actions to be
performed when a particular event should occur and attaching the set of blocks of such actions with
the suitable event block.
For example,
41
Computer Applications CBSE Code 165
From Scripts tab >Events category add when this sprite clicked block to your script.
The above script will move the sprite 100 steps only when mouse is clicked on the sprite itself.
A variable is the storehouse for a value at a time. Variables in a script have unique names given by us.
If variable stores a new value then any value previously stored in it is lost forever hence it is called a
variable because during the course of the script its value may change.
Click on OK.
Variable will be seen created. A checkmark besides it will show the variable on the stage.
In the above script, it is assumes that the script is written for sprite named Mouse and the other sprite
is red ball. Mouse is moving towards the red ball. When Mouse comes so closer to the red ball that it
touches the ball (red colour), it will turn upwards and move 100 steps up.
Here, checking of touching the colour is done by if block. The condition touching color red will return
true only when Mouse touches the red ball.
Pen blocks are used to draw simple figures. pen down block sets the pen ready to draw and pen up
block unsets the pen to draw. Drawing is done by moving the sprite in different directions to get the
desired figure. Pen blocks also allow setting and changing the pen colour and size etc.
Pen Down — Turns the pen feature on inside a sprite; the sprite will pen on the screen wherever it
moves until the pen is turned off
Pen Up — Turns the pen feature off, stopping a sprite from penning
Set Pen Color to — Sets the color of the pen to a color chosen by the programmer
42
Computer Applications CBSE Code 165
Set Pen Color to — Sets the color of the pen to a color chosen by the programmer using a number
system
Change Pen Shade by — Changes the shade of the color by a chosen value
Set Pen Shade to — Sets the shade of the color to a chosen value
Change Pen Size by — Changes the size of the pen by a chosen number
Set Pen Size to — Sets the size of the pen to a chosen number
10. How will you terminate an infinite loop? Explain with an example.
Infinite loop is implemented by the help of Control block forever. Statements inside forever block are
executed infinitely so at certain point of time it needs to be terminated. To achieve this, we need to put
a stop block after checking some condition. For example, following forever block will terminate and
sprite will stop when the value of the variable M becomes 1000.
forever
move 100 steps
if M = 1000 then
stop all
D. Fill in the blanks:
1. animation 2. Sprites
3. Library 4. x
5. looks 6. event
7. down 8. repeatedly
1. c) interpreted
2. c) Interactive, script
3. a) Python shell
4. b) #
5. d) No output
43
Computer Applications CBSE Code 165
6. a) dynamically typed
7. a) string
8. b) floats
9. c) strings
10. b) +
It is an easy to learn, write and read hence most suitable for programming begiinners.
Programs written in Python can run on all modern platforms like Windows, Linux and Mac.
2. What is the basic difference between Interactive mode and Script mode?
In interactive mode user keys in one command at a time and in response to theat command Python
displays the output. The commands are issued at Python command prompt denoted by >>>. For
example, If you type: (1 + 7) * 2
Then, immediately the result 16 will be displayed. Then you issue next command, get its output and
so on. Interactive mode does not save your commands for later use.
In script mode, the python commands are saved in a logical order to get the desired output. This
logical set of instructions is called script. Once the script is saved, it can be executed anytime.
3. How will you accept the name of the user using raw_input()? Write complete script.
Numbers with decimal places are called floats or floating point numbers. They are also called real
numbers since they can store the precise numeric values. Floats store values up to 15 decimal places.
Arithmetic operations involve two parts – operands and operators. Operands are the values on which
arithmetic operation is performed and operators are the symbols that denote a particular operation. For
example, a=5+2 Here, 5 and 2 are operands and + sign is addition operator.
+ operator functions as addition operator with numeric values and as concatenation operator with
strings.
7. How will you convert integer into string and vice versa?
price = 366.54
44
Computer Applications CBSE Code 165
age = “65”
The fields of engineering, advanced science and advanced mathematics deal with complex numbers.
They are used in the scientific description of the phenomena and world around us. Complex numbers
have no relevance at this level here so we shall leave complex numbers out.
10. Why floats are called real numbers and not integers. Give example.
Numbers with decimal places are called floats or floating point numbers. They are also called real
numbers since they can store the precise numeric values. For example,
a = int(14.55) will return 14 only and a will be of number type because integer discards decimal
places.
Text or strings
In computer programming terminology, text is called string. Strings are always enclosed in double
quotes. When computer or Python interpreter encounters any value that is in double quotes, it treats it
as string. For example: "I am a Python fan", "My country India", "123", "920431143" etc. Did you
notice last two values? "123" is not One hundred twenty three. It is a string to be read as: one two
three. For computer it is not a number because of double quotes. Hence, "123" and 123 are different.
Numbers or Integers
Numbers are not enclosed in any quotes. So, 123 is one hundred twenty three. 17 is seventeen.
There are certain variants of number type like int, long and complex.
Int: These are plain positive or negative whole numbers like your age, your height, distance between
your house and your school etc.
45
Computer Applications CBSE Code 165
For example:
age = 12
height = 10
marks = 83
Integers occupy 4 bytes in the memory to represent the value. So, all the variables above are of 4
bytes size.
Long: Numbers with huge values like distance between the earth and the sun, long scientific numbers
are treated as long. Long integers occupy as much space in memory as the system on which the script
runs allows. To denote that a number should be treated as long, the values should be suffixed with
letter L.
Here, the variable distance_from_sun will be allocated more than 4 bytes by the system.
Complex: The fields of engineering, advanced science and advanced mathematics deal with complex
numbers. They are used in the scientific description of the phenomena and world around us. Complex
numbers have no relevance at this level here so we shall leave complex numbers out.
Boolean: A Boolean value is either true or false. Booleans are treated as integers by the computer.
False is denoted by 0 and True as 1.
Floats
Numbers with decimal places are called floats or floating point numbers. They are also called real
numbers since they can store the precise numeric values. Floats store values up to 15 decimal places
which is quite sufficient for majority of fields of computer programming.
The distance between the sun and earth is 149.6 million kilometers but in previous example of
integers, we could only store 149 which is approx. value. A floating point type variable can store
precise value:
distance_from_sun = 149.6
Numbers with scientific notations like exponents indicating power of 10 are also represented by
floating point numbers:
x = 7.8e3
Python was developed by Guido van Rossum, and it is free software in the early 1990s. Python is an
interpreted language with dynamically typed variables which means variables in Python do not have a
defined type like in C++ or Java. Python has a rich set of built-in collection types like Lists, Tuples,
Dictionaries and Sets etc. An interpreted language is translated and executed statement by statement
until the end of the program or until any error is encountered. It is not like a compiler based language
46
Computer Applications CBSE Code 165
where program gets compiled into executable code by removing any errors first and then the compiled
code is executed.
Features of Python
Python is open source programming language. You do not need to buy any license to use it.
Download it and start using it just for free.
It has features of both Object Oriented Programming languages like Java and C++ as well as
procedural languages like C.
It is an easy to learn, write and read hence most suitable for programming begiinners.
Programs written in Python can run on all modern platforms like Windows, Linux and Mac.
Python has a large, rich set of libraries to develop complex applications quickly and easily.
Programs written in Python can be integrated with C++ and Java with least modifications.
3. How will you create and run a Python script using IDLE and Script editor?
Start IDLE
Go to File menu and click on New File. This will open the editor.
In the editor, go to File menu and click on Save. Type in myscript1.py and save the file in desired
location.
To run your program, in the editor, go to Run menu and click Run Module or alternatively you can
press F5. This will run your file and the output will be displayed in shell.
4. What is a variable? How will you accept a value from the user into a variable?
A computer program written in any language takes some input, processes it and generates the output.
These values are stored in variables which are identified by unique names in the program. A variable
stores one value at time. When a new value is stored in a variable the earlier value gets overwritten.
As a program runs, the values in a variable might change hence the term variable – anything that may
store different values but one at a time.
price = float(price)
47
Computer Applications CBSE Code 165
Here, raw_input() asks the user to enter a price value. User enters 565.99. This is assigned to variable
price. float()converts string type returned by raw_input() into float. Using multiplication operator *
25% discount is calculated and assigned to variable discount. Then price after discount is calculated
using – operator. Finally, the output is displayed wherein non-string values are converted into strings
using str() and + operator is used for concatenation.
raw_input() returns the input from the user in the form of string. input() returns the input from the user
too but before returning it converts the value into suitable data type. So, if user enters a non-numeric
value, it will be returned as string but if any number is entered, input() will return it as integer.
Similarly, any fractional value like 2.75 will be returned by input() as float. input() takes an optional
parameter of string type which can be used to display a prompt for the user.
For example:
a = input("Enter a number:");
print(a * a) will display 25 if user enters 5. No data conversion is required, input() has returned the
value as number.
a = raw_input("Enter a number:");
print(int(a) * int(a)) will display 25 if user enters 5. Data conversion is required using int() since
raw_input() has returned the value as string.
During an arithmetic operation, if required, Python automatically does certain data conversion known
as implicit data type conversion. For example:
a = 2 * 3.5 This will result into a float value automatically taken care of by Python.
48
Computer Applications CBSE Code 165
price = 366.54
age = “65”
9. What is concatenation?
+ operator, besides being an addition operator on numeric values also serves as combining strings.
For example,
price = 345.99
str_price = str(price)
Here, str()is used to convert the float value 345.99 into string and then + operator is used to
concatenate the two string.
Python Comments
Comments are a way to document the script or put explanatory remarks to your script. Any line in
Python code that begins with # sign is treated as a comment by the Python interpreter and it is not
executed.
For example:
Here, first line is a comment and informs what the script is doing to anyone who refers to it but notice
the last line. Since it is also prefixed with # sign it will not be executed.
49
Computer Applications CBSE Code 165
Computer Applications
CBSE Code: 165
Class X
UNIT 1
Chapter - 1- Introduction to the Internet
EXERCISE 1
A. Choose the correct answer.
1. (b) HTTP 2. (d) 1990 3. (b) HTML pages 4. (c) World Wide Web
5. (a) Gateway 6. (b) Internet Service Provider 7. (d) All of these
8. (c) ISP 9. (b) Unique Address 10. (a) Web Browser
B. Short answers type questions.
1. Although the primary application of all the web browsers is the same, they differ from
each other in more than one aspect. The distinguishing areas are:
• Text web browsers: - They support only text contents. 'Lynx' is a browser of this
category.
• Graphical web browser: - They are more advanced than text browsers. They support
both text and graphical.
2. The full form of IETF is Internet Engineering Task Force.
3. Search engine is a program that searches the documents for specified keywords and return
a list of the documents where the keywords were found. For example, Google, Bing and
Yahoo! Search.
4. ARPANET was a large wide-area network created by the United States Defense in 1969.
Advanced Research Project Agency (ARPA). The goal of this project was to connect
computers at different universities and U.S. defense.
5. A website address is known as URL (Uniform Resource Locator) on internet. It is a
unique address of a website through which a user can access the web site over the internet
through World Wide Web.
6. Internet is known as International Network. It is a network of networks that is spread all
over the world. It is a global network of computer networks that connects different types
of computer networks to exchange the information.
7. Broadband is defined as a high bandwidth connection to the Internet. Broadband can
make using the Internet in the home much easier, faster and more efficient. Broadband
50
Computer Applications CBSE Code 165
can be provided over your phone line, via cable or via satellite. It involves large volumes
of information being carried at high speeds to your PC.
8. Short for Hyper Text Transfer Protocol, the underlying protocol used by the World Wide
Web. HTTP defines how messages are formatted and transmitted, and what actions Web
servers and browsers should take in response to various commands.
9. A web site is a collection of World Wide Web (WWW) files that includes a beginning file
called a home page. It is the combination of multiple web pages.
C. Long answer type questions.
1. A web browser is a software application designed to help you access information on
the World Wide Web. At its most basic, a browser will:
a. It allows you to enter the URL of the resource you wish to retrieve from the
internet.
b. Send a message to a server requesting that resource.
c. Accept the resource when the server returns it.
d. Translate the resource into a correctly laid out, viewable web page.
2. A Web server is a computer that deliver (serves up) Web pages. Every Web server has
an IP address and possibly a domain name. Any computer can be turned into a Web
server by installing server software and connecting the machine to the Internet. It's a
server used to communicate with Web Browsers as its clients and the communication
protocol used in this case is HTTP (Hyper Text Transfer Protocol).
3. You can use Internet in different ways:
i. E-mail: By using internet we can communicate in a fraction of seconds with a
person who is sitting in the other part of the world. Today for better
communication, we can avail the facilities of e-mail.
ii. Social Networking: Today social networking sites have become an important part
of the online community. A number of people use this facility to remain in touch
with their nears and dears.
iii. E-Commerce (Online Shopping): In today's busy life most of us are interested to
shop online. In countries like USA, most of consumers prefer to shop from home.
We have many shopping sites on internet like amazon.com, snapdeal.com,
ebay.com, flipcart.com, junglee.com, etc. Virtually anything can be bought or sold
on the internet.
iv. Entertainment: On internet we can find all forms of entertainment from watching
films to playing games online.
v. Information: Information can be taken on any topic on the internet. It can be
from any source worldwide that has a presence on the Internet. For example,
Agriculture Advisers, Colleges, Universities, Banks, Purchasers and Supply
companies.
vi. Business tools: Online management and business tools are very popular. For
example, online banking or currency converters.
vii. Discussion groups: It is used to exchange your views with others over the
Internet about your interests and views. Discussion groups are also very famous
now a days.
51
Computer Applications CBSE Code 165
viii. Other Services: Many services are provided on the internet such as online
banking, job seeking, purchasing tickets for your favorite movies, paying bills,
etc.
4. Electronic mail, e-mail or email is text messages that may contain files, images, or
other attachments sent through a network to a specified individual or group of
individuals. .It does the job of sending, receiving, storing as well as transferring files.
Its functionalities are like an ordinary postal service. It also has got some special
features such as you can store some of the emails, which is important, you can store
all your friends email contact with their address. Some of the email service providers
are Yahoo, Gmail, Rediffmail, Ymail, Hotmail.
5. The World Wide Web (WWW) is one set of protocol (software services) running on
the Internet. The World Wide Web is a subset of these interactions and supports
websites and URIs. World Wide Web can be termed as the software part – it is a
collection of web pages connected through hyperlinks and URLs. Whereas, the
Internet itself is a global, interconnected network of computing devices. This network
supports a wide variety of interactions and communications between its devices.
Internet is the hardware part - it is a collection of computer networks connected
through copper wires, fiber optic cables or wireless connections.
6. Dial-Up services use phone line and a modem. Your modem makes a phone call to
the internet service provider's modems to connect, so you cannot talk on the phone
while the internet is connected. Dial-up is one of the slowest types of service
available, however it is one of the most readily available because it was designed to
use basic services like the phone system that are already in place. Dial-up also
requires you to connect every time you want to use it.
Wireless services use radio signals from the ISPs tower to connect you to the internet.
The signal goes to an antenna on your roof or on the side of your building via shielded
cable to the radio. The radio is a small box that then connects to a computer or router.
Wireless technology is mostly used in mobile phones. NOTE: if you are using a
laptop or desktop that is wireless enabled, this is not the same type of wireless. This is
a totally different system called WiFi or 802.11abg, which you put in your home or
business to enable you to roam around your location and still have a connection.
7. Dial Up - It uses your phone line and a modem. Your modem makes a phone call to
the internet service provider's modems to connect, so you cannot talk on the phone
while the internet is connected. Dial-up is one of the slowest types of service
available, however it is one of the most readily available because it was designed to
use basic services like the phone system that are already in place. Dial-up also
requires you to connect every time you want to use it.
Broadband - Broadband refers to a connection that has capacity to transmit large
amount of data at high speed. Presently a connection having download speeds of
256kbps or more is classified as broadband. With a broadband connection, phone line
can still be used while using the Internet and both the phone and the Internet work
simultaneously and no dialup costs are incurred.
8. Internet was first developed in USA and used by the Department of Defense. This
network was known as ARPANET which was established in 1969. This was regarded
to be the first step towards the creation of the Internet. Internet, however, came to be
used more widely in the 1990's and ARPANET was shutdown in 1990's. In 1991, the
first friendly interface of the Internet was developed at the University of Minnesota.
52
Computer Applications CBSE Code 165
EXERCISE 2
A. Fill in the blanks –
1. World Wide Web 2. Graphical 3. Web Browser 4. ISP 6. W3C
7. 1990s 8. E-mail 9. Internet Service Provider
10. World Wide Web Consortium
B. State true or false
1. False 2. False 3. False 4. False 5. False
6. True 7. False 8. True 9. True 10. False
53
Computer Applications CBSE Code 165
• An e-mail is very fast. It is received and delivered within the seconds from
anywhere in the world.
• Sending and receiving an e-mail is very easy, low cost and convenient. Many
types of files such as text files, audio, videos and images can be sent as an
attachment through an e-mail.
4. A search engine work with the help of three elements:
• A software called spider or hot
• Database
• Search Algorithm
54
Computer Applications CBSE Code 165
comfort of their homes and shop as they sit in front of the computer. A number of
online shopping (e-shopping) sites are running on internet. For example,
Snapdeal.com, Amazon.com, Flipcart.com, etc.
2. Steps to check e-mail in our mailbox are,
(i) Open the browser and then e-mail service provider.
(ii) Sign-in into e-mail account. The e-mail account interface appears.
(iii)Click on the either name of the mail sender or subject of the mail.
The mail appears in the interface window.
3. E-Learning is electronic learning, in which the learner uses a computer to learn a task,
skill, or process. It is also referred to as computer-based training, web-based training,
and online learning. E-Learning can be even more effective than traditional,
classroom learning. Advantages of e-learning are :-
• Class work can be scheduled around work and family.
• Reduces travel time and travel costs for off-campus students.
• Students may have the option to select learning materials that meets their level of
knowledge and interest.
• Students can study anywhere if they have access to a computer and Internet
connection.
• Self-paced learning modules allow students to work at their own pace.
4. Social networking means conglomeration of people forming small groups or
communities. Social networking sites provide platform for staying in touch with their
dear ones.
A social networking service is an online service, platform, or site that focuses on
facilitating the building of social networks or social relations among people who, for
example, share interests, activities, backgrounds, or real-life connections. A social
network service consists of a representation of each user (often a profile), his/her
social links, and a variety of additional services. For example, Facebook and Twitter
are two social networking sites.
5. Five uses of Internet are:-
i. Blog - A blog is an online personal journal or diary. It is a place to share your
thoughts and your passions. It displays the freshest information at the top.
ii. E-banking – We can operate our bank accounts on internet without going to the
banks. A number of banks provide their online banking (e-banking) solutions.
iii. E-shopping - It is a form of electronic shopping through which a user can buy
goods and services from merchants over the Internet. Shoppers can visit web
stores from the comfort of their homes and shop as they sit in front of the
computer.
iv. E-Learning is electronic learning, in which the learner uses a computer to learn a
task, skill, or process. It is also referred to as computer-based training, web-based
training, and online learning. E-Learning can be even more effective than
traditional, classroom learning.
55
Computer Applications CBSE Code 165
56
Computer Applications CBSE Code 165
UNIT 2
Chapter – 3 - Introduction to HTML
EXERCISE 1
A. Choose the correct answer
1. (a) Web Pages 2. (c) Assembler 3. (d) None of these 4. (b) Two
5. (d) All of these
B. Answer the following questions
1. HTML stands for Hyper Text Markup Language. It is a language that is used to design
web pages by using some pre-defined tags. It is the extended version of SGML. HTML
tells the browser how to display the various contents like text, images, graphs, audio file
and video file on a web page.
2. To design a HTML document a user requires three things –
Text Editor - Text editor is a tool that provides a user to write a code in some specific
markup language to design a web page. Different types of text editor are Notepad,
Notepad++.
Protocol (FTP client) - It is a protocol available in major operating systems.
Web Browser - It is an application program that displays the output of an HTML
program.
3. Empty tag - In HTML, tags that have only opening tag are called empty tag. There is no
closing tag. These tags do not act on blocks of text.
Example :<HR>,<BR>,<IMG>,<LI>
4. Container Tag - In HTML, tags that include both an ON and an OFF tag are called
container tag. They hold or contain the text between the two tags (opening and closing).
<Tag>text being formatted or defined</Tag>
Example :<HTML>, <HEAD>, <BODY>, <CENTER>
5. Tag - A tag is a predefined syntax in a markup language. It is a basic building block of a
program. Each tag can also have content, including other tags and text. HTML tags
represent semantics, or meaning. For example, the title element represents the title of the
document. A tag name appears between the opening and closing < > brackets. For
example <HTML>
Attribute - Attribute is a property value that customizes or modifies an HTML element
or tag. For example - <BODY bgcolor=”#0000f0”>. Here ‘bgcolor’ is an attribute of
<BODY> tag.
6. The <body> tag defines the document's body. The <body> element contains all the
contents of an HTML document, such as text, hyperlinks, images, tables, lists, etc.
Example - <html>
<body>
57
Computer Applications CBSE Code 165
Document's content.
</body>
</html>
<body> tag has various attribute to customizes or modify the web page. These attributes
allow you to control the overall appearance of the document by specifying a background
color or background image (BGCOLOR, BACKGROUND), and the color of text, links,
visited and activated links (TEXT, LINK, VLINK, ALINK).
7. The <center> tag is used to display the content of a web page on the center of the page. It
is a container element. The content will appear between the opening and closing tag.
<center> The text to be displayed will appear here. </center>
EXERCISE 2
A. Fill in the blanks.
1. Hyper Text Markup Language 2. Tags 3. Editor 4. Additional
5. <BODY> 6. .html or .htm 7. Web page 8. Note: correct sentence
is --- The <title> tag is used to set the title of the web page. 9. <BR>
B. Match the following.
Column A Column B
1. Heading tag - d) <H1>
2. Center object - a) <CENTER>
3. Blank Line - b) <BR>
4. Web page body - e) <BODY>
5. Title of web page - c) <HEAD> Note: Correct ans. is <Title>
C. State true false.
1. True 2. True 3. False 4. False 5. False
58
Computer Applications CBSE Code 165
Right – This alignment is used to set the position of text to the right hand side of the
page.
Left – This alignment is used to set the position of text in the center of the page.
Justify – This alignment is used to set the position of text between both (left and right)
the margins.
Bold Tag <b> …..</b>- The text appears between the <b>……..</b> element will be bold and stand
out against text around it. It is a container element.
Italic Tag <i> …….</i>- The text appears between the <i>………….</i> element is displayed in italicized.
It is a container element.
59
Computer Applications CBSE Code 165
• Name - A name attribute of anchor tag is used to define a named anchor. This named
anchor is invisible to reader.
3. Internal Linking - An internal hyperlink is one that takes us to a new location within the
current open web page. Before we can establish an internal hyperlink first we must create
either a 'bookmark'. A bookmark defines the place within the text where we want to go.
We do so by using the <A></A> anchor tags along with the NAME attribute. For
example the header for this section is defined as a bookmark with the following HTML
code: <a name="Internal Hyperlinks">Internal Hyperlinks</a>.
60
Computer Applications CBSE Code 165
External Linking - An external hyperlink is used to link the one document with another
document. In this case the href attribute of <a> tag will include the full address of the
remote resource using the URL. Example - <A href=”url”> Name of Hyperlink </A>.
4. Different types of lists in HTML are –
Ordered List - This list is also known as Numbered list (which uses an ordering system
e.g., numbers, letters, etc.). Ordered lists are created using the <ol> tag (to define the list).
Unordered List - An unordered list is an unnumbered list. Unordered lists simply have a
plain bullet point for each item in the list. Unordered lists are created using the <ul> tag.
Definition List - Definition lists are similar to other lists but in a definition list, each list
item contains two or more entries; a definition term (<dt>) and at least one definition
description (<dd>). Definition lists are created using the <dl> tag.
5. Marquee Tag - Marquee tag is used to set a scrolling (vertically or horizontally) text or
image. Using <marquee> tag we can set text/images scroll from right to left, left to right,
top to bottom, or bottom to top. Attributes of <marquee> tag
• Direction -This attribute is used to set the direction of scroll. We can set direction as
left, right, up and down.
• Bgcolor- This attribute is used to change the background colour of marquee.
6. A table in HTML is used to display the data in the tabular format. It is made up of rows &
columns. The HTML table model allows authors to arrange data -- text, preformatted text,
images, links, forms, form fields, other tables, etc. -- into rows and columns. Each table
may have an associated caption that provides a short description of the table's purpose.
7. The five child elements of <TABLE> tag are –
<CAPTION> - This tag is used to define the title of a table.
<TR> - This tag is used to create a new row.
<THEAD> - This tag is used to define the header of a table.
<TBODY> - This tag is used to define the body of a table.
<TFOOT> - This tag is used to define the footer part of a table.
8. The five attributes of HTML table are:
• Border - This attribute places a border around the table and frames on each cell.
• Bordercolor - This attribute will change the colour of the border.
• Bgcolor - This attribute is used to change the background colour of a table.
• Background - This attribute will set a picture as the background of a table.
• Align - This attribute will set the position of the table on web page. It can have the
value left, right or center.
9. Table head <thead> is used to create a horizontal header over the complete width of a
table. The <thead> element is used in conjunction with the <tbody> and <tfoot> elements
to specify each part of a table (header, body, footer). Browsers can use this element to
enable scrolling of the table body independently of the header. Also, when printing a
large table that spans multiple pages, this element can enable the table header to be
printed at the top of each page.
61
Computer Applications CBSE Code 165
10. Rowspan & Colspan attributes- Table cells can span or merge across more than one
column or row. Use rowspan attribute if you want to merge two or more rows. In Similar
way, use colspan attribute if you want to merge two or more columns into a single
column. Both the attributes takes number as a value for the number of columns and
number of rows to be merged. Example – <td rowspan=“2”> cell data </td>
<td colspan=“2”> cell data </td>
EXERCISE 2
A. Fill in the blanks.
1. <img> 2. <a> 3. Internal, external 4. Target 5. Definition 6. Nested
7. Motion 8. Scroll 9. Alternate 10. Rows, columns 11. <table>
12. <table> 13. Bold 14. Rowspan
B. State true and false.
1. True 2. False 3. False 4. True 5. False 6. True
7. True 8. True 9. False
C. Write the full form of the following.
a. Image b. Source c. Hyper Text Reference d. Unordered List e. List
f. Ordered List g. Definition List h. Definition Description i. Definition Term
j. Alternate
Inline styles are defined within the opening tag of the desired element. This method is useful
if very little changes need to be done to a particular element which is specific to that
particular web page.
4. What do we need to do to make browsers of older versions ignore CSS?
To make older browsers ignore CSS, use comment notations <!-- and --> around your CSS
definition.
When an old browser displays the web page, due to these comment notations, it ignores the
CSS definition while any modern browser will skip comment notations and process the style
rules.
For example,
<style>
<!--
P {color:green; font-face:arial; font-size:10pt}
-->
</style>
5. What are the properties of a web page which we can stylise using style sheets?
Font and text, borders, background, margins and padding.
6. What is the basic difference between background-color and background-image?
Background colour is applied by using property background-color and it is applied as a solid
colour behind the content while background image is applied using property background-
image. It displays the given image in the background of the content. If both the properties are
used then background-image is given the priority.
7. Write the syntax of LINK element.
<LINK TYPE=“type of css file” REL=“stylesheet” HREF=“url of stylesheet”>
Example: <LINK TYPE=“text/css” REL=“stylesheet” HREF=“mystyle.css”>
8. What do you mean by a selector and a class?
A selector is the name of any element that is mentioned while specifying CSS rule in the
stylesheet while class is applied to a group of elements that should share same style.
9. Write an example of universal selector.
*{color: blue; font-family: arial; font-size:10pt; word-spacing:5; text-align:right}
10. List the precedence of 3 types of stylesheets giving an example.
Style1.css
P{color:red}
H1{color:green}
H4{color:gray}
HTML Code:
<html>
<head>
<LINK TYPE=“text/css” REL=“stylesheet” HREF=“style1.css”>
<style>
P{color:green}
63
Computer Applications CBSE Code 165
H1{color:red}
</style>
<body>
<H1>Welcome</H1>
<P style="color:blue">This web site is dedicated to….</P>
<H4> Contact us at….</H4>
</body>
</html>
Here, colour of the text on P element will be blue since priority of inline stylesheet is highest.
The content in H1 will be displayed ib red colour because second priority is given to Internal
style sheet. Contents of H4 will be displayed in gray colour.
C. Long answer types questions.
1. Discuss the advantages and limitations of CSS.
Advantages of CSS
1. Time and effort in designing the web pages is saved significantly since styles are defined
once in style sheet.
2. Web pages get a consistent look throughout the website. For example, if a web site is
following a theme called “Ocean” then shades of gray, blue and green can be defined in
various styles of paragraphs, headings and backgrounds etc. once in style sheet and it would
be cascaded on all the pages.
3. Since HTML coding is minimised, web pages load comparatively faster.
4. Errors are minimised in updating the designes of the web pages.
Limitations of CSS
CSS has a few limitations like it is interpreted by different browsers differently hence a web
page design may be rendered a little different in one browser than in the other. Another
limitation is that CSS stylesheets are simple text files which can be easily modified by
anyone who has access to them. This may pose a serious problem since CSS files contain
hyperlink addresses and paths to different image files used in the web page designs.
2. How will you apply your school’s image in the background of a web page? Image
should not be repeated and should not be scrollable.
body {
background-image: url(“school-logo.jpg”);
background-repeat: none;
background-attachment: fixed
}
3. A web site has 100 pages. Each page contains several elements and all 100 pages
should look consistently similar in design and layout. What solution do you suggest to
do so and why?
The best solution to provide consistently similar design and layout to all the web pages is to
use external stylesheets. The reason is that external style sheets are separate files from the
web page files and can be easily maintained. If any time, any change in design needs to be
done to all the pages, only concerned stylesheet needs to be changed once and changes will
64
Computer Applications CBSE Code 165
reflect immediately to all the web pages. This is better than changing each web page
individually.
4. Explain the advantage of using class as selectors.
Using class as selector, we can apply a style to multiple elements. This is useful when certain
parts of a webpage have similar kind of design and layout. We do not need to locate the
elements by their name. Instead we can give them a class name using class attribute and use
that class name as selector in the style defined for them in one place. Advantage is that, if we
need to apply any other style to all those elements in future, we can change their classname
only and make them refer to a different class of style definition.
5. Consider the CSS and HTML code below and explain the output of the web page.
Support your answer with suitable explanation:
The CSS File (mystyle.css)
H1{
color:red; font-family:arial
}
The HTML page using mystyle.css
<HTML>
<HEAD>
<LINK TYPE=“text/css” REL=“stylesheet” HREF=“mystyle.css”>
<STYLE>
H1{
color:green;
font-family:Verdana
}
</STYLE>
</HEAD>
<BODY>
<H1 style=“color:blue; font-family: Garamond”>
Learning CSS
</H1><br>
<H3>Introduction</H3>
</BODY> </HTML>
6. Briefly explain any two CSS properties of font, text, border and background.
<style>
H1{
font-family:serif;
font-size:xx-large;
letter-spacing:3;
text-align:right;
border-width:5px;
border-style:double;
65
Computer Applications CBSE Code 165
background-image:url(“edusoftlogo.png”)
background-repeat:repeat-x
}
7. What are span and div element used for. What is the basic difference between them?
HTML provides two elements which do not change the formatting and appearance of web
page contents but they can be used to organise web page content into smaller blocks which
are easy to organise and manage. These elements are span and div.
Using span and div we can divide web content into separate blocks or pieces of text.
span is groups content inline that means there is no line break between two adjacent span
blocks while div displays the content block fro <HTML>
<head>
<title> Window title </title>
</head>
<body>
<SPAN style=“background-color:yellow”> This is span block 1. </SPAN>
<SPAN style=“background-color:lime”> This is span block 2. </SPAN>
<DIV style=“background-color:lightgreen”> This is div block 1. </DIV>
<DIV style=“background-color:lightblue”> This is div block 2. </DIV>
</body>
</HTML>m new line.
8. How do external style sheets help us provide consistent look to the web site?
Refer to question 3 - The best solution to provide consistently similar design and layout to all
the web pages is to use external stylesheets. The reason is that external style sheets are
separate files from the web page files and can be easily maintained. If any time, any change
in design needs to be done to all the pages, only concerned stylesheet needs to be changed
once and changes will reflect immediately to all the web pages. This is better than changing
each web page individually.
66
Computer Applications CBSE Code 165
UNIT 3
Chapter – 7 – Cyber-ethics
A. Choose the correct answer
1. (a) Ethics 2. (b) Cyber-ethics 3. (d) Privacy
4. (c) Privacy policy 5. (a) HTTP with Security 6. (d) All of these (they are Digital
property) 7. (c) Plagiarism 8. (d) Open source
9. (a) GNU is not Unix 10. (c) Free software
B. Short answer type questions
1. Explain the terms ethics, cyber-ethics and privacy.
Ethics informs us about the right and wrong aspects of anything - our beliefs, religion, society,
profession and our values. Cyber-ethics refers to the fundamental rules and values, which
govern us to make the right and judicious use of cyber space. Limiting or preventing access to
anyone's personal, financial and other transactional details by unauthorised agency is called
privacy.
2. What is the role of privacy in E-Commerce?
Limiting or preventing access to anyone's personal, financial and other transactional details by
unauthorised agency is prime focus of maintaining privacy. Another aspect is individual's right
to be protected from undesired attention (like unwanted mails, notifications and phone calls).
This is called right to anonymity. Exchange of information between buyer and seller occurs in
different ways such as while registering for the service or on web site and while buying a
product or service. It is the responsibility of the buyers that they provide required information
correctly and businesses are responsible to keep these details secured to respect the privacy of
the individual. Businesses should have suitable policies and security processes in place to
ensure privacy practically. Buyuer's should also be allowed to exercise their choice whether
they need their details to be shared wholly or partly with other parties.
3. How privacy should be safeguarded?
Websites should ensure putting up suitable industry standard measures to protect user data.
Some of such standard measures are listed below:
• Strong security measure through technology such as data encryption through Secured
Socket Layer with HTTP (https), firewalls and antiviruses on the servers, regular
updates in security measures, data backups and training of their staff as required etc.
• Constant monitoring process to identify and counter any possible threats.
• Educating and notifying users in safe transaction practices.
• Industry standard compliance certifications for financial transactions. For example,
SSL certifications, Payment Card Industry Data Security Standard (PCI DSS) for
electronic card-based transactions.
4. What is a privacy policy?
Privacy policy of a business mentions how the details provided by the buyers will be kept
secured to respect the privacy of the individual. Policy should also mention terms and
conditions of services provided, type of information to be collected from the customer, purpose
of information collection and what security practices are being followed by the business to
keep the information secured.
67
Computer Applications CBSE Code 165
68
Computer Applications CBSE Code 165
69
Computer Applications CBSE Code 165
70
Computer Applications CBSE Code 165
• We should ensure not to purchase pirated content, insist on buying original software
and avoid distributing unintentionally among friends and relatives.
• Governments should take initiatives like stringent laws and their enforcement to protect
intellectual property of all kinds and spread awareness though social messages about its
ill effects and consequences.
• A community drive and urging large student community to promote anti-piracy
measures.
• Promoting reward campaigns for those who report piracy.
• Software audits in companies.
6. Describe the terms that should be satisfied in order for a software to be called open
source.
Open source software should satisfy following distribution terms as per the open source
definition version 1.9 on opensource.org.
• Free redistribution: The license shall not require a royalty or other fee in redistribution
of software.
• Source code: Source code must be distributed along with the compiled code.
• Derived works: Modifications in code are allowed along with derived works and
software must be distributed under the original license terms.
• Integrity of the Author's source code: Every alteration should bear the different name or
version number form the original software.
• No discrimination against persons or groups: Program or software can be used by
anyone irrespective of any field of endeavour.
• Distribution of license: Rights attached to the program must apply to all to whom it is
redistributed.
• License must not restrict other software: License must not place any restrictions to
other software that is distributed along with.
• License must be technology neutral: No provision of the license may be predicated on
any individual technology or style of interface.
7. Briefly describe various open source licences.
Open source licenses help collaborative developers and contributors to come together easily
without worrying about permissions and rights. It ensures that others do not plagiarise or pirate
your work. Some common openlicences are:
• GNU General Purpose Licence: It is the most common of all the open source licences.
It allows copy, modify and distribute the software legally. A GPL has following
provisions:
• No limit to copies of software.
• Freedom from the method of distribution. Users or developers can distribute software
by any means or mode they like.
• Modified software can be charged but software remains under GNU GPL.
• Freedom of complete modification of the source code but new release should be under
GNU GPL.
• GNU Lesser General Purpose Licence: This is also known as library GPL because the
restriction of having to release software extensions in Open GPL are not there in LGPL.
• Berkeley Software Distribution License: They are mostly used for the distribution of
many freeware and shareware as well as open source software. BSD license is in fact a
family of permissive free software licenses with fewer restrictions on distribution. The
3 clause BSD license allows unlimited redistribution as long as it copyright notices and
71
Computer Applications CBSE Code 165
warranty disclaimers are retained. Also, names of contributors cannot be used to endorse the
derived work without their permission. Simplified or Free BSD license is like 3 clause BSD
without having restriction of usage of names of contributors for endorsement.
• Massachusetts Institute Technology License: It is just like BSD license with a difference that
BSD-style licenses sometimes contain a clause prohibiting the use of copyright holder’s name
in promotions without permission while MIT license does not contain such clause. As per MIT
license, material redistributed should have the original license.
• Apache License: The Apache License is a FOSS licensing agreement from the Apache
Software Foundation. This license allows perpetual i.e. forever active, worldwide, absolutely
free, non-exclusive or non-proprietary and irrevocable rights. It has following provisions:
o Software may be freely used, reproduced, modified, distributed or sold.
o Software can be combined with other products and distributed or sold as packages.
o Products derived or modified from licensed software can be distributed under other
licenses.
o Apache software cannot be redistributed without attribution.
o A copy of the license must be redistributed along with any Apache software.
o External contributions to the software are released under the ASF terms unless
explicitly specified otherwise.
8. Write a note on digital India.
Access to information in public domain refers to the right to information. Internet, despite its
wider reach, is still needs means of its access in many remote areas of the country. The
inequality at economical and social level in accessing and using information and
communication technologies.
Many rural and remote areas still need to have suitable means to access information over
internet and telecom network. With a little more than 500 million users still a lot needs to be
done. Access to internet in urban areas is more than 50% than that in rural areas. The lack of
infrastructure, availability of bandwidth and digital literacy are being addressed by the
government at a rapid pace now. To ensure that government services and government
schemes' information reaches to masses online easily, government of India (GoI) launched
Digital India campaign in July 2015. Connecting rural areas over high speed internet
connection to bring the remote areas of the country into mainstream and improve digital
literacy is the ambitious objective of the campaign. Under this campaign the National
eGovernance Plan is aimed at brining various digitised service to the masses. Some of the
common services are digilocker, e-education, e-health, e-Education, e-Sign and e-Shopping.
Other platforms which are the part of this campaign are as follows:
• Access to mygov.in portal that lists details of all the government services and schemes.
• Multi channel, multi-lingual, multi-service mobile app Unified Mobile Application for
New Age Governance (UMANG) to access all government services over handheld
devices.
• Adhaar number has enable to access digital signature service eSign.
• People can keep digital copies of their important documents over DigiLocker.
• eHostpital application to enquire about various services like blood donation,
appointments, payments etc.
• Swachh Bharat Mission app tp promote cleanliness as a nationwide mission.
• eSampark application to promote communication in regional language.
• Pradhanmantri Digital Saksharta Abhiyan to make rural households digitally literate.
72
Computer Applications CBSE Code 165
UNIT 4
Chapter – 8 – Scratch Programming - II
A. Choose the correct answer.
1. (a) Event 2. (c) Both are loops 3. (d) Looks 4. (d) 0,0
5. (b) pen down 6. (b) say for n secs 7. (c) answer 8. (a) if
9. (b) Sprite 10. (d) Tempo
B. Short answer type questions.
1. What is Scratch? List main parts of Scratch interface.
Scratch is a free visual programming language developed by Media Lab of Massachusetts
Institute of Technology, Cambridge, Massachusetts. The purpose of developing Scratch
was to provide a fun oriented, easy and block-based visual tool for kids to learn computer
programming approach.
Using Scratch, children can create interactive stories, fun oriented 2D animations and
interactive games. Scratch creations can be shared online also with others.
2. List any 5 Event and Motion blocks.
Event blocks: When the sprite clicked, when I receive, broadcast, when animation flag
clicked, when key pressed
Motion blocks: move n steps, turn n degrees, point in direction, go to x y, set x to
3. Briefly describe Motion block point in direction __ .
Point in direction block is used to change the direction of the sprite for next movement.
With this block we need to specify the direction as 90 – for right, -90 for left, 0 – for up
and 180- for down.
4. What is the basic difference between say ____ and say ___ for __ secs blocks.
Say block displays the given text forever while say for secs block will display the given
text for the duration in specified seconds.
5.What is the difference between Motion blocks Move and Glide?
Move block moves the sprite by the given number of steps at constant fixed speed while
glide block moves the sprite in given duration in seconds to specified x, y coordinates.
6. Write the steps to bring the sprite to the center of the stage on the click of
spacebar and make the pen ready to draw.
When space key pressed When space key pressed
Set x to 0 OR glide 1 secs to x: 0 y: 0
Set y to 0 pen down
Pen down
7. List the steps to create a variable by the name AGE.
Go to Data category on Scripts tab. Click on “Make a Variable” button. In the dialog box,
type the name of the variable as AGE and click on OK.
73
Computer Applications CBSE Code 165
74
Computer Applications CBSE Code 165
75
Computer Applications CBSE Code 165
6. If forever block runs infinitely then how can it be stopped. Explain with an
example.
Forever block can be terminated or stopped by making check with if block and using stop
block within if. For example:
Forever
Move 100 steps
Turn 90 degrees
If touching color red
Stop all
7. What is an event? How do sprites respond to each others' messages? Explain
with an example.
An event is any action performed by user or program. For example, user clicking with
mouse on the sprite, pressing a key on the keyboard, an sprite broadcasting message to
other sprites etc. Scratch provides a set of event blocks to handle such events. They are
found in Events category in Scripts tab.
For example:
Sprite 1: Sprite 2
When this sprite clicked when I receive “ouch”
Broadcast “ouch” say “hey, what happened?”
8. How repeat block is different from repeat until block? Give example.
repeat block executes the enclosed blocks as many times as the number mentioned in its
value section while repeat until block takes a condition and executes enclosed blocks as
long as that condition becomes true.
For example, in the given script, Click on the sprite. It will
first go to coordinates 0,0 then it will glide up to coordinates 0,
25 taking 1 second and glide back down to coordinates 0,-25.
This will be repeated 5 times. Why? The repeat block will
execute both the glide blocks 5 times as you have specified.
repeat until block is useful when you need to execute certain blocks repeatedly for a given
count. repeat until block can be used when you need to control the animation on the basis
of a condition such as until sprite touches another sprite, until player’s life in a game
becomes 0, until user clicks a particular key.
For example, here, a variable counter is taken which is set to
0. This counter will be increased by 1 every time sprite Cat
finishes one jump (up and down using glide blocks). When
the value of counter becomes 5 (i.e. 5 jumps are done) the
condition counter=5 will be true and repeat until loop will be
over.
Notice, how the value of counter is increased by stating:
counter = counter + 1 using Operators block __ + __.
76
Computer Applications CBSE Code 165
1. c) interpreted
2. c) Interactive, script
3. a) Python shell
4. b) #
5. d) No output
6. a) dynamically typed
7. a) string
8. b) floats
9. c) strings
10. b) +
It is an easy to learn, write and read hence most suitable for programming begiinners.
Programs written in Python can run on all modern platforms like Windows, Linux and Mac.
2. What is the basic difference between Interactive mode and Script mode?
In interactive mode user keys in one command at a time and in response to theat command Python
displays the output. The commands are issued at Python command prompt denoted by >>>. For
example, If you type: (1 + 7) * 2
Then, immediately the result 16 will be displayed. Then you issue next command, get its output and
so on. Interactive mode does not save your commands for later use.
In script mode, the python commands are saved in a logical order to get the desired output. This
logical set of instructions is called script. Once the script is saved, it can be executed anytime.
3. How will you accept the name of the user using raw_input()? Write complete script.
Numbers with decimal places are called floats or floating point numbers. They are also called real
numbers since they can store the precise numeric values. Floats store values up to 15 decimal places.
77
Computer Applications CBSE Code 165
Arithmetic operations involve two parts – operands and operators. Operands are the values on which
arithmetic operation is performed and operators are the symbols that denote a particular operation. For
example, a=5+2 Here, 5 and 2 are operands and + sign is addition operator.
+ operator functions as addition operator with numeric values and as concatenation operator with
strings.
7. How will you convert integer into string and vice versa?
price = 366.54
age = “65”
The fields of engineering, advanced science and advanced mathematics deal with complex numbers.
They are used in the scientific description of the phenomena and world around us. Complex numbers
have no relevance at this level here so we shall leave complex numbers out.
10. Why floats are called real numbers and not integers. Give example.
Numbers with decimal places are called floats or floating point numbers. They are also called real
numbers since they can store the precise numeric values. For example,
a = int(14.55) will return 14 only and a will be of number type because integer discards decimal
places.
78
Computer Applications CBSE Code 165
Text or strings
In computer programming terminology, text is called string. Strings are always enclosed in double
quotes. When computer or Python interpreter encounters any value that is in double quotes, it treats it
as string. For example: "I am a Python fan", "My country India", "123", "920431143" etc. Did you
notice last two values? "123" is not One hundred twenty three. It is a string to be read as: one two
three. For computer it is not a number because of double quotes. Hence, "123" and 123 are different.
Numbers or Integers
Numbers are not enclosed in any quotes. So, 123 is one hundred twenty three. 17 is seventeen.
There are certain variants of number type like int, long and complex.
Int: These are plain positive or negative whole numbers like your age, your height, distance between
your house and your school etc.
For example:
age = 12
height = 10
marks = 83
Integers occupy 4 bytes in the memory to represent the value. So, all the variables above are of 4
bytes size.
Long: Numbers with huge values like distance between the earth and the sun, long scientific numbers
are treated as long. Long integers occupy as much space in memory as the system on which the script
runs allows. To denote that a number should be treated as long, the values should be suffixed with
letter L.
Here, the variable distance_from_sun will be allocated more than 4 bytes by the system.
Complex: The fields of engineering, advanced science and advanced mathematics deal with complex
numbers. They are used in the scientific description of the phenomena and world around us. Complex
numbers have no relevance at this level here so we shall leave complex numbers out.
Boolean: A Boolean value is either true or false. Booleans are treated as integers by the computer.
False is denoted by 0 and True as 1.
Floats
Numbers with decimal places are called floats or floating point numbers. They are also called real
numbers since they can store the precise numeric values. Floats store values up to 15 decimal places
which is quite sufficient for majority of fields of computer programming.
79
Computer Applications CBSE Code 165
The distance between the sun and earth is 149.6 million kilometers but in previous example of
integers, we could only store 149 which is approx. value. A floating point type variable can store
precise value:
distance_from_sun = 149.6
Numbers with scientific notations like exponents indicating power of 10 are also represented by
floating point numbers:
x = 7.8e3
Python was developed by Guido van Rossum, and it is free software in the early 1990s. Python is an
interpreted language with dynamically typed variables which means variables in Python do not have a
defined type like in C++ or Java. Python has a rich set of built-in collection types like Lists, Tuples,
Dictionaries and Sets etc. An interpreted language is translated and executed statement by statement
until the end of the program or until any error is encountered. It is not like a compiler based language
where program gets compiled into executable code by removing any errors first and then the compiled
code is executed.
Features of Python
Python is open source programming language. You do not need to buy any license to use it.
Download it and start using it just for free.
It has features of both Object Oriented Programming languages like Java and C++ as well as
procedural languages like C.
It is an easy to learn, write and read hence most suitable for programming begiinners.
Programs written in Python can run on all modern platforms like Windows, Linux and Mac.
Python has a large, rich set of libraries to develop complex applications quickly and easily.
Programs written in Python can be integrated with C++ and Java with least modifications.
3. How will you create and run a Python script using IDLE and Script editor?
Start IDLE
Go to File menu and click on New File. This will open the editor.
In the editor, go to File menu and click on Save. Type in myscript1.py and save the file in desired
location.
To run your program, in the editor, go to Run menu and click Run Module or alternatively you can
press F5. This will run your file and the output will be displayed in shell.
80
Computer Applications CBSE Code 165
4. What is a variable? How will you accept a value from the user into a variable?
A computer program written in any language takes some input, processes it and generates the output.
These values are stored in variables which are identified by unique names in the program. A variable
stores one value at time. When a new value is stored in a variable the earlier value gets overwritten.
As a program runs, the values in a variable might change hence the term variable – anything that may
store different values but one at a time.
price = float(price)
Here, raw_input() asks the user to enter a price value. User enters 565.99. This is assigned to variable
price. float()converts string type returned by raw_input() into float. Using multiplication operator *
25% discount is calculated and assigned to variable discount. Then price after discount is calculated
using – operator. Finally, the output is displayed wherein non-string values are converted into strings
using str() and + operator is used for concatenation.
raw_input() returns the input from the user in the form of string. input() returns the input from the user
too but before returning it converts the value into suitable data type. So, if user enters a non-numeric
value, it will be returned as string but if any number is entered, input() will return it as integer.
Similarly, any fractional value like 2.75 will be returned by input() as float. input() takes an optional
parameter of string type which can be used to display a prompt for the user.
For example:
a = input("Enter a number:");
print(a * a) will display 25 if user enters 5. No data conversion is required, input() has returned the
value as number.
a = raw_input("Enter a number:");
print(int(a) * int(a)) will display 25 if user enters 5. Data conversion is required using int() since
raw_input() has returned the value as string.
81
Computer Applications CBSE Code 165
During an arithmetic operation, if required, Python automatically does certain data conversion known
as implicit data type conversion.
For example:
a = 2 * 3.5 This will result into a float value automatically taken care of by Python.
price = 366.54
age = “65”
9. What is concatenation?
+ operator, besides being an addition operator on numeric values also serves as combining strings.
For example,
price = 345.99
str_price = str(price)
82
Computer Applications CBSE Code 165
Here, str()is used to convert the float value 345.99 into string and then + operator is used to
concatenate the two string.
Python Comments
Comments are a way to document the script or put explanatory remarks to your script. Any line in
Python code that begins with # sign is treated as a comment by the Python interpreter and it is not
executed.
For example:
Here, first line is a comment and informs what the script is doing to anyone who refers to it but notice
the last line. Since it is also prefixed with # sign it will not be executed.
83
Computer Applications CBSE Code 165
84
Computer Applications CBSE Code 165
85
Computer Applications CBSE Code 165
86