You are on page 1of 105
“ar Click start 7 if f Computer Science for Schools VL, 5c { oN ma | = 2"4 Edition — i, TAA eM r | Sir meta) S CAMBRIDGE aaa sree 9 CAMBRIDGE UNIVERSITY PRESS ‘4843/24, 2nd Floor, Ansari Road, Daryagan, Delhi 110002, India ‘Cambridge University Pres is part ofthe University of Cambridge. It furthers the University's mission by disseminating knowledge in the pursuit of education, earning and research atthe highest international levels of excellence, wowweambrldge org Information on ths ttle: www.cambridge-org/9781107693890 Paperback woww.cambridge.org/9781107691377 Paperback with CD-ROM (© Cambridge University Press 2014 ‘This publication isin copyright. Subject to statutory exception and tothe provisions of relevant collective licensing agreements, ‘no reproduction of any part may take place without the written ‘permission of Cambridge University Press, Fist published 2013 Second edition 2034 Reprinted 2014 (wie), 2016 (tece) Reprinted 2017 Printed in india by international Print -O- Pac Limited, Noida, UP. ‘A catalogue record fortis publeation is avalabl from the British Library ISBN 978-1-107-69385-0 Paperback ISBN 978-1-107-69137-7 Paperback with CD-ROM Cambridge University Press has no responsibility forthe persistence or accuracy Of URLs for external or third-party internet websites referred to in this publication, and does not guarantee that any content on such websites is, or will remain, accurate or appropriate. Information regarding prices, rave timetables, and other {actual information given inthis workis correct atthe time of frst printing but ‘Cambridge University Press does not guarantee the accuracy of such information thereafter. NOTICE TO TEACHERS IN THE UK Itisillegal to reproduce any part ofthis work in material form (including ‘photocopying and electronic storage) except under the following circumstances: (i) where you are abiding by a licence granted to your school or institution by the Copyright Licensing Agency; (W) where no such licence exists or where you wish to exceed the terms of alicence, and you have gained the written permission of Cambridge University ress (iu) where you ae allowed to reproduce without permission under the provisions ‘of Chapter 3 ofthe Copyright, Designs and Patents Act 1988, which covers for example, the reproduction of short passages within certain types of educational anthology and reproduction for the purposes of setting examination questions The photocopy masters in this publication may be photocopied or distributed [electronically] fre of charge for classroom use within the school o institution that, purchased the publication, Worksheets and copies of them remain inthe copyright ‘of Cambridge University Pres, and such copies may not be distributed or used in ‘ny way outside the purchasing institution. Every effort has been made to trace the owners of copyright material included in this, book The publishers would be grateful for any omissions brought to their notice for acknowledgement in futur editions ofthe book. Overview Preface Network and Communications MS Excel 2007 Advanced Features World Wide Web QBASIC - Programming Statements QBASIC - Graphics and Sound Introduction to HTML Elementary HTML -1 Elementary HTML - II Creating Forms in HTML 10. Frames in HTML 115 11. JavaScript in HTML Documents 125 12, Flash - Tweening and Publishing 142 13. Introduction to Programming Concepts 153 14. Introduction to C++ 162 15. Introduction to Java Programming Language 177 ASIA ‘Network and + Compuernework | Tomake stents er about | » To give th fl rms given abbreviations Communications | Daiecomponents of | etwerkingconcepsandis | + Lab Wok ~Adionl aves work ‘rious pee + Types ofrework Network topology > types of transmis camel 2 MS Exes 2007 > Callseence “To give advanced knowledge | + Tocrene Tit of grocery tems sm he it by ric por kg and Advanced Features | Sorting data ‘EMS Excel 2007 and to |” savethe Blea Tems xls + Fern data Imake stants Jem o sort | + To prepare ais of eons, color code aso an ite on Conlon! formating | dat. import data, iter data, | " dhe rteron > Creaing chars erstng chars + Lab Wok Adtoa aces + toring data rom note Exe Sect Word decent x > Wor Wide Web eaing abo WWW and | » Naming core procols Protcaleomthe web | understandings components | + Lap Wek -Adltoal acts + Conponets ofthe Wed Hove the Web works? + Webhosting + Usesof WWW 4 QBASIC Programming [> FOR .. NEXT “Tomke stndens kar more | + Torin the square of umber rom 10 wing FOR .. NEXT Statement + DOWHILE...LooP | programming ements LooP + DOUNTIL.. Loo | sing QBASIC + Topvint he id mbes from 20 1 sing FOR. NEXT ‘+ WHILE... WEND Loop 2 ExTTeommand + “Toprint mls of 10 from 104 100 ang WHILE... WEND + ‘Topmat the smo tata mbes sing DO WHILE Loop + Lab Work Addons atten % QBASIC-Graphiesand [+ Grphissin QBASIC | To makestdens lam | + Trying oat commands o sean ojetin difect clos Sound > Soundeffesin QBASIC | tous graphics andsound | + Using commands wth diferent types of sens tooksve effects m QBASIC dierent eat + Lab Work = Aion! cits © Introdocton HTML [> HIMLetior Tnoccingsndetsto | » Toopen a otpado wrt down the coding for reing a web > AEM tgs HIME page et tackgroend olor oor the text sve st and open in RTM cemeas Interne explorer HTML ae aes + Lab Work Adina activites + Site ofan HTML, dheament + inpoanc HTML gs 7 Blementary HTML =1 [> Heating ap > To make wodens am aboot |» To eae web age wih te Reading "Hisar bend he iveaion | + Paragraph ag

Yavousfomatingwgsin | ofthe whe fad et some fas os stay book om te S Cinebrak ig ebR> | HTML Inter for ap ail on using propa heading levels or > Notresk wg eNOBR> diferentes and sotopis and aning

ag and cBR> as > Foxmating os + Tofind othe ouput ofa gen cos n HTML Hina le tg HR + Ty cre compete webiton he Seven Wonders ofthe Wold > Comment tes Lab Wonk Adina ates Greatng isin HTML | Tooke wader undertnd |» To reat an wondered it on My shopping ist BTML-It + Description is thelist sed in HTML and | 7 eee a nese ist on Types of fod ow to create ables + Nest its oe + Tore a deintodiston cds, tases and sal wih examples + Tasting tables + Tocreate table to specifi insracons (Changing tex type, color and stein HTML Aajsting page margins ‘To change the font size and face ofa able created to given specifications Lab Work Adkitonal activites Oy ER Va Ew aca oro fs «) (scam, 9, Creating Formsin [+ Form ag To lea about reat text box for Login name and Password with he ML + Inertace cements used inside

tg. | tating forms in tame Lt and PL ‘webpage us To crete a checkbox on Types of books a To crete a Rao Button on months witha given ange and To eee a buton to reset or submit form To rete fe uplond option to ata a word file To create a text area on “About mel ‘octet a seoll box where five ows re visible and tid rami selected by def To create list box for The games Ike to play Lab Work ~ Additional sctvtes 10, Framesin HTML [+ Frumes To eam about frames |» To crate a website on Harry Poter using diferent frames Frameset tg and fameset in [Lab Work -Adkitona activites Frame tag ae Nested frameset 1H, JavaSeriptin HIME [+ Importance of lavaScxp ‘To eam about Te display various messages following specifi instructions Documents Wing 2 Jaaserige scripting languages | Accepting fis name and lastname from aur and and to make ‘splaying the fll ame JavaScripts foraweb 1, Ty accept a name and age from 2 user and to display the message accordingly Lab Work Aditona activites Using external JavaScript file ‘The object model in JavaScript document. wie () method SvaScript viable JavaScript operators Window methods parselnt( and parseFloat() methods “To create a motion oweening ofa Alying bird anda mov understand rain using diferent ayers animations in the To crete a shape tweenin of os bud changing into 2 form of tweening flower Adding «Fash File nan HTML document | rere ‘lash —Tweening and [+ Tweenng in Flash To make students Publishing resting and integrating scene nto movie Publishing Flash movies ‘Tomake amovie of two scenes showing sunset and sunrise Lab Work = Additional activites ntroduetion to Programming angus To make stoents To logically interpret the given codes Programming Generations of computer language understand the Lab Work ~ Additional activites Concepts, programming 8 Eonceps Important ers sd defntions Introduction to Cre [+ History of Cr+ Tnteducing students [>To write a C++ program Compiling and debugging aC++ program | 10C+ To find out the output a given code Cre tokens Lab Work ~ Additional activities Types of operators Tatroduction 0 important features of Java Tatoducing students [> To find out the op ofa Java program Types of Java program ‘ols Lab Work ~ Aditonalstvites Language (00PS in Java Integrated Development Environment RAN Click Start: Computer Science for Schools, Second Edition is the comprehensively updated version of the previous edition, The revised edition is primarily based on Windows 7 and Microsoft Office 2007 with updates from Windows 8 and Microsoft Office 2010. Each level of the series has been designed keeping in mind the mental aptitude and learning ability of the learners as well as their interests. Efforts have been made to use examples from day-to-day life, which help the learners bridge the gap between the knowledge of the subject and the real world. The books are designed to offer a holistic approach and help in the overall development of the learners. The special features of the book are: + Snap Recap to recapitulate the concepts learnt earlier + Learning Objectives to clearly define the aims and objectives of the chapter + Fact File to enhance the knowledge of the students * Quick Key and Try This to introduce shortcuts and alternative methodologies + Activities interspersed within each chapter to promote application based learning + Exercises to make tasks interactive and promote guided discussions * Glossary and Now You Know to aid quick revision of the concepts learnt + Lab Work to encourage learning by doing + Biographies to inspire young learners + Teacher's Notes provide creative suggestions to further strengthen learning + Teacher’s Manual to facilitate teaching In addition to this, special icons, notes, shortcuts, troubleshooting tips, text related screen shots and illustrations have been used to support and strengthen the process of learning. The Students’ Books are available both with and without the CD-ROM. The books, thus, will not only make learning fun but also help the learners achieve a certain level of expertise in this fast changing world of Computer Science. Anjna Virmani Shalini Harisukh ° Rai erg . Networking is a collection of computers connected together for sharing information and resources. Different types of networks are PAN, LAN, MAN and WAN. PAN connects personal devices of an individual amongst each other. LAN connects computers over a relatively short distance. MAN extends over an entire city. WAN transmits information over a large geographical area. yan LEARNING OBJECTIVES You will learn about: J 1. basic components of computer network 4. topology a ww 2. types of network 5, transmission channels Qi 3. client/server and peer-to-peer architecture Introduction A network consists of two or more computers linked together for sharing resources such as printers, exchange files, or allow a electronic communications. The computers on a network may be > linked through cables, telephone lines, radio waves, satellites, or infrared light beams. A large number of users belonging to the same area or organisation but spread out at different places can communicate and share useful files, software and information only when their computers are networked. This type of networking specific to only users of an organisation is called the Intranet. © Computers linked in a network Internet is a network which is open to all. FACT EILE ee Advantages of a computer network Networking of computers is a basic need of today’s world. Let us study some advantages of computer networking. 1. Speed: Sending and receiving files using a computer network is rapid. It saves time, and is more convenient as compared to files which are manually delivered. 2. Cost efficient: Individually licensed copies of many popular software programs can be costly. Storing the software on a file server and then making it available to the other computers connected to it saves money. . Security: Sensitive files and programs on a network are protected by passwords. They can be made available as read only. This helps in avoiding copying of programs. 4. Centralised software management: Software can be loaded on the main computer, that is, the file server. Thus, it eliminates the need to spend time and energy installing, updating and tracking files on independent computers throughout the same building. 5. Resource sharing: Resources such as printers, fax machines, scanners and modems can be shared by connecting them in a network. This saves space of the work area and is financially » viable. Disadvantages of a computer network The following are some of the disadvantages of a computer network: 1. If the server develops a fault then users may not be able to run the application programs and chances of data loss are more. 2. If the network stops operating then the computers connected to the network cannot be used, thus affecting the performance of the entire system. 3. As traffic increases on a network, the performance degrades unless it is designed properly. 4. It becomes difficult to manage, as the number of computers on a network increase. Basic Components of a Network Computers connect to a network using some hardware components. Following are the different components of a computer network. Server A server is a computer that manages the network resources, software and files (Fig. 1.1). It is normally dedicated, that is, it performs no other task besides the allocated task. For example, a File server is a computer that manages storage and retrieval of files. A Print server is a computer that manages one or more printers required Workstations : Fig. 1.1 Workstations connected to a server in a network. Workstation A workstation is a computer intended for individual use in a networking environment. It is like a personal computer except that it is connected to other computers as well as to the main computer, that is, the server. @ Workstati¢ Network Interface Card eae Network Interface card (NIC) is a piece of hardware placed inside the system unit. It is a part of the motherboard. It is designed to allow computers to communicate over a computer network. It provides physical access to a networking medium. Network Interface Card Hub A hub is a device that connects multiple devices and makes them work as a single network segment. A hub has multiple ports. A specific cable connects the hub to the NIC. The NIC transfers the data in a computer to a hub which then transfers it to the other connected computers. CY Hub EACTIEILE Transmission channels Each computer in a network is interconnected through transmission channels. These channels can be wired or wireless. Data is exchanged between two computers in a network using these channels. The wired channels can be cables like twisted pair, co-axial, fiber optics, etc. The wireless channels can be through satellites using microwaves, radio waves, etc. You will learn more about them later in this chapter. Types of Network The network can be categorised on the basis of the geographical area as listed here: Personal Area Network It is a network for communication among personal devices of an individual. The devices can include cell phones, computers, cameras, laptops, tablets, etc. These devices are connected through a wired or wireless PAN. PAN covers a short radius of only a few metres. It is used to share or transfer files, songs, etc. USB cable is a source of wired PAN. Bluetooth and Wi-Fi are sources of wireless PAN, Local Area Network (LAN) When computers are interconnected within a limited geographical area then it forums a Local Area Network. For example, network within a building, an office, school, etc. It covers a radius of a few kilometres. In addition to operating in a limited space, LANs are also typically owned, controlled, and managed by a single person or organisation. Metropolitan Area Network (MAN) When the computers are interconnected within the same city, that is, the branches located at different places in the same city, then it becomes a Metropolitan Area Network. For example, local libraries, branches of the same school in a city, branches of the same office in a city, etc. MAN spans over a larger physical area than a LAN but is smaller than a WAN, such as a city. It is typically owned and operated by a single entity such as a bank, government body or large corporation. EACTIEILE Wide Area Network (WAN) When network is spread across cities, countries or even continents, covering a large geographical area, then it becomes Wide Area Network. The Internet is the best example of WAN as it is the largest WAN covering the globe. Computer networks may also be classified according to the functional relationships that exist among the elements of the network. For example, client server and peer-to-peer (workgroup) architecture. Client/Server architecture Client/Server architecture is defined as a specific type of a network which consists of a single powerful computer acting as a server usually connected to multiple computers called clients (Fig. 1.2). One server generally supports numerous clients. The server has powerful central processors, more memory, and larger disk drives than clients. A server device typically stores files and databases including more complex applications like websites. The client contains the programs/software as per the requirements of the user. Network clients make requests to a server by sending messages, and servers respond to their clients by acting on each request and returning results. A client/server network can be utilised by desktop computers and laptops, as well as other mobile devices that are properly equipped. ‘An example of client/server is when you try to access your bank account from a computer. A client program in your computer forwards the request to a server program at the bank. The server access the data of that specific account and sends the request back with the account details on the client machine. Advantage: The centralised handling of data provides an increased security. For example, password protection, ensuring that the data is only available to qualified individuals. Disadvantage: It runs the risk of a system overload. If too many different clients attempt to reach the shared network at the same time, there may be a failure or slowing down of the connection. CLIENT CLIENT CLIENT ‘CLIENT CLIENT SERVER Fig. 1.2 Client-Server architecture Peer-to-peer architecture Peer-to-peer architecture is a type of network in which each workstation has equivalent capabilities and responsibilities. The workstations are connected to each other but do not have a server (Fig. 1.3). Files can be shared between workstations, and a printer connected to one workstation can be accessed by other workstations as well. Peer-to-peer networks can really only be set up among a few computers within an office or single room. It is much simpler to set up as compared to client/server networks. Advantage: It supports distributed processing, so the increased load will not affect the system overall. Disadvantage: It does not support centrally managed security. It does not provide the backing up of files. EACTEILE NS Network Topology The physical arrangement of the cables, computers and other peripheral devices to form a network is known as a topology. A few of the network topologies are described here. Bus topology Bus topology is made up of a main single cable with the terminators at both ends (Fig. 1.4). It is the shared communication medium that makes the backbone of the system. Computers and the other devices including the server are connected to this linear cable for communication. Advantages: The advantages of a network with bus topology are given below: + Itis easy to install. Fig. 1.4 Bus topology + Itdoes not require much cabling. Disadvantages: The disadvantages of a network with bus topology are given below: * Ifthe backbone cable fails, the entire network effectively becomes unusable. * Itis difficult to identify the problem if the entire network shuts down. Star topology Star topology is the most common topology used. Here all the workstations are connected to a central connection point called a hub (Fig. 1.5). Any data that is sent to the other computer, first goes to the central hub and from there it is redirected to the destination computer. Advantages: There are a few advantages of using a star topology. They are given below: = ; - + Itis easy to add and remove workstations by upgrading pe Ly = the hub. * Itis easy to install. = f Disadvantages: A few disadvantages of a star topology are ii given below: « Fig. 1.5 Star topol + Itrequires more cable length. 1B tar topology * Failures in the central hub will break down the entire network. Ring topology In a ring topology, every workstation has exactly two neighbours for communication purposes. All messages travel through a ring in the same direction either clockwise or anticlockwise (Fig. 1.6). Advantages: A few advantages of ring topology are given below: * It is easier to detect faults in the network. = + Less number of cable wires are required. Disadvantages: A few disadvantages of ring topology are given below: + A failure in any cable or device breaks the loop leading to breakdown of the entire network. * Adding or removing a device/workstation means rewiring and re-routing all the cables. Fig. 1.6 Ring topology Types of Transmission Channels The medium used for transmission of data between the nodes in a network is called transmission channels. This channel can be: + Wired * Wireless Wired transmission channels Wired transmission channels help in transmission of data over a wire based networking. A few examples of wired channels are explained here. Coaxial cable: It is one of the cheapest and the most commonly used wire based networking. This type of cable is suitable for transmitting signal of low power over a small distance. They are widely used in small networks, cable TV, etc. Twisted pair cable: It consists of two independently insulated wires twisted around one another. The twisting eliminates hindrance of signals due to adjacent pairs or other sources. Coaxial cable Twisted pair cable EACT FILE ‘Twisted pair cable is used by older telephone networks. It is the least expensive type of Local Area Network (LAN) cable. Most networks contain some twisted pair cabling at some point along the network. However, over long distances at high data rates it does not guarantee data integrity. Fibre Optics Cable: It is made up of optical fibres that use the concept of light for the transmission of data. This is a new technology so it is quite expensive. High speed data can be made to travel over a long distance with less damage to the data. It is steadily replacing copper wire as an appropriate means of communication through signal transmission. Wireless transmission channels Fiber optics cable Wireless communication is the transfer of information over a distance without the use of wires. Itis the fastest growing segment of the communication industry these days. The distances involved may be short, that is, a few meters as in the case of television remote control or long as in the case of thousands or millions of kilometres for radio communications. There are many types of wireless networks that make data communication possible, both over long range and short range. All of these networks operate at different frequencies. Some examples of wireless communication are: + Remotes of electronic devices FACT 5. * Bluetooth * Cell phones + Wireless networking + Wireless computer devices like mouse, keyboard + Satellite televisions eS — * Radio waves There can be various channels for wireless transmission. A few are explained here: Radio waves: Radio waves are generally used for long distance wireless communication. The signals can pass through thick objects such as non-metallic substances. Radio waves are used in radio communication (AM/FM), communication satellites, radars, computer networks, etc. Infrared: Infrared is one of the most primitive forms of wireless communication. It is an electromagnetic radiation. It is basically suitable for short distance communication. For example, television and a remote control connect to each other using infrared rays. The signals travel in a straight line and cannot penetrate walls. Microwave: Microwave is the most commonly used wireless transmission medium, and is spread widely across the world. Most of the wireless access points and wireless devices work on microwave communication. This communication medium is not only cost effective but widely used in cellular communication as well. Bluetooth: Bluetooth is another wireless communication medium operating over short distances. It has a normal range of approximately 3-300 feet depending on the devices connecting. These devices can be mobile phones, personal computers, laptops, digital camera, MP3 players, etc. Bluetooth enabled devices form a small network. In Bluetooth technology, eight devices can be connected to each other at the same time. Bluetooth can also be found in the headsets, hands-free 4 Blwetooth device kits, wireless keyboards and mouse. Bluetooth uses the radio wave technology which is not very expensive and has low power consumption. This technology is becoming popular because of its low cost and portability. a ane SEESSEE8 Seee © ee _# I a

You might also like