Escolar Documentos
Profissional Documentos
Cultura Documentos
MYSQL
&
JAVA
ASSIGNMENTS & PROPER NOTES
(Class - XII: INFORMATICS PRACTICES)
SYLL ABUS
Chapter:
Computer Networking
Open Source Concepts
My SQL Revision Tour
Database Transactions
More on SQL – Grouping Records and Table Joins
Tables and Integrity Constraints
IT Applications
Java GUI Programming Revision Tour – I
Java GUI Programming Revision Tour – II
Mid Term Syllabus
Java GUI Programming Revision Tour – III
More About Classes and Libraries
Concept of Inheritance
GUI Dialogs and Tables
Database Connectivity of My SQL
Web Application Development
HTML- I Basic HTML Elements
HTML 2 – Lists, Tables and Forms
Pre Board 1 Syllabus
XML-eXtensible Markup language.
Theory
Unit No. Name Marks
1. Networking and Open Standards 10
2. Programming 25
3. Relational Database Management System 30
4. IT Applications 05
Total 70
Practical :
(i) Hands on experience 15
(ii) Records / Practical File 5
(iii) Project 5
(iv) Viva 5
Total 30
Suggested Reading :
Informatics Practices by Sumitra Arora
Informatics Practices by Reeta Sahoo and Gagan Sahoo
2
(Class - XII: INFORMATICS PRACTICES)
Learning Objectives: Student will learn about computer networks briefly, associated
terminology and related concepts along with a brief discussion
on network security.
Keywords:- Resource Sharing, Nodes, Domain Name, topologies, MAN, WAN, LAN,
PAN, Modem, Switch, Router, Firewall, OSS, FLOSS, GNU, Freeware.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module 12 (IP)
Chapter: My SQL Revision Tour, Database Transactions, More on SQL – Grouping
Records and Table Joins.
Learning Objective: Students will revise the concept of SQL. They will learn about
various database transaction. To write SQL programs to
interact with database.
Keywords: Relation, Table, Domain, Create, Alter, Delete, Drop, Rollback, Begin,
Commit, Savepoint, Having, Group By, Join, Change.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module 12 (IP) -03 (May)
Chapter: IT Applications, Java GUI programming Revision Tour I, Java GUI
programming Revision Tour – II, Java GUI programming Revision Tour – III.
3
(Class - XII: INFORMATICS PRACTICES)
Learning Objective: Students will learn about various features of IT application such
as front end, back end along with briefly revising the concepts
of IT applications, students will also revise the concepts of Java
GUI Programming using IDE, classes, objects and methods.
Keywords: Class, Object, Scope, this, Formal Parameter, Constructor, Combo Box, List
Box, Radio Buttons.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module 12 (IP) -04 (July)
Chapter: More About Classes and Libraries, Concept Of Inheritance.
Learning Objective: Students will be learning about the way access of members of a
class is controlled in Java i.e. about specifiers. They will even
learn about packages and library classes. Students will also
learn about inheritance – the capability of one class to derive
properties from another class.
Keywords: Private, Public, Protected, Default, Abstract Class, Base Class, Derived Class,
Access Specifier, Java Package, Java Language.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module 12 (IP) -05 (August)
Chapter: GUI Dialogs and Tables, Database connectivity to MySQL.
Contents: Dialogs in Java, Tables, Classes used for Database Connectivity, Prequisities
for connecting to MySQL from Java, Connecting to MySQL from Java.
Learning Objective: Students will learn about how to create dialogs in Java swing
through Net Beans IDE and how to use GUI Table control
4
(Class - XII: INFORMATICS PRACTICES)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module 12 (IP) -06 (September)
Chapter: Web Application Development, HTML – I : Basic HTML Elements.
Contents: Web Browsers and Web Servers, Communicating with Web Servers, HTML
and its Capabilities, Writing HTML Documents, Container and Empty
Elements, HTML Tag Structures, Basic HTML Tags, Logical and Physical
Text Styles, Special Characters.
Learning Objective: Students will learn about some basics related to web –
application development and client – server architecture. They
will also learn about basics of HTML.
Keywords: Hypertext, HTTP, Server, URL, Web Browser, Website, WWW, Tag,
Attribute, Container Element, Empty Element.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(October – November)
Chapter: HTML – II : Lists, Tables and Forms.
Learning Objective: Students will learn how to create HTML lists, tables and forms
using HTML tags.
Keywords: Definition Lists, HTML Table, Numbered Lists, Ordered Lists, Unnumbered
Lists, Unordered Lists, Forms.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(December)
Chapter: XML – eXtensible Markup Language.
Contents: What is XML? XML versus other Technologies, Features of DML, Working in
XML, Logical Structure of XML Document, XML Document Categories,
Validating XML Documents.
5
(Class - XII: INFORMATICS PRACTICES)
Learning Objective: Students will learn about what XML is? How it is beneficial and
how one can work in it.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=============================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6
(Class - XII: INFORMATICS PRACTICES)
ASSIGNMENTS
COMPUTER NE T WORKING
Q.9. A company want to form a network on their six computers to a server within the
company premises. Represent STAR and RING topologies diagrammatically for the
above network.
Q.10. A school would like to go in for network of all the computers, which topology
would you recommend and why?
Q.11. Name the network topology in which there are bi-directional links between each
possible node?
Q.16. ABC organization has set up its new center Mangalore for its office and web based
activities. It has 4 blocks of building as shown in the diagram below.
7
(Class - XII: INFORMATICS PRACTICES)
A B
C D
C to D 25 m
A to D 170 m
B to D 125 m
A to D 90 m
Number of computers
A 25
B 50
C 125
D 10
(i) Suggest a cable layout of connections between the centres.
(ii) Suggest the most suitable place (i.e. block) to house the server of this
organization with suitable reasons.
(iii) Suggest the placement of the following devices with justification.
(a) Repeater (b) Hub/Switch
(iv) The organization is planning to link its front office situated in the city in a
hilly region where cable connection is not feasible, suggest an economic way
to connect it with reasonable high speed.
O PE N SO URCE CO NCE PT S
Q.1. Differentiate between :
(i) Free Software and Open Source Software
(ii) OSS and FLOSS
(iii) FSF and OSI
(iv) Freeware and Shareware
(v) Proprietary Standards and Open Standards
(vi) True Type Font and Open Type Font
Q.2. Write the components of Mozilla software suite.
Q.3. Name the platform on which MySQL can work.
Q.4. What is UNICODE?
8
(Class - XII: INFORMATICS PRACTICES)
Q.4. State the order of evaluation of the operators in each of the following statements,
and show the value result after each statement is performed. Assume result to be
an integer variable.
9
(Class - XII: INFORMATICS PRACTICES)
(i) Result = 7 + 3 * 6 / 2 – 1
(ii) Result = 2 % 2 + 2 * 2 – 2 / 2
(iii) Result = 10 % 3 ^ 1 ^ 2 – 8
Q.5. If the length and breadth of a rectangle is 12 and 20, write a program to find the
area using Print statement.
Q.6. Write program statements to assign four marks and print total and percentage using
Print statement.
Q.7. Suppose, in your class there are 60 students out of which 20 are girls. What
percentage of students are girls & what percentage is of boys?
Q.8. A water tank contains 400 litres of water. You take 120 litres of water out of it.
Write a program to calculate the percentage decrease in the amount of water.
Note: Decrease % = (Decrease / Original value) * 100%
Q.9. Answer the following:
(i) Suppose a print statement includes six output values, separated by commas.
How can the statement be rewritten so the outputs values appear on the
same line?
(ii) Assign the value of the variable „number 1‟ to variable „total‟.
(iii) Assign the sum of the two variables loop_count and petrol_cost to the
variable sum.
(iv) Divide the variable total by the value 10 and leave the result in the variable
discount.
(v) Assign the character W to the char variable letter.
(vi) Assign the result of dividing the integer variable sum by 3 into the float
variable costing.
(vii) Use a statement to print out the value of the integer variable sum.
(viii) Use a statement to print out the character variable letter.
Q.10. What value will be stored in different variable when the following JAVA statements
are executed?
int I = 10;
int J, K, m;
J = I + 5;
K = I J/5;
I = L + I;
m = I + I – I;
n = L + m * I;
Q.11. Is the line given below is a valid comment?
„This is a‟ valid comment
Q.12. Write a GUI application to display first 12 numbers into JText Area using while
condition.
10
(Class - XII: INFORMATICS PRACTICES)
Q.13. Write a GUI application to list natural numbers till N using for loop. Notice that the
numbers will be added into a JText Area control.
Q.14. Write a GUI application to assign two numbers and find their sum and difference
using switch statement with JRadioButton and Button Group controls.
Q.15. What is a variable?
Q.16. What will be the output of the following statement? System.out.println(“1”+3);
Q.17. What are expressions?
Q.18. State the difference between = and = =.
Q.19. What is Boolean Variable?
Q.20. Why is Java platform independent?
Q.21. Write a statement for each of the following :
(i) Store a number 275 as a string.
(ii) Convert the string to a numeric value.
(iii) Add it to the existing total of 500 to update the total.
Q.22. If a=5, b=9, calculate the value of :
X=a++-++b+a
Q.23. Write an equivalent Java Statement for the given expression :
A= 0.06-2y2
x-y
Q.24. Identify and correct the errors in each of the following :
if (Gender==1)
jLabel1.settext(“Woman”);
else;
jLable1.settext(“Man”).
Q.25. Convert the following segment into equivalent for loop :
int I=0;
white(I<= 20){
System.out.Println(“Hello”):
I++;
}
}
Q.26. Consider the following program code and tell how many time the loop will execute:
int x=5, y=50;
While(x<=y)
{
y=y/x;
11
(Class - XII: INFORMATICS PRACTICES)
x=x+5;
}
Q.27. Evaluate the following C++ expressions where a,b,c are integers and d,f are
floating point numbers.
The values are a=5, b=3, d=1.5
(i) c=a(b++)*(--a)
(ii) f=(++b)*b-a
Q.28. What is the difference between selection and repetition?
Q.29. Write a Java Desktop Application to swap two numbers using third variable.
Q.30. Write a program in Java to generate the sum of „n‟ numbers entered by the user.
Q.31. Accept age of twenty students and arrange them in ascending and descending
order on the click event of these respective buttons.
Q.32. Write a program in Java to generate the n multiples of the number entered by the
user.
Q.33. Using nested loops make following patterns:
(i) * (ii) *****
** ****
*** ***
**** **
***** *
(iii) 1 (iv) A
12 AB
123 ABC
1234 ABCD
12345 ABCDE
Q.34. Find the errors and rewrite the corrected code.
(i) A=5
while A<=20{
If A % 2 = 0
Print A
A=A+1
}
12
(Class - XII: INFORMATICS PRACTICES)
while I<20 {
System.out.println (I*I);
}
(ii) int S = 0
for (I = 1; I<20; I = I + 5)
{
S = S+ I * 2;
I = 1 + I;
}
System.out.println (S, I);
13
(Class - XII: INFORMATICS PRACTICES)
14
(Class - XII: INFORMATICS PRACTICES)
Q.20. Create an application using JButton component to print “Hello Java” in a message
box.
Q.21. Create GUI Application to find sum of two numbers using show message dialog ().
Q.22. Create an application which takes input of first name and last name and on clicking
concatenate button a message should appear by joining first name and last name.
Q.23. What is a container? Name few examples of container.
Q.24. If a string ABC holds a value “456”, then how will you convert it into integer type.
Write the command.
Q.25. What action will happen when we press Enter Key on a JTextField control?
Q.26. Explain getpassword() method.
Q.27. What are the limitation of JTextfield.
Q.28. What does the system exit(0) do when it is attached with a JButton Control?
Q.29. Create a Java application to enter your name and address using two textfield
controls. Using a JButtons click event handler, display both name and address in
another JTextField control.
Q.30. Create a GUI application to calculate the simple interest using four JLabel, for
JTextField and two JButton controls input the principlel amount, interest rate and
time periods. Find the interest amount using calculate button
Java GUI Programming Revision Tour – III and More About Classes &
Libraries
Q.1. Create an application to find the volume of a cube using class concept.
Q.2. What are methods?
Q.3. What do you mean by return statement?
Q.4. What is a class?
Q.5. Where can you declare a global variable in an application?
Q.6. Which keyword is used to declare Java Class?
Q.7. How many objects are created in the following piece of code?
Myobject 01,02,03;
01=New Myobject();
02=New Myobject();
Q.8. Declare the method definition line for each of the following :
(i) Method Small_Num which takes three integers a,b,c and return as integer
data type.
15
(Class - XII: INFORMATICS PRACTICES)
(ii) Method Info which does not take any arguments and does not return a
value.
Q.9. What is the difference between a constructor and a method?
Q.10. What does it mean that a method or fields is “Static”?
Q.11. Can a Java file contain more than one java classes?
Q.12. What is the difference between static and non-static variables?
Q.13. How are this() and super() used with constructors?
Q.14.State the significance of public, private, protected, default modifiers in Java
Programming.
Q.15. Differentiate between Call by Value and Call by Reference.
Q.16. What is the role of a return statement in a method?
Q.17. What is a composite data type?
Q.18. Develop a desktop application to test all string manipulation methods using a
JButton click event procedure. Note that the result of string manipulation methods
will be placed in a JTextArea control.
CONCEPT OF INHERITANCE
Q.1. What do you understand by inheritance?
Q.2. Describe the relationship between a parent class and a child class.
Q.3. Why would a child class override one or more of the methods of its parent class?
Q.4. What is a superclass?
Q.5. What is an abstract class?
Q.6. Illustrate the concept of Inheritance with the help of an example.
Q.7. Consider the following declarations and answer the questions given below :
class Teacher
{
int roll;
protected String name[20];
public void inputdata(int, int){
. . .
}
public void optputdata(){
. . .
};
class Student extends Teacher
{
int class;
16
(Class - XII: INFORMATICS PRACTICES)
17
(Class - XII: INFORMATICS PRACTICES)
(ii) Name of data member(s) that can be accessed from function writedata().
(iii) Name the member function(s), which can be accessed by an object of
mother class.
(iv) Is the member function outputdata() accessible to the objects of father class?
Q.10. Compare concrete class v/s abstract class v/s interface with an example.
Q.11. Calculate the factorial of a number using child class and base class.
Q.12. Develop a Java desktop application to find the area of a circle and cylinder using
Java overriding method.
Q.13. Consider the following class declaration and answer the question (i) and (ii)
Class Mydata {
Protected int data;
Void Get_Mydata(int);
Void Manip_data(int);
Void Show_data(int);
}
Class Mydata {
Protected int data1;
void Get_Mydata(int);
void show_data(int);
}
Class person extends Mydata{
Void show_data(void)}
}
(i) Name the derived class and base class.
(ii) List the data and functions inherited by the class person.
Q.14. Demonstrate the declaration for the base class and derived class
diagrammatically.
Q.15. Create a generic base class called BI that stores the numbers of floors in a
building, the number of rooms and its total square footage. Create a derived
class called HI that inherits B1 and also store no. of rooms. Next, create a
derived class called O1 that inherits B1.
18
(Class - XII: INFORMATICS PRACTICES)
Q.20. Create a Java GUI application that lets you create a marksheet. The details to be
added in marksheet are : Name, Total marks, Grade.
Q.21. Add a search facility in previous problem, that is, ask the user which column he/she
wants to search in and then obtain search value. If found in the marksheet then
report is otherwise report “not found”.
Q.22. What is a dialog?
Q.23. Design an application that obtain input without using textfield and display a thank
you message.
Q.14. Create a Java NetBeans GUI application to add modify and delete the record in
the lable given below :
Directory : No, Fname, Lname, Phone, Address.
Q.15. Create a Java Net Beans GUI application to add, modify and delete the data into
MySQL Voter table.
Voter : VNo, VName, Age, Address, Phone.
19
(Class - XII: INFORMATICS PRACTICES)
Table : PROFILE
Field Name Field Type and Width Description
EMPNO INT(4) Employee number
DESIG VARCHAR(15) Designation
DOJ DATE Date of joining
SALARY DOUBLE(9,2) Basic salary
GRADE CHAR(1) Grade
EMPPF CHAR(1) Provident fund number (Y/N)
PFNO VARCHAR(10) Provident fund number
EMPESI CHAR(1) ESI(Y/N)
ESINO VARCHAR2(10) ESI No.
EMPDA CHAR(1) DA(Y/N)
EMPHRA CHAR(1) HRA(Y/N)
EMPCON CHAR(1) Conveyance (Y/N)
Write an application which will create a console updation Java Project to add,
modify and delete into the two MySQL tables DETAILS and PROFILE. The
application will operate both the tables simultaneously in one form.
Q.17. Answer the question based on the table Patient give below :
Table : Patient
Column Name Data Type and Size Description
P_code INT(4) Patient Number Primary key
Patient_name VARCHAR(30) Name of the patient
Department VARCHAR(20) Department to which patient is admitted
Fees FLOAT Fees given
Using MySQL JDBC Driver data connection, write Java code for Save, Edit and
Exit command buttons to insert record, modify record and exit application into
Patient table. Notice that the modification operation will only occur when you
search a patient from existing table.
20
(Class - XII: INFORMATICS PRACTICES)
The company accepts payments in three modes – by cheque, cash and by credit card.
The company offers the discount scheme on each purchase for customer as follows :
For cotton
Purchase above 5000 and avail discount 10%
21
(Class - XII: INFORMATICS PRACTICES)
Q.2. Write the HTML code to set the BGCOLOR as purple and a text “Hypertext
Markup language”.
22
(Class - XII: INFORMATICS PRACTICES)
Q.13. What are the different forms of list used in HTML? Name them.
Q.14. How can an image be inserted in a web page?
Q.15. What are the different forms of list used in HTML?
Q.16. Identify error() in the following HTML code Also write the correct code.
<OL>type= “a”start=“d”>
Q.17. What is a <OL>_ _ _ </OL> tag? Name any two attributes used with this tag.
Q.18. Differentiate between Cellpadding and Cellspacing.
Q.19. How is External linking different from internal linking.
Q.20. What is the real use of XML?
Q.21. Differentiate between <SUP> and <SUB> tags with example.
Q.22. How is <OL> different from <UL>?
Q.23. What is table? What are the basic commands for creating a table?
Q.24. Which tag and attribute are used to jump to
(i) a new page (ii) another location in the same page
Q.25. What is input tag? Explain its attributes?
Q.26. What is the purpose of select tag?
Q.27. State the major difference between radio buttons and a list of check boxes.
Q.28. Create a page about your hobbies and interest. On the page include links to
different web pages.
Q.29. How is the XML formed and what is the benefit of using it?
Q.30. Differentiate between HTML and XML.
Q.31. Differentiate between static page and dynamic web page.
Q.32. What do you understand by a well-formed document?
Q.33. What is root element? What is its significance? What is its alternate name?
Q.34. What is declared empty tag?
=============================================
23
(Class - XII: INFORMATICS PRACTICES)
Q.3 Use the following structure of customer table to answer the following questions:
Write the SQL command to create the above table including its constraints.
Q.4 Consider the table EMP with following structure. Write SQL commands for the
following conditions.
24
(Class - XII: INFORMATICS PRACTICES)
25
(Class - XII: INFORMATICS PRACTICES)
26
(Class - XII: INFORMATICS PRACTICES)
Considering table ABC, for the following series of statements, determine which
changes will become permanent and what will be the content of the table ABC
after statement. Justify your answer.
(i) START TRANSACTION;
(ii) INSERT INTO ABC values (4, „ABHAY‟,400);
(iii) DELETE FROM ABC where S.No. =2;
27
(Class - XII: INFORMATICS PRACTICES)
28
(Class - XII: INFORMATICS PRACTICES)
Q.3. Write SQL statement to create Employee relation which contain Emp No., Name,
Skill, Pay Rate.
IT APPLICATIONS
Q1. Give one major difference between Front-End technology and Back-End
technology in terms of software projects. Give one example of each.
Q2. Explain in brief an entity, relationship and attribute with the help of one example.
Q3. Identify the type of relationship represented by the following statements and draw
an entity relationship diagram to show it.
“One student is taught by many teachers. One teacher teach one student.”
Q4. Identify the type of relationship represented by the following statements and draw
an entity relationship diagram to show it.
“Each garment must have one and only one price. Each price may be for one or
more garments”.
Q5. What are the different types of relationships that can be depicted through an E/R
model? Explain the concept of ER Model using the case study of a Ticket
Reservation System that has three entries – Ticket, Passenger and rain. Assume
that each passenger can buy more than one ticket.
Q6. Write one example each of “one to many” and “many to many” relationships
between two entity sets.
Q7. Identity the type of relationship represented in the following statement and draw in
Entity Relationship Diagram to show it : “A customer can buy many items”.
Q8. What do you understand by a many to one relationship? Explain with examples.
Q9. Expand the following terms:
(i) ER (ii) UML
Q10. Define DDLC.
Q11. Define weak and strong entities. How are these otherwise known as?
Q12. What is a composite attribute?
Q13. What are sub entities and super entities?
Q14. Identify the dependent and independent entities out of the following :
(i) Student and Grade
(ii) Customer and Phone
(iii) Supplier and address
Q15. What are the societal impacts of (i) e-governance (ii) e-business (iii) e-learning
29
(Class - XII: INFORMATICS PRACTICES)
30
(Class - XII: INFORMATICS PRACTICES)
SECTION – B
Q.4. Read the following case study and answer the questions that follow :
Manager of XYZ Infotech Solution Ltd. Decided to develop a application to
manage employee information. He asked his subordinate to make a form in Java.
The form presented by the subordinate is shown below.
31
(Class - XII: INFORMATICS PRACTICES)
(i) Write a code in the form load event to disable the textfield Basic, Da, HRA,
Gross, PF and Netsalary and take the dept, design and Radio buttons to
their default state as shown in the form. [2]
(ii) Write a code to add record of an employee to the list when cmdAdd is
clicked and delete record from the list when cmdDelete is clicked. [3]
(iii) When CalculateSal is clicked, the salary details must be automatically
calculated and displayed in their respective textboxes. [5]
Designation Basic
Manager 15,000
Supervisor 12,000
Accountant 9,000
Clerk 6,000
DA = 10% of basic
HRA = 30% of basic
PF = 12% of basic
Gross Salary = basic + DA + HRA
Net Salary = Gross salary - PF
(ii) How many times are the following loops executed? [2]
x=5 ; y=50 ;
while (x<=y) {
x=y/x;
}
(iii) Identify and correct the errors in each of the following statement : [2]
(a) if (C<7) ;
JOptionPane. Show Message Dialog (null, “C is less than 7”);
32
(Class - XII: INFORMATICS PRACTICES)
(b) if (C>7) ;
JOptionPane. Show Message Dialog (null, “C is equal to or
greater than 7”);
Q.6. (i) Write the difference between SAVEPOINT AND ROLLBACK. [2]
Consider the following supplier table and answer the following questions
S.No. PName SName Qty Price City
S1 Bread Britannia 150 80 Delhi
S2 Cake Britannia 250 20 Mumbai
S3 Coffee Nescafe 170 45 Delhi
S4 Chocolate Amul 350 10 Mumbai
S5 Sauce Maggi 300 36 Jaipur
33
(Class - XII: INFORMATICS PRACTICES)
Department
Dept. No. Dept. Name
D01 Physics
D02 Chemistry
D03 Maths
D04 Computer IP
D04 Biology
Teacher
TNo Tname Salary Dept. No.
T01 Rakesh Sharma 25,600 DO5
T02 Jugal Mittal 22,000 DO2
T03 Sharmila Kaur 21,000 DO1
T04 Sandeep Kaushik 15,000 DO3
T05 Sangeeta Vats 18,900 DO5
T06 Ramesh Kumar 24,000 DO3
T07 Shyam Arora 12,000 DO2
T08 Shiv Om 13,000 DO2
T09 Vivek Rawat 17,000 DO1
T10 Ashok Singhal 15,600 DO4
(a) Display TName of all teachers who are in “DO5” having salary more
than 20,000. [1]
(b) Display average salary of all teachers working in “DO2” department.
[1]
(c) Display TName and Deptname and order the rows by Dept No. [1]
(d) Display equi-join of both tables? [2]
(e) Select TName, TNo, DNo, DName from techers, department where
DName = „Chemistry‟ and Teachers.DNO = Department. DNO; [1]
(ii) Create table department as per the following Instance Chart. [2]
Column Name DeptID DeptName
Keytype Primary
Nulls/Unique NOTNULL
Datatype Number VARCHAR
Length 2 20
34
(Class - XII: INFORMATICS PRACTICES)
SAMPLE PAPER
Time Allowed : 3 hours Maximum Marks 70
Note :
(i) This question paper is divided into three sections.
(ii) Section A and Section B are of 25 marks each.
(iii) Section C consists of 20 marks.
(iv) Answer the questions after carefully reading the text.
=============================================
Q.1. Answer the following questions :
(i) Write the purpose of the following : [2]
(a) Repeater
(b) Router
(ii) Write the advantages of optic fibre cable. [2]
(iii) Write two snooping methods used by hackers / crackers. [2]
(iv) Mr. Ram is interested in transferring songs from her mobile to Mr. Shyam
mobile. Suggest two suitable wireless options he may opt for doing the
same. [2]
(v) What is the difference between open source software and proprietary
software. [2]
Q.2. Answer the following questions :
(i) Define e-governance. [1]
(ii) Write two characteristics of front end. [1]
(iii) How is e-learning useful to trainer? [1]
(iv) Mr Das is working as a Manager in the Shivam Enterprises. He wants to
create the forms with the following functions. Choose appropriate controls
from Text field, Label, Option button, Check box, List box, Combo box,
command button and write in the third column. [2]
S.No. Control used to Control used
1. Enter the name, Address,
Basic Salary
2. Select the gender (M/F)
3. Select the department
From the available list
4. Choose type of employee
(Permanent / Regular)
Q.3. Answer the following questions :
(i) When entering a multiple line query in MySQL, what does the
mysql>prompt change to? [2]
(ii) After creating the “student‟ database, you want to use it. Write the command
that you should give. [1]
(iii) What is the purpose of ALTER TABLE command? [2]
35
(Class - XII: INFORMATICS PRACTICES)
(iv) Explain the two wildcard character_and % used with the LIKE clause. [2]
(v) Explain two group functions in MySQL. [2]
(vi) Rama is not able to change a value in a column to NULL. What did she
specify when she created the table? [1]
SECTION – B
Q.4. Answer the following questions :
Read the following case study and answer the questions that follows :
Mr. Vidyarthi works in Blossoms Public School as a programmer. He is required to
develop a student record. The school offers two different streams, medical and
non-medical, with different grading criteria. The school also offers incentive to the
NCC cadets. The grading criteria for the two streams is given below :
Stream Percentage Grade
Medical >=80 A
60-80 B
<60 C
Non-Medical >=75 A
50-75 B
<50 C
36
(Class - XII: INFORMATICS PRACTICES)
(i) Write the commands for Exit button to terminate the application. [2]
(ii) Write the code for Clear Command Button to clear all the textfield. [2]
(iii) Write the code for Calculate percentage to calculate the percentage after
finding the total marks of first term and second term (assuming that both
marks are out of 100). Also ensure that NCC cadets get an increment of 3%
in their percentages. [3]
(iv) Write the code for Calculate Grade button to calculate the grade depending
on the stream selected according to the criteria given above. [3]
Q5. Answer the following questions :
(i) Give the output of the following code fragment: [2]
when (i) opn = „b‟ (ii) opn = „c‟ (iii) opn = „a‟
switch (opn)
{
case „a‟:
system.out.println(“Platform Independent”);
break;
case „b‟:
system.out.println(“Object Oriented‟);
case „c‟:
system.out.println(“Robust and Secure”);
break;
default :
system.out.println(“Wrong input”);
}
(ii) The following is a segment of a program. [2]
x = 1; y=1;
if(n>0)
{
x = x + 1;
y = y – 1;
}
What will be the value of x and y, if n assumes a value (i) 1 (ii) 0?
(iii) Find the syntax errors if any in the following program : [2]
int I; sum = 0;
I = 1;
while (i<=10)
{
sum = sum + I;
I+=3;
}
system.out.println(sum);
(iv) What is the difference between jRadioButton and jCheckBox? [2]
(v) Write the command to set the value of the textfields. [1]
37
(Class - XII: INFORMATICS PRACTICES)
(vi) What is button group? What all controls can you put in it? [2]
(vii) Which of these is an example of a nested list? [1]
(a) <DL>
<LI > Groceries<BR>
Milk<BR>
Sour<BR>
Ice Cream<BR>
<LI > Other groceries
</OL>
(b) <OL>
<LI > Groceries
<U L>
<LI>Milk
<LI>Soup
<LI>Ice Cream
</UL>
<LI>Other Groceries
</OL>
(viii) Create a page about your hobbies (At lease three hobbies). On the page,
include links to interesting sites that coincide with your description. For
instance, if you like sports, you might create a link to
http://www.cnn.com/SPORTS.html for the benefit of your users. [3]
SECTION – C
Q.6. (i) Write the difference between COMMIT and ROLLBACK. [2]
Consider the following table SHOP and answer (ii) and (iii) parts of this
question :
Relation : SHOP
No. Shop_name Sale Area Cust_Percent Rating City
1. S.M. Sons 250000 West 68.6 C Delhi
2. Dharohar 500000 South 81.8 A Mumbai
3. Kriti Art 300000 North 79.8 B Kolkata
4. Ripple 380000 North 88.0 B Mumbai
5. Biswas Stores 456000 East 92.0 A Delhi
6. Crystal 290000 South 62.7 A Kolkata
38
(Class - XII: INFORMATICS PRACTICES)
(d) To display a report with Shop_name, Area and Rating for each shop in
the table, for only those shops whose sale is between 350000 and
4000000 (including both 350000 and 400000). [1]
(e) To display the City and the number of shops in each city in the table
SHOP. [1]
(f) To insert details of a new shop in the table SHOP with the following
data : [1]
(7, “The shop”, 550000, “South”, 90.8, „A‟, “Ahmedabad”).
(iii) Give the output of the following MySQL queries : [Include the last inserted
values of part (vi)] [4]
(a) Select Min(Cust_percent) from SHOP;
(b) Select Sum(Sale) from SHOP where Rating = „A‟;
(c) Select Avg(Sale) from SHOP where City = „Delhi‟;
(d) Select Count(Distinct City) from SHOP;
TABLE : SALARY
ID BASIC ALLOWANCE E XPERIENCE
101 12000 1000 3
104 23000 2300 5
107 32000 4000 5
114 12000 5200 10
109 42000 1700 20
105 18900 1690 3
130 21700 2600 30
(a) Display NAME of all staff who are in “SALES” having more than 10
years experience from the table STAFF. [1]
39
(Class - XII: INFORMATICS PRACTICES)
TABLE : VOTER
Column Name Data type Size Constraint Description
V_ID BIGIN 8 Primary Key Voter identification
Vname VARCHAR 25 NOT NULL Name of the voter
Age INT 3 CHECK > 17 Age should not less than
equal to 17
Address VARCHAR 30 Address of voter
Phone VARCHAR 10 Phone number of the voter
(a) Write a command to delete all the rows of a particular voter from
table VOTER where voter id between 10 and 20. [1]
(b) Delete the table physically. [1]
40
(Class - XII: INFORMATICS PRACTICES)
41
(Class - XII: INFORMATICS PRACTICES)
and researchers who were part of this system, began exchanging data and
messages on it. In mid 80‟s, federal agency, the National Science
Foundation, created a new, high-capacity network called NSFnet.
NSFnet allowed only the academic research on its network. It was the Inter
networking i.e. linking of these two and some other networks(i.e., the
ARPANET, NSFnet and some private networks) that was named Internet.
(ii) The Internet: The Internet is a worldwide network of computer networks
that evolved from the first network ARPANET. Internet is made up of many
networks each runs by a different company and interconnected at peering
points.. The common use of Internet standards allows users connected to
one network to communicate with users on another network it allow users to
exchange information with each other. To accomplish this all the computers
on the Internet have to use a common set of rules for communication, called
Protocols. Internet uses a set of protocols called TCP/IP(Transmission
Control Protocol/Internet Protocol).
Gateway & Backbone: A Gateway is a device that connects dissimilar
networks. A Backbone is central interconnecting structure that connects one
or more networks. At the source computer, the message or the file/document
to be sent to another computer is firstly divided into very small parts called
Packets. A packet generally contains up to 1500 characters. Each packet is
given a number serial wise e.g., 1, 2, 3.These packets are then sent to the
address of destination computer. The destination computer receives the
packets in random manner. If a packet is garbled or lost, it is demanded
again. The packets are reassembled in the order of their number and the
original message/file/document is obtained.
Internet Functioning
The communication protocol used by Internet is TCP/IP. The TCP part is
responsible for dividing the file/ message into packets on the source
computer. It is also responsible for reassembling the received packets at the
destination or recipient computer. The IP part is responsible for handling the
address of destination computer so that each is routed to its proper
destination.
(iii) The Interspace
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. The Interspace is a vision of what the Internet will
become.
4. SWITCHING TECHNIQUES
(i) Circuit Switching: In this technique, first the complete physical
connection between two computers is established and then data are
transmitted from the source computer to the destination computer. This
technique is to setup an end-to-end path between computers before any
data can be sent.
42
(Class - XII: INFORMATICS PRACTICES)
(ii) Message Switching: In this technique, the source computer sends data or
the message to the switching office first, which stores the data in its buffer. It
then looks for a free link to another switching office and then sends the data
to this office. This process is continued until the data are delivered to the
destination computers. Its working principle is also known as store and
forward.
(iii) Packet Switching: With message switching, there is no limit on block size,
in contrast, packet switching places a tight upper limit on block size. A fixed
size of packet which can be transmitted across the network is specified.
Another point of its difference from message switching is that data packet is
stored on the disk in message switching whereas in packet switching, all the
packets of fixed size are stored in main memory. This improves the
performance as the access time is reduced, thus the throughput of the
network is improved.
5. TRANSMISSION MEDIA
Transmission media or communication channels of network mean „connecting
cables‟ or „connecting media‟. The cables that connect two or more workstations
are the communication channels. The communication media are in two categories:
guided media and unguided media. The guided media include cables and
unguided media include waves through air, water or vacuum.
(i) Twisted Pair Cable: The most common form of wiring in data
communication application is the twisted pair cable. It consists of two
identical wires wrapped together in a double helix.
Main Advantages of Twisted Pair Cable are:
(a) It is simple
(b) It is easy to install and maintain
(c) It is physically flexible
(d) It has a low weight
(e) It can be easily connected
(f) It is very inexpensive
Disadvantages: Despite having such advantages, the data transmission
characteristics of twisted pair cable are not so good. Major disadvantages
are:
(a) Because of high attenuation, it is incapable of carrying a signal over
long distances without the use of repeaters.
(b) Its low bandwidth capabilities make it unsuitable for broadband
applications.
(c) It support maximum data rates 1 MBPS without conditioning and 10
MBPs with conditioning.
43
(Class - XII: INFORMATICS PRACTICES)
(ii) Coaxial Cable: This type of cable consists of a solid wire core surrounded
by one or more foil or wire shields, each separated by some kind of plastic
insulator. The inner core carries the signal, and the shield provides the
ground. The coaxial cable has high electrical properties and is suitable for
high speed communication. It is widely used for television signals. In the
form of (CATV) cable, it provides a cheap means of transporting multi-
channel television signals around metropolitan areas.
Advantages:
(a) The coaxial cables can be used for broadband transmission i.e.,
several channels can be transmitted simultaneously (as with cable
TV).
(b) Offers higher bandwidths- up to 400 MBPS.
Disadvantages
(a) Expensive compared to twisted pair cables.
(b) The coaxial cables are not compatible with twisted pair cables.
(iii) Optical Fibers: Optical fibers consist of thin strands of glass or glass like
material which are so constructed that they carry light from a source at one
end of the fiber to a detector at the other end. The light sources used are
either light emitting diodes (LEDs) or laser diodes(LDs). The data to be
transmitted is modulated onto the light beam using frequency modulation
techniques. The signals can then be picked up at the receiving end and
demodulated. The band width of the medium is potentially very high.
The fiber cable consists of three pieces: (i) The core i.e., the glass or plastic
through which the light travels.(ii) the cladding, which is a covering of the
core that reflects light back to the core, and the (iii) Protective coating,
which protects the fiber cable from hostile environment.
Advantages:
(a) It is immune to electrical and magnetic interference i.e., noise in any
form because the information is travelling on a modulated light beam.
(b) It is highly suitable for harsh industrial environments.
(c) it guarantees secure transmission and has a very high transmission
capacity.
(d) fiber optic cables can be used for broadband transmission where
several channels(i.e., bands of frequency) are handled in parallel and
where it is also possible to mix data transmission channels with
channels for telescope, graphics, TV and sound.
Disadvantages:
(a) Installation problem. Fiber optic cables are quite fragile and may need
special care to make them
(b) Sufficiently robust for an office environment.
44
(Class - XII: INFORMATICS PRACTICES)
45
(Class - XII: INFORMATICS PRACTICES)
Advantages:
(a) Radio-wave transmission offers mobility.
(b) It proves cheaper than digging trenches for laying cables and
maintaining repeaters and cables if cables get broken by a variety of
causes.
(c) It offers freedom from land acquisition rights that are required for
laying, repairing the cables.
(d) It offers ease of communication over difficult terrain.
Disadvantages:
(a) Radio-wave communication is an insecure communication.
(b) Radio-wave propagation is susceptable to weather effects like rains,
thunder storms etc.
(vi) Satellite: Satellite communication use the synchronous satellite to relay the
radio signal transmitted from ground station. Satellite and microwave
communications network features the time saving, fast-implementation and
broad coverage characteristics. It provides voice, fax, data and video
services as well as email, file transfer, WWW internet applications.
Advantages:
(a) The area coverage through satellite transmission is quite large
(b) The laying and maintenance of intercontinental cable is difficult and
expensive and this is where the satellite proves to be the alternative.
(c) The heavy usage of intercontinental traffic makes the satellite
commercial attractive.
(d) Satellites can cover large areas of the Earth. This is particularly useful
for sparsely populated areas.
Disadvantages:
(a) Technological limitations preventing the deployment of large, high
gain antennas on the satellite platform.
(b) Over-crowding of available bandwidths due to low antenna gains.
(c) The high investment cost and insurance cost associated with
significant probability of failure.
(d) High atmospheric losses above 30 Ghz. limit carrier frequencies.
DATA COMMUNICATION TECHNOLOGIES
(i) Data Channel: A channel is the medium used to carry information or data
from one point to another.
(ii) BAUD: It is the unit of measurement for the information carrying capacity
of a communication channel.
(iii) BITS PER SECOND (bps): It refers to the speed at which data transfer is
measured. Byte per second are denoted as Bps-
46
(Class - XII: INFORMATICS PRACTICES)
(a) The rate of a thousand bits per second is known as kbps i.e., kilo bits
per second.
(b) A rate of a thousand bytes per second is denoted by Kbps (Kilo
bytes per second).
(c) A rate of a million bits per second is denoted through mbps- mega
bits per second.
(d) A rate of a million bytes per second is denoted as Mbps.
(iv) BANDWIDTH: The bandwidth refers to the difference between the highest
and lowest frequencies of a transmission channel. Bandwidth is used to
mean the amount of information traveling through a single channel at any
one point of time. High bandwidth channels are called
broadband channels and low bandwidth channels are called narrowband
channels. Bandwidth is directly proportional to the amount of data
transmitted or received per unit time.
(v) DATA TRANSFER RATES:
The data transfer rate represents the amount of data transferred per second
a communications channel or a computing or storage device. Data rate is
measured in units of bits per second (bps), bytes per second (Bps) or
baud.
6. TYPES OF NETWORKS
Networks are classified on the basis of geographical spread and on this basis, there
can be three types of networks:
Local Area Networks (LANs)
Wide Area Networks (WANs)
Metropolitan Area Networks (MANs)
(i) Local Area Network (LAN) Small computer networks that are confined to
a localised area (e.g., an office, a building or a factory) are known as Local
Area Networks(LANs). The key purpose of a LAN is to serve its users in
resource sharing, hardware as well as software resources. In a typical LAN
configuration, one computer is designated as the file server. It stores all of
the software that controls the network, as well as the software that can be
shared by the computers attached to the network. Computers connected to
the file server are called Workstations. Cables are used to connect the
network interface cards in each computer.
(ii) Metropolitan Area Network(MAN) Metropolitan Area Networks are the
networks spread over a city. For e.g., cable TV network that are spread over
a city, can be termed as metropolitan area networks. The purpose of a MAN
is also the sharing of hardware and software resources among its users.
(iii) Wide Area Networks (WAN) The networks spread across countries are
known as WANs. A Wide Area Network(WAN) is a group of computers that
are separated by large distances and tied together. It can even be a group of
47
(Class - XII: INFORMATICS PRACTICES)
LANs that are spread across several locations and connected together to
look like one big LAN. The WANs link computers to facilities fast and
efficient exchange of information at lesser costs and higher speeds. The
largest WAN in existence is the Internet.
Difference between a LAN and a WAN
LAN WAN
(i) Diameter of not more than a few kilometers (i) Span entire countries.
(ii) A total data rate of at least several Mbps. (ii) Data rate less than 1
Mbps
(iii) Complete ownership by a single organisation. (iii) Owned by multiple
organisation.
(iv) Very low error rates. (iv) Comparatively higher
error rates.
7. NETWORK TOPOLOGIES
The pattern of interconnection of nodes in a network is called the TOPOLOGY.
Point-to-Point Link
Refer to Fig. below a P-P(Point-to-Point) link basically relies upon two
functions-transmit and receive. The main characteristic of P-P network is that
each station receives exactly from one transmitter, and each transmitter
transmits to exactly one receiver. The transmit and receive operations can occur
over separate wires or they can take turns over the same wire using a variety of
techniques.
Transmit Receive
X Y
Receive Transmit
48
(Class - XII: INFORMATICS PRACTICES)
(b) Centralized control/problem diagnosis: The fact that the central node
is connected directly to every other node in the network means that
faults are easily detected and isolated. It is simple to disconnect failing
nodes from the system.
(c) Simple access protocols.
Disadvantages of the Star Topology
(a) Long cable length: Because each node is directly connected to the
center, the star topology necessitates a large quantity of cable. Whilst
the cost of cable is often small, congestion in cable ducts and
maintenance and installation problem can increase cost considerably
(b) Difficult to expand: The addition of a new node to a star network
involves connections all the way to the central node.
(c) Central node dependency: If the central node in a star network fails,
the entire network is rendered inoperable. Thus heavy reliability and
redundancy constraints on this no
(ii) THE BUS OR LINEAR TOPOLOGY: This consists of a single length of
the transmission medium (normally coaxial cable) onto which the various
nodes are attached. The transmission from any station travels the length of
the bus, in both directions, and can be received by all other stations. The bus
has terminators at either end which absorb the signal and removes it from
the bus. Data is transmitted in small blocks, known as packets. Each packet
has some data bits, plus a header containing its destination address. A
station wanting to transmit some data sends it in packets along the bus. The
destination device, on identifying the address on the packets, copies the data
onto its disk.
Advantages of the Linear Topology:
(a) Short cable length and simple wiring layout: Because there is a
single common data path connecting all nodes, the linear topology
allows a very short cable length to be used. Resilient Architecture:
The LINEAR architecture has an inherent simplicity that makes it
very reliable from a hardware point of view. There is a single cable
through which all the data propagates and to which all nodes are
connected.
(b) Easy to extent: Additional nodes can be connected to an existing
bus network at any point along its length.
Disadvantages of the Linear Topology:
Fault diagnosis is difficult: Control of the network is not centralized in
any particular node. This means that detection of a fault may have to be
performed from many points in the network.
(a) Fault isolation is difficult: If a node is faulty on the bus, it must be
rectified at the point where the node is connected to the network.
(b) Repeater configuration:
49
(Class - XII: INFORMATICS PRACTICES)
50
(Class - XII: INFORMATICS PRACTICES)
8. NETWORK DEVICES:
(i) MODEM: A modem is a computer peripheral that allows you to connect and
communicate with other computers via telephone lines because ordinary
telephone lines cannot carry digit information, a modem changes the digital
data from your computer into analog data, a format that can be carried by
telephone lines. In a similar manner, the modem receiving the call then
changes the analog signal back into digital data that the computer can digest.
called modulation/demodulation, this transformation of signals is how the
modem received its name. (Modulation is the process of sending data on a
wave, 3 types of modulation techniques are used: AM (Amplitude
Modulation), FM(Frequency Modulation), PM(Phase Modulation))
(ii) RJ-45: RJ-45 is short for Registered Jack-45. RJ-45is an eight-wire
connector, which is commonly used to connect computers on the local area
networks i.e., LANs especially Ethernet. The RJ-45 connector look very
much similar to standard telephone connector (RJ- 11 connector), but it is
wider than RJ-11 as it houses eight wires instead of four.
(iii) Ethernet Card: Ethernet is a LAN architecture developed by Xerox Corp
in association with DEC and Intel .Ethernet uses bus or star topologies and
can support data transfer rates of up to 10 Mbps. The computers that are
part of Ethernet, have to install a special card called Ethernet Card.
(iv) Hub: A hub is a hardware device used to connect several computers
together. A hub contains multiple independent but connected modules of
network and inter- networked equipment. Active hubs electrically amplify
the signal as it moves from one connected device to another. Passive hubs
allow the signal to pass from one computer to another without any change.
(v) Switch: A switch is a device that is used to segment networks into different
subnetworks called subnets or LAN segments. Segmenting the network into
smaller subnets prevents traffic overloading in a network. A switch is
responsible for filtering i.e., transforming data in a specific way and for
forwarding packets(a piece of message being transmitted) between LAN
segments.
(vi) Repeater: A repeater is a device that amplifies a signal being transmitted on
the network. Over distance, the cables connecting a network lose the signal
transmitted. If the signal degrades too much, it fails to reach the destination.
Or if it does arrive, the degradation of the message makes it useless.
Repeaters can be installed along the way to ensure that data packets reach
their destination.
(vii) Bridges: A BRIDGE is a network device that establishes an intelligent
connection between two local networks with the same standard but with
different types of cables.
(viii) Gateway: A Gateway is a network device that connects dissimilar
networks. It establishes an intelligent connection between a local network
and external networks with completely different structures.
51
(Class - XII: INFORMATICS PRACTICES)
10 COMMUNICATION PROTOCOLS
A PROTOCOL is a format description of message formats and the rules that two
or more machines must follow to exchange those messages. Protocol defines
standardized formats for data packets, techniques for detecting and correcting
errors and so on.
(i) HTTP(Hypertext Transfer Protocol)
The HTTP protocol consists of two fairly distinct items: the set of requests
from browsers to servers and the set of responses going back to the other
way.
(ii) FTP(File Transfer Protocol) : This protocol is mainly concerned with
transfer of file.
FTP offers these advantages:
(a) It is very useful to transfer files from one network in an organization to
another.
(b) It is an effective way to get a geographically dispersed group to co-
operate on a project.
(c) It is potent and popular way to share information over the internet.
(iii) TCP/IP(Transmission Control Protocol/Internet Protocol)
TCP/IP is a layered set of protocols. TCP/IP model assumes that there are a
large number of independent networks connected together by gateways. The
user should be able to access computers or other resources on any of these
networks.
(iv) SLIP/PPP: Slip(Serial Line Internet Protocol), PPP(Point to Point
Protocol)
PPP is the Internet Standard for transmission of IP packets over serial lines.
The Point-to- Point
(a) Protocol(PPP), is currently the best solution for dial-up Internet
connections, including ISDN.
11 INTERNETWORKING TERMS AND CONCEPTS
(i) WWW (World Wide Web): The world wide web (WWW) is a set of
protocols that allows you to access any document on the Net through a
naming system based on URLs. WWW also specifies a way- the hypertext
Transfer protocol(HTTP) – to request and send a document over the
internet. URL mean Uniform Resource locator.
WWW Attributes
(a) User Friendly
(b) Multimedia Documents: Information on the Web, which may be
graphics, audio, video, animations and text is viewed in pages. A Web
52
(Class - XII: INFORMATICS PRACTICES)
page is a document on the Internet that can contain text plus any of
these multimedia elements.
(c) Hypertext and Hyperlinks: A hypertext file is a document that can
incorporate text, graphic images, audio and video tracks, and most
importantly, dynamic links to relates files or documents, even on net.
These dynamic links are called hyperlinks.
(ii) Telnet: It is an Internet utility that lets you log onto remote computer
systems.
(iii) Web Browser and Web Server: A Web Browser is a WWW client that
navigates through the World Wide Web and displays web pages. A Web
Server is a WWW server that responds to the requests made by web
browsers.
(iv) Web Sites, Web Addresses and Web Pages: A location on a net server
is called a web site. Each web site has a unique address called URL(Uniform
Resources Locator).
(v) URL and Domain Names: The Internet structure of the World Wide Web
is built on a set of rules called Hypertext Transfer Protocol(HTTP) and a
page description language called Hypertext Markup Language(HTML).
HTTP uses Internet address in a special format called a Uniform Resource
Locator or URL.
Syntax Elements of URLs
URL(Uniform Resource Locator) is an address of a file on Internet. A file‟s
Internet address or URL is determined by:
The type of server or protocol
The name/address of the server on the Internet
The location of the file on the server( this location may be related as
“path” through the file hierarchy)
The naming scheme by which servers are identified is also known as domain
name system.
DEF: A URL (Uniform Resource Locator) specifies the distinct
address for each resource on the Internet. An Internet address
which is character based is called a Domain Name.
Web Page: The document residing on web sites are called web pages.
The web pages use HTTP.
(a) Home Page. It is the top-level web page of a web site. When a web-
site is opened, its home page is displayed.
(b) Web portal. It is a web site, which hosts other web sites. In other
words. A web portal has hyper links to many other web sites. By
53
(Class - XII: INFORMATICS PRACTICES)
clicking upon these links the corresponding web sites can be opened.
www.yahoo.com is an example of web portal. Other examples are:-
www.indiatimes.com , www.khoj.com etc.
HTML provides many layout commands, called tags that let you control
the presentation of information on web pages. For example, there are tags
for various types of headings, lines, image alignment, paragraph alignment,
hyper linking etc.
(viii) XML (extensible Markup Language)
XML is a markup language for documents containing structured
information. Structured information contains both content (words, pictures,
etc.) and some indication of what role that content plays (for example,
content in a section heading has a different meaning from content in a
footnote, which means something different than content in a figure caption
or content in a database table, etc.).
(ix) DHTML (Dynamic HTML)
DHTML refers to Web contents that changes each time it is viewed.
“Dynamic HTML” is typically used to describe the combination of HTML,
style sheets and scripts that allows documents to be animated. Dynamic
HTML allows a web page to change after it‟s loaded into the browser- there
doesn‟t have to be any communication with the web server for an update.
You can think of it as „animated‟ HTML.. for example, a piece of text can
change from one size or color to another, or a graphic can move from one
location to another, in response to some kind of user action, such as clicking
a button.
54
(Class - XII: INFORMATICS PRACTICES)
12 NETWORK SECURITY
The problems encounter under network security can be summarized as follows:
(i) Physical Security holes: When individuals gain unauthorized physical access
to a computer and temper with files. Hackers do it by guessing passwords of
various users and then gaining access to the network systems.
(ii) Software security holes: When badly written programs or „privileged‟
software are compromised into doing things that they should not be doing.
(iii) Inconsistent Usage holes: When a system administrator assembles a
combination of hardware and software such that the system is seriously
flawed from a security point of view.
Protection Methods:
(a) Authorization: determines whether the service provider has granted
access to the web service to the requestor. Basically, authorization
confirms the service requestor‟s credentials. Authorization is
performed by asking the user a legal login-id.
(b) Authentication: ensures that each entity involves in using a web
service- the requestor, the provider, and the broker-is what it actually
claims to be. Authentication involves accepting credentials from the
entity and validating then against an authority.
(c) Authentication is also termed as password-protection, authorized
user is asked to provide a valid password, and if he/she is considered
to be an authentic user.
(d) Encrypted Smart Cards: Passwords in a remote log-in session
generally pass over the network in unencrypted form, any hacker(or
cracker) can simply record it and can use it later maliciously to corrupt
data/files or to harm anyone etc. To counter such threats, encrypted
smart cards are used.
(e) Biometric systems. The biometric systems involve some unique
aspect of a person‟s body such as finger-prints, retinal patterns etc. to
establish his/her identity.
(f) Firewall. A system designed to prevent unauthorized access to or
from a private network is called Firewall. Firewalls can be
implemented in both hardware and software, or a combination of
both. Firewalls are frequently used to prevent unauthorized Internet
users from accessing private networks connected to the Internet,
especially intranets. All messages entering or leaving the intranet pass
through the firewall, which examines each message and blocks those
that do not meet the specified security criteria.
There are several types of firewall techniques:
Packet filter: looks as each packet entering or leaving the
network and accepts or rejects it based on user-defined rules.
55
(Class - XII: INFORMATICS PRACTICES)
56
(Class - XII: INFORMATICS PRACTICES)
JOINS
=================================== ==========
A join is a query that combines rows from two or more tables1. In a join-query, more than
one table is listed in FROM clause. The function of combining data from multiple tables is
called joining. Consider the following query:
SELECT *
FROM EMP, DEPT;
This query will give you the Cartesian product i.e., all possible concatenations are formed
of all rows of both the tables EMP and DEPT. That is, when no particular rows (using
WHERE clause) and columns (through SELECT list) are selected. Such an operation is
also known as unrestricted join. It returns n1 × n2 rows where n1 is number of rows in
first table and n2 is number of rows in second table.
In unrestricted join or Cartesian product of two tables, all possible concatenations are
formed of all rows of both the tables.
DEF. A join is a query that combines rows from two or more tables.
But joining is not this at all. It is much more useful in many situations where we need to
derive data from more than one table. Consider the following example.
Looking at the EMP table we can see that we have a column called DEPTNO. Suppose
we also have a table called DEPT (which indeed is available in the sample database
provided by Oracle), which carries attributes such as department number, department
name, and location of the department.
By reviewing the EMP table below we can see that „CLARK‟ works in department 10 but
the location of that department is not contained within this table.
…………………………………………………………………………………………………..
57
(Class - XII: INFORMATICS PRACTICES)
1. A join can combine views also. A view is a stored query that appears like a table
and can be used like a table.
Table 17.1 : EMP
EmpNo EmpName Job Mgr Hiredate Sal Comm Dept
No. SEL
7839 KING PRESIDENT 17-NOV-81 5000 10 EC
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30 T st
7782 CLARK MANAGER 7839 09-JUN-81 2450 10 ate
7566 JONES MANAGER 7839 02-APR-81 2975 20 me
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30 nts?
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30 An
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30 d th
7900 JAMES CLERK 7698 03-DEC-81 950 30 ea
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30 nsw
7902 FORD ANALYST 7566 03-DEC-81 3000 NULL er is
7369 SMITH CLERK 7902 17-DEC-80 800 NULL joi
7788 SCOTT ANALYST 7566 09-DEC-82 3000 20 n-Q
uer
7876 ADAMS CLERK 7788 12-JAN-83 1100 20
y. L
7934 MILLER CLERK 7782 23-JAN-82 1300 NULL
et u
sNow
see how we can doisthis.
the question : How do we get this information without doing two separate
Since both the EMP table and the DEPT table carry the column DEPTNO, we can join
the tables on this common column and relate rows from the DEPT table with rows in the
EMP table. In doing this, we are creating a victual table (a table created in main
memory)which contains all the attributes for rows from the DEPT table and the EMP table
where the DEPTNO is equal. The virtual table contains the following attributes: DEPTNO,
DNAME, LOC, EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM.
In ORACLE we are able to join a multitude of tables together in this fashion. Be aware
that the more tables we join, the more complicated the query becomes.
In order to find the location of the employee named CLARK; we would use the following
query.
SQL> SELECT ENAME, LOC
FROM EMP, DEPT
WHERE ENAME = „CLARK‟
AND EMP.DEPTNO = DEPT.DEPTNO; see this is join condition
And here comes your desired result:
ENAME LOC
……….. ………..
CLARK NEW YORK
58
(Class - XII: INFORMATICS PRACTICES)
The virtually joined table that we created, consists of one row that meets the specifications
of the WHERE clause (ENAME = „CLARK‟). Since we selected only ENAME and LOC
fields, only those columns were retuned. However, we can retrieve as many attributes
from each table as we need.
Thus we can say that a join is used when a SQL query requires data from more than one
table on database. Joins can compare two or more tables (or views) by specifying a
column from each, comparing the values in those columns row by row and concatenating
rows that have matching values. The FROM clause is used to specify which tables and
views have to be joined. The columns being joined must have same or comparable
datatypes.
The FROM clause lists all the tables involved and WHERE clause specifies the join.
Without a WHERE clause, each row of the first table will be joined with every row of the
second table which results in a Cartesian Product. Multiple conditions can be
incorporated in the WHERE clause using the logical operators AND, OR and NOT. And
the relational operators =, >, <, >=, <= , <> are used as join operators.
Now consider the following example.
Example1.1.Display details like department number, department name, employee
number, employee name, job, and salary. And order the rows by employee
number with department number.
Solution. SQL>SELECT EMP.DEPTNO, DNAME, EMPNO, ENAME,
JOB, SAL FROM EMP, DEPT
WHERE EMP.DEPTNO = DEPT.DEPTNO -- join on DEPTNO
ORDER BY EMP.DEPTNO, EMPNO;
The output produced by this query will be as shown below:
DEPTNO DNAME EMPNO ENAME JOB SAL
10 ACCOUNTING 7782 CLARK MANAGER 2450
10 ACCOUNTING 7839 KING PRESIDENT 5000
10 ACCOUNTING 7934 MILLER CLERK 1300
20 RESEARCH 7369 SMITH CLERK 800
20 RESEARCH 7566 JONES MANAGER 2975
20 RESEARCH 7788 SCOTT ANALYST 3000
20 RESEARCH 7876 ADAMS CLERK 1100
20 RESEARCH 7902 FORD ANALYST 3000
30 SALES 7499 ALLEN SALESMAN 1600
30 SALES 7521 WARD SALESMAN 1250
30 SALES 7654 MARTIN SALESMAN 1250
30 SALES 7698 BLAKE MANAGER 3750
30 SALES 7844 TURNER SALESMAN 1500
30 SALES 7900 JAMES CLERK 950
14 rows selected.
59
(Class - XII: INFORMATICS PRACTICES)
60
(Class - XII: INFORMATICS PRACTICES)
61
(Class - XII: INFORMATICS PRACTICES)
PR ACT I CA L FI L E Q UE ST I O N S
Q.1. Given a GUI application having a layout as shown
Print even nos and their sum
Enter n 10 inpTF
Print PrnBtn
reslbl 1 3 5 7 9 25 reslb2
Multiply 56
Divide Clear
Calculate
Enter Amount of Purchases
Discount =
Discounted price :
Number 2 8
LCM 24
Write code for the button (compute LCMBtn) to print the LCM in the label (lblLcm).
62
(Class - XII: INFORMATICS PRACTICES)
Q.5. The given form calculates the GCD(HCF) of two numbers. Write code for
the command button (cmdGcd) to print the GCD in the label (lblGcd).
G C D Calculator
Num1TF(Text field) Num 1
GCDLable(Label)
GCD
Num1TF(Text field) Num 2
GCD GCDBtn(Button)
Q.6. FRX Consultancy is registering job seekers for placement. Their basic
entry form has following features :
Name NameTF(text field)
Gender Qualification
Intermediate InterCB(Check box)
MaleRB(Radio button) Male
Graduate GradCB(Check box)
FemaleRB(Radio button) Female
Post Graduate PgtCB(Check box)
ClearBtn(Button) Clear
SubmitBtn(Button) Submit
(i) All the characters entered in text field should be converted into uppercase
characters.
(ii) When submit button SubmitBtn is clicked the following things should
happen :
(a) If checkbox PgtCB is selected checkboxes GradCB and InterCB
should also get selected.
(b) If GradCB is selected InterCB should also be selected.
(c) A message box should ClearBtn is clicked the textbox, checkboxes
and the option button should be set to Male.
Write the codes under specific events for the above requirements.
Q.7. Department of Human Resources along with Department of Higher
Education wants to conduct an online survey of school students time
spending habits and their subject choices. It will help them design a
better education policy and create better placement opportunities.
Design a GUI application for this online survey.
Q.8. A class Telcall calculates the monthly phone bill of a consumer. Some
of the members of the class are given below :
Class Name : Telcall
Data members/instance variable :
phno : phone number
name : name of consumer
63
(Class - XII: INFORMATICS PRACTICES)
64
(Class - XII: INFORMATICS PRACTICES)
Q.10.Write a method that take a number as argument and displays the sum of
all the digits in the number. For example if the argument passed is 354,
the procedure should display 12 (i.e. 3 + 5 + 4).
Implement the method through a GUI application that obtains a number
in a text field, computes the sum of its digits and displays in a label.
Q.11.Create an application that lets you enter a film’s details like name, year,
awards and nominations through a table and when the user clicks at
Add to Library button the film’s details get added to the Library table.
The library table is un-editable otherwise; the entries to it can be made
only by clicking the add to Library button.
Enter Film Details below FILMS IN MOVIE LIBRARY
Name Babel ADD Name Year Awards Nominations
Year 2006 TO The Aviator 2004 5 11
Awards 1 LIBRARY Atonement 2007 1 7
Nominations 7 Babel 2006 1 7
Q.12.Create a Java GUI application that lets you create an address book. The
details to be added in Address Book are : Name, Email ID, Phone. Add
search facility to find a column value and report it. (Refer Page no. 312)
Q.13.Assume that a bank maintains two kinds of accounts for customers, one
called as savings account and the other as current account. The savings
account provides compound interest and withdrawal facilities but not
cheque book facility. The current account provides cheque book facility
but not interest. Current account holders should also maintain a
minimum balance and if the balance falls below this level, a service
charge is imposed.
Create a class Account that stores customer name, account number and opening
balance.
From this derive the classes Current and Savings to make them more specific to
their requirements. Include necessary member functions in order to achieve the
following tasks :
(i) deposit an amount for a customer and update the balance
(ii) display the account details
(iii) compute and deposit interest
(iv) withdraw amount for a customer after checking the balance and update the
balance.
(v) check for the minimum balance (for current account holders), impose
penalty, if necessary, and update the balance.
Implement these without using any constructor.
65
(Class - XII: INFORMATICS PRACTICES)
66
(Class - XII: INFORMATICS PRACTICES)
Q.17.Design an application that accepts a string and two integers from user.
It then changes the case of characters at those indices as specified by two
integers entered by the user.
Refer to following sketch for designing interface.
Enter a string A Sample string
Submit
Output string is
A sample string
Count Occurance
CountBtn(Button) OccurLable(label)
Q.19.Write a suitable code under the command button cmdRev to reverse the
input string in text box txtIn and display it in the text box txtRev. The code
should not include the StrReverse() library function.
67
(Class - XII: INFORMATICS PRACTICES)
RevBtn(Button) Reverse
Q.20.An application changes first letter of each word in a text box to upper
case and displays the modified sentence in the same text box. Write the
suitable code under the command button CaseBtn to achieve this goal.
Palindrome Test
(label)
Q.22.Create an Edit menu with following menu control captions and its
property settings respond to the corresponding keys.
Menu Control Caption Caption Property Access Keys
Cut Cu & t t
Copy C & opy o
Paste & Paste p
Delete De & lete l
Select All Select & All a
Time / Date Time / & Date d
Q.23.Design a GUI application that first obtains Login Id and password from
the user.
(i) If the correct password (Which is “Proceed”) is entered, then a new form –
Email Form – is shown on the screen that obtains details like : From :, To:,
Subject: and Email text.
In the Email form,
(a) if user clicks at Send button then a dialog pops up saying that
“Message has been sent successfully.” And the Email Form closes.
(b) If the user clicks at Discard button then Email Form simply closes.
68
(Class - XII: INFORMATICS PRACTICES)
(ii) If the user enters incorrect password, then a dialog pops up saying that
“Invalid pass word”.
(iii) On the dialog, if the user clicks OK button, the dialog simply disappears.
Q.24.Design an application that obtains the rollnumber of a student and
searches in a list containing the details of students who have passed an
entrance exam. The details in the list are in the form <rollnumber>-
<name> and are listed rank wise. The topmost rank holder’s details are
at position 1, and the lowest rank holder’s details are at the last
position.
69
(Class - XII: INFORMATICS PRACTICES)
Q.1. Design a data connectivity application that fetches data from EMPL
table and has an interface as shown below :
70
(Class - XII: INFORMATICS PRACTICES)
W E B DE SI GN IN G
Q.1. Create a webpage that received pizza orders through a web form as
shown below :
Pizza Factory
Pizza order form
Name
Address
Size Toppings
O Small Cheese
O Medium Olives
O Large Pepperoni
Bacon
Process Order Clear
Q.2. Create a XML document to represent a quiz where each question comes
with four possible answers, but there is only one correct answer.
Render this XML-document on a web browser.
Q.3. Create an XML document to represent your marksheet.
(i) Create a stylesheet for this and open it in browser.
(ii) Try to render it in multiple ways by creating multiple stylesheets.
(iii) Check whether your XML-document is well-formed and valid or not.
71
(Class - XII: INFORMATICS PRACTICES)
SQL
Q.1.
Table: HOSPITAL
NO NAME AGE D_CODE DATOFADM CHARGES SE X
1 Sandeep 65 D101 23-Feb-2006 300 M
2 Ravina 24 D105 20-Jan-2006 200 F
3 Karan 45 D105 19-Feb-2006 200 M
4 Tarun 12 D101 01-Jan-2006 300 M
5 Zubin 36 D108 12-Jan-2006 250 M
6 Ketaki 16 D108 24-Feb-2006 300 F
7 Ankita 29 D120 20-Feb-2006 800 F
8 Zareen 45 D115 22-Feb-2006 300 F
9 Kush 19 D120 13-Jan-2006 800 M
10 Shailya 31 D125 19-Feb-2006 400 F
Table : DEPARTMENT
D_CODE DEPARTMENT DOCTOR
D101 Surgery Dr.D.Nayar
D105 Orthopedic Dr.M.Roy
D108 ENT Dr.K.Bhatia
D115 Gynecology Dr.P.Tejpal
D120 Cardiology Dr.D.Singh
D125 Nuclear Medicine Dr.A.Banerjee
72
(Class - XII: INFORMATICS PRACTICES)
Q.2.
Table: INTERIORS
NO ITEMNAME TYPE DATEOFSTOCK PRICE DISCOUNT
1 Red rose Double Bed 23-Feb-2006 32000 15
2 Soft touch Baby cot 20-Jan-2006 9000 10
3 Jerry‟s home Baby cot 19-Feb-2006 8500 10
4 Rough woof Office table 01-Jan-2006 20000 20
5 Comfort zone Double bed 12-Jan-2006 15000 20
6 Jerry look Baby cot 24-Feb-2006 7000 19
7 Lion king Office table 20-Feb-2006 16000 20
8 Royal tiger Sofa 22-Feb-2006 30000 25
9 Park sitting Sofa 13-Dec-2005 9000 15
10 Dine Paradise Dining Table 19-Feb-2006 11000 15
(i) To show all information about the Sofa‟s from the interiors table.
(ii) To list the item name which are priced at more than 10000 from the interiors
table?
(iii) To display item name and date of stock of those items, in which the discount
(iv) Percentage is more than 15 from interiors table.
(v) To list item name and type of items, in which data of stock is before 22-Jan-
2002
(vi) from the interiors table in descending order of item name.
(vii) To count the number of items of each type from interiors table.
(viii) To insert new row in interiors table with following data:
11 White wood Double Bed 23-Feb-2006 20000 20
(ix) To count distinct types from interiors table.
(x) To find average discount from interiors for each type of interiors.
(xi) To calculate sum of price from interiors where data of stock is before 12-
Feb-2002
(xii) To increase price of all Office table by 3000 from interiors table.
Q.3.
Table : GAMES
GCO D E GAMENAME NUMBER PRIZEMONEY SCHEDULEDATE
101 Carom Board 2 5000 23-Jan-2006
102 Badminton 2 12000 12-Dec-2005
103 Table Tennis 4 8000 14-Feb-2006
105 Chess 2 9000 01-Jan-2006
108 Lawn Tennis 4 25000 19-Nov-2005
73
(Class - XII: INFORMATICS PRACTICES)
Table : PLAYER
PCODE NAME GCO D E
1 Nabi Ahmad 101
2 Ravi Sahai 108
3 Jatin 101
4 Nazneen 103
(i) To display the names of all games where schedule data is after 31-Dec-
2005.
(ii) To display the name of the players in the table player with their
gamesname.
(iii) To display the content of the games table in ascending order of schedule
date.
(iv) To display the sum of prize money received by players in the table player.
(v) To add a new column (attribute) ADDRESS of type Character(20) in the
table
(vi) PLAYER.
(vii) To display maximum and minimum schedule date.
(viii) To change the prize money for Chess from 9000 to 10000.
(ix) To display unique gcodes from players.
(x) To delete all rows from games table where schedule date was before 01-Jan-
2006.
(xi) To insert a new record in the player table as follows:
5 Anand 105
Q.4.
Table STOCK
NO ITEMCODE QUANTITY DATEOFPURCHASE WARRANTY
1 C201 9 21-May-2005 2
2 P1010 3 21-May-2005 4
3 S203 1 29-Sep-2004 3
4 C201 2 13-Jun-2005 1
5 P1010 1 31-Oct-2004 2
6 U34 5 21-May-2005 1
7 P1010 2 11-Jan-2006 2
Table: ITEM
ITEMCODE ITEMNAME PRICE
C201 Computer 39000
P1010 Printer 11000
S203 Scanner 4500
WC05 Camera 1200
U34 UPS 1900
74
(Class - XII: INFORMATICS PRACTICES)
75
(Class - XII: INFORMATICS PRACTICES)
76
(Class - XII: INFORMATICS PRACTICES)
(i) Write the code to disable the text boxes txtLPrice, txtDisccount and
txtNPrice in the form when the form activated.
(ii) Write the code for List Price button (cmdList) to display the List Price in
txtLPrice.
(iii) Write the code for Discount Price button (cmdDisc) to calculate discount
price in txtDiscount.
(iv) Write the code for Net Price button (cmdNet) to calculate the net price in
txtNPrice.
(v) Write the code for cmdExit to exit the application.
77
(Class - XII: INFORMATICS PRACTICES)
SOLUTION
(i) Right click on form IntCalUI. Select Events >> WindowFocus>>
windGained focused. Notice that a formWindowGainedFocus event handler
appears with a // TODO marker line. Write the following lines,
txtLPrice.enable(false);
txtDiscout.enable(false);
txtNPrice.enable(false);
(ii) Double click on the List Price button. Notice that a cmdListActionPerformed
event handler appears with a // TODO marker line. Write the following lines,
String Product=cmbProduct.getSelectedItem().toString();
If (Product.equals(“Washing Machine”)){
txtLPrice.setText(“12000”);
} else if (Product.equals(“Color Television”)) {
txtLPrice.setText(“17000”);
} else if (Products.equals(“refrigerator”)) {
txtLPrice.setText(“18000”);
} else if (Product.equals(“OTG)){
txtLPrice.setText(“8000”);
} else if (Product.equals(“CD Player”)) {
txtLPrice.setText(“14500”);
}
(iii) Double click on the Discount Price button. Notice that a
cmdDiscActionPerformed event handler appears with a // TODO
marker line. Write the following lines,
float ProductPrice, Discount;
ProductPrice = Float.parseFloat(txtLPrice.getText());
// Calculating Discount Price
If ( optFest.is Selected()){
Discount = ProductPrice * 7/100;
} else {
Discount = ProductPrice *10/100;
}
txtDiscount.setText( Float.toString( Discount));
(iv) Double click on the Net Price button. Notice that a cmdNetActionPerformed
event handler appears with a // TODO marler line. Write the following lines,
Float NetPrice;
NetPrice = Listprice-Discount
NetPrice = Float.parseFloat(txtLPrice.getText()) –
Float.parseFloat(txtDiscount.getText());
txtNPrice.setText(Float.toString(NetPrice));
78
(Class - XII: INFORMATICS PRACTICES)
Q.2. Read the following case study and answer the questions that follows :
The Pizza Café has computerized its billing. The following is the data
entry screen used at their outlet. The outlet offers two different types of
pizzas, regular and pan pizzas. The price of a regular pizza is Rs. 120
and that of a pan pizza is Rs. 160. The user can choose to have three
different types of extra toppings of he wants. Extra toppings costs as :
Toppings Cost
Cheese 40
Capsicum 20
Pepperonion 25
79
(Class - XII: INFORMATICS PRACTICES)
(i) Write the code for Calculate Rate button to calculate the rate of the pizza
and display it in txtRate depending on the type of pizza selected by the
customer.
(ii) Write the code for cmdAmount to calculate the total amount and display it in
txtAmount. The total amount is calculated by first finding the cost of extra
toppings selected by the customer. Remember that each extra toppings adds
the value with previous topping. Then add it to the rate and multiply the
resultant amount by the quantity ordered.
(iii) Write the code for Clear button to clear all the text boxes and make default
to Regular Pizza Type and Cheese as Topping.
(iv) Write the code for cmd Exit to exist the application.
SOLUTION:
(i) Double click on the Calculate Rate button. Notice that a
cmdCalcRateActionPerformed event handler appears with a // TODO
marker line. Write the following lines,
If ( optRegular.isSelected())
txtRate.setText(String.valueof(120)); // String.valueOf convert integer to
String
else
if(optPan.isSelected())
txtRate.SetText(String.valueOf(160));
80
(Class - XII: INFORMATICS PRACTICES)
Q.3. Read the following case study and answer the questions that follow ;
Mr. Vidyarthi works in Blossoms Public School as a programmer. He is
required to develop a student record. The school offers two different
streams, medical and non-medical, with different grading criteria. The
81
(Class - XII: INFORMATICS PRACTICES)
82
(Class - XII: INFORMATICS PRACTICES)
(iii) Write the code for cmdCalcGrade to calculate the grade depending on the
stream selected according to the criteria given above.
Solution:
float per = Float.valueOf(txtPer.getText());
String gr=””;
// Medical section
if (optMed.isSelected())
{
if (per >= 80)
gr = “A”;
else
83
(Class - XII: INFORMATICS PRACTICES)
84
(Class - XII: INFORMATICS PRACTICES)
(i) Write the code to disable the text boxes txtInterest, txtAmount, txtRate and
txtDate in the form when the form activated.
(ii) Write the code for cmdClear command button to clear all the textboxes and
check box except txtDate. Set the default choice in the option button as
Fixed Deposit.
(iii) Write the code for the click event of the command button cmdCalculate to
calculate compound interest and amount and display the values in textboxes
txtInterest and txtAmount depending on the principal, rate and time
Note that the compound interest is calculates as P*(1+r/100)^T &amount
as Principal+Interest.
85
(Class - XII: INFORMATICS PRACTICES)
86
(Class - XII: INFORMATICS PRACTICES)
R = 10;
else
if ((T>1) && (T<=5))
R = 12;
else
If (T>5)
R=15;
}
Else
if ( optRD.isSelected())
{
if ((T< = 2)
R = 10;
else
if ((T>2) && (T< = 7))
R = 12;
else
if (T>7)
R = 15;
}
// If Sr, Citizen selected
if (chkSR.isSelected())
R = R + 2;
// Displaying Rate
txtRate.setText(Float.toString(R));
// pow() function calculates power of a number
CI = P * Math.pow((1 + (R/100)), T);
// Calculating total amount
Amount = P + CI;
txtInterest.setText(String.valueOf(CI));
txtAmount.setText(String.valueOf(Amount));
(iv) Double click on the Exit button. Notice that a cmdExitActionPerformed
event handler appears with a // TODO marker line. Write the following line,
System.exit(0);
Q.5. SBI HOME FINANCE revised its rate of interest for Public Deposit as
follows :
Years Cumulative Interest Annual Income Scheme
Scheme (p.a.) (Compounded Annually)
1 - 10%
2 - 10.5%
3 11.5% 11%
4 11.5% 11%
5 11.5% 11%
87
(Class - XII: INFORMATICS PRACTICES)
Solution:
(i) Double click on the JRadioButton1 button. Notice that a jRadioButton1
ActionPerformed event handler appears with a // TODO marker line. Write
the following lines,
txtY15.setText(“”);
txtY15.setEnabled(false);
txtA.setText(“”);
txtIA.setText(false);
txtIA.setEnabled(false)
jLabel3.setEnabled(false);
jLabel5.setEnabled(false);
txtCA.setEnabled(false);
txtCA.setText(“”);
txtY35.setEnabled(true);
txtY35.setText(“”);
88
(Class - XII: INFORMATICS PRACTICES)
txtY15.setEnabled(true);
(iii) Double click on the Calculate button. Notice that a btnCalcActionPerformed
event handler appears with a // TODO marker line. Write the following lines,
float P;
double A = 0, r = 0, I = 0;
int op, y, ch;
if (jRadioButton1.isSelected())
{
P = Float.parseFloat(txtAmt.getText(();
Y = Integer.parseInt(txtY35.getText());
If (( y = = 3) || ( y = = 4) || ( y = = 5))
R = 0.115;
A = P * (1 + 0.01 * r) * y;
txtCA.setText(Double.toString(A));
}
if (jRadioButton2.isSelected()) {
P = Float.parseFloat(txtAmt.getText());
Y = Integer.parseInt(txtY35.getText());
if (y = = 1)
r = 0.10;
if (y = = 2)
r = 0.105;
if (y = = 3) || (y = = 4) || (y = = 5))
r = 0.11;
I = 0.01 * P * r;
txtIA.setText(Double.toString(I));
}
Q.6. Read the following case study and answer the questions that follow:
Mr. Nath of ABC software Corporation has got requirement of a
Software Project from a customer in Tours and Travels Business. He
performed the preliminary analysis and found that software Application
should be based on Client/ Server technology. He opted for Java Swing
to develop the front end, as RAD is one of its features. We had taken
the excerpt from his analysis and presenting you one of the forms to
enquire about railway reservation. Carefully observe the following
picture.
89
(Class - XII: INFORMATICS PRACTICES)
(i) Write the code to obtain and display the value for the text property of the
Object CheckStatusBTN.
(ii) Write the code snippet for CloseMeBTN button if it is required to close the
form on its Action event.
(iii) Write the code snippet to allow the user to restrict alphabets (i.e., only
numbers allowed in the DD field.
(iv) Write the procedure to check for the validity of the entered date value. Clear
the text fields for invalid date value.
Ans.
(i) String txt = checkStatusBTN.getText() ;
system.exit(0) ;
}
if (mm = 1 || mm = 3 || mm = 5 || mm = 7 ||
90
(Class - XII: INFORMATICS PRACTICES)
mm = 8 || mm = 10 || mm = 12 ) {
if( ! (dd >0 && dd <= 31) {
JoptionPane.showMessageDialog(null, “Invalid date.”);
}
}
else if (mm = 4 || mm = 6 || mm = 9 || mm = 11) {
if (! (dd > 0 && dd <= 30) ) {
JoptionPane.showMessgeDialog(null, “Invalid date.”):
}
}
else if (mm = 2){
if(! (dd > 0 && dd <= 28) ){
JoptionPane.showMessageDialog(null, “Invalid date.”);
}
}
else
JoptionPane.showMessageDialog(null, “ Invalid date.”);
DDTF.setText(“ “);
MMTF.setText(“ “);
YYYYTF.setText(“ “);
DDTF.requestFocus();
}
Q.7. Read the following case study and answer the questions that follow :
Mr. Das is working as a Chief Information Officer in AMD
Constructions Company. In the month of January he received a
letter from the management to all his employee information in
electronic form. He decided to develop a small software application
to store employee’s personal data. He instructed one of his juniors
to make a form in Java Swing to enter employee information. The
junior presented the following form to Mr. Dass :
91
(Class - XII: INFORMATICS PRACTICES)
92
(Class - XII: INFORMATICS PRACTICES)
if (GraduateCB.is selected() ) {
IntermediateCB.setselected(true);
}
}
(iii) avoid procConveryCase() {
String name = NameTF.gertext();
NameTf.setText( name.toUpperCase() );
String fname = FatherNameTf.gerText() );
FatherNameTF.setText( fname.toUpperCase() );
String mname = MotherNameTF.getText() ;
MotherNameTF.setText( mname.toUpperCase() );
String add = AddressTF.getText();
AddresTF.setText( add.toUpperCase() );
93
(Class - XII: INFORMATICS PRACTICES)
SQL Queries
Q.1. Write the resulting output of the following :
(a) SELECT ROUND(1023.432,1);
(b) SELECT LENGTH(„RAMESH SHARMA‟);
(c) SELECT UPPER(„master);
(d) SELECT MOD(ROUND(120.60, 1) , 5);
(e) SELECT POWER( 5, 5);
(f) SELECT CEIL(120.0);
(g) SELECT CEIL(120.34);
(h) SELECT FLOOR ( 65467.8890);
(i) SELECT FLOOR(12340.0);
(j) SELECT MOD(36, 3);
(k) SELECT MOD(14*9, 90/9);
(l) SELECT ROUND(3244.1962, 1);
(m) SELECT SQRT(144);
(n) SELECT SQRT(15.6*24.3);
(o) SELECT 1000+SQRT(100);
(p) SELECT FLOOR(144.34) + 1000 + CEIL(32.23);
(q) SELECT MOD(9*5, 9)+CEIL(100.56);
(r) SELECT SQRT(15);
(s) SELECT SQRT(345) + SQRT(15);
(t) SELECT FLOOR(100.34)+ ABS(200.43);
(u) SELECT FLOOR(3456.98+CEIL(9876.89);
(v) SELECT TRIM („ ABS Public School „);
(w) SELECT LENGTH(„ABS Public School‟);
(x) SELECT LOWER ( „ABS Public School‟);
(y) SELECT SUBSTR(„ABS Public School‟,1,3);
(z) SELECT UPPER(„ABS Public School‟);
(aa) SELECT SUBSTR(TRIM(„ INDIA IS GREAT „),3,9);
Q.2. Given the following EMPLOYEE relation. Write SQL command for
question (a) to (d) and the output for (e).
TABLE : EMPLOYEE
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPT
7369 Sunita Sharma CLERK 7902 1980-12-17 2800 20
7499 Ashok Singhal SALESMAN 7698 1981-12-17 3600 300 30
7521 Rohit Rana SALESMAN 7698 1981-02-22 5250 500 30
7566 Jyoti Lamba MANAGER 7839 1981-04-02 4975 20
7654 Martin S. SALESMAN 7698 1981-09-28 6250 1400 30
7698 Binod Goel MANAGER 7839 1981-05-01 5850 30
7782 Chetan Gupta MANAGER 7839 1981-06-09 2450 10
7788 Sudhir Rawat ANALYST 7566 1987-04-19 5000 20
7839 Kavita Sharma PRESIDENT 1981-11-17 5000 10
94
(Class - XII: INFORMATICS PRACTICES)
95
(Class - XII: INFORMATICS PRACTICES)
(i) Add one column Email of data type Varchar & size 30 to the table customer.
(ii) Insert one record in customer table.
(iii) Deop the column Cust-Add2 from take customer.
(iv) Change the name of Cust-Add1 column to „Address‟.
(v) Add a unique constraint on column Phone.
Q.6. Write SQL queries for the following questions :
TABLE : EMPLOYEE
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPT
7369 Sunita Sharma CLERK 7902 1980-12-17 2800 20
7499 Ashok Singhal SALESMAN 7698 1981-12-17 3600 300 30
7521 Rohit Rana SALESMAN 7698 1981-02-22 5250 500 30
7566 Jyoti Lamba MANAGER 7839 1981-04-02 4975 20
7654 Martin S. SALESMAN 7698 1981-09-28 6250 1400 30
7698 Binod Goel MANAGER 7839 1981-05-01 5850 30
7782 Chetan Gupta MANAGER 7839 1981-06-09 2450 10
7788 Sudhir Rawat ANALYST 7566 1987-04-19 5000 20
7839 Kavita Sharma PRESIDENT 1981-11-17 5000 10
7844 Tushar Tiwari SALESMAN 7698 1981-09-08 4500 0 30
7876 Anand Rathi CLERK 7788 1987-05-23 6100 20
7900 Jagdeep Rana CLERK 7698 1981-12-03 4950 30
7902 Sumit Vats ANALYST 7566 1981-12-03 3500 3600 20
7934 Manoj Kaushik CLERK 7782 1982-01-23 5300 10
(i) To select all the columns of the above table.
(ii) To list the name and employee number from the above table.
(iii) To list all names, hiredate and salary of all employees.
(iv) To display the employee name and the incremented value of SAL as SAL
+ 300.
(v) To list the employee name and his annual salary
( Annual salary = 12*sal +100).
(vi) Display the ename and sal where comm. is NULL.
(vii) To list the distinct department number from the table.
96
(Class - XII: INFORMATICS PRACTICES)
97
(Class - XII: INFORMATICS PRACTICES)
(ii) In a database there are two tables Company and Model as shown below:
Company Model
CompID CompName CompHD ContPerson MoIdelID CompID ModelCost
1 Titan Okhla CB.Ajit T020 1 2000
2 Maxima Shahdra V.P.Kohli M032 4 2500
3 Ajanta Najafgarh R. Mehta M059 2 7000
(a) Identify the foreign key column in the table model.
(b) Check every value in CompID column of both the tables. Do you find
any discrepancy.
(iii) Consider the tables DOCTORS and PATIENTS given below :
DOCTORS
DadD DocName Department OPD Days
101 M.Pandey ENT TTS
102 G. P. Gupta Paed MWF
201 K.Sharma Ortho MWF
PATIENTS
PatNo PatName Department DodD
1 Neeraj ENT 101
2 Mohit Ortho 201
3 Ragini ENT 101
4 Mohit Paed 102
5 Nandini Ortho 201
With reference to these tables, write commands in SQL for (i) and (ii) and output
for (iii) below :
98
(Class - XII: INFORMATICS PRACTICES)
(i) Display the PatNo, PatName and corresponding DocName for each
patient.
(ii) Display the list of all patients whose OPD_Days are MWF.
(iii) Select OPD_Days, Count(*)
from doctors, Patients
where patients. Department = Doctors. Department
Group by OPD_Days ;
Ans.
(i) CREATE TABLE TEAMS
( Teamcode varchar(5) primary key,
Teamname varchar(20),
TeamLeadr varchar(20),
NootMembers int,
Team_Symbol char(1) NOT NULL );
(ii)
(a) Like CompID
(b) In the 2nd row of Model table the value of CompID is 4. This
CompID does not exist in the table company.
(iii)
(a) SELECT PatNo, PatName, DocName
FROM Patients, doctors
WHERE Patients.DocID = Doctors.DocID
99
(Class - XII: INFORMATICS PRACTICES)
Now all these steps together make a logical unit of work and hence,
are together known as a transaction. MySQL treats a transaction as
a single entity. In case of successful termination of a transaction
(when all the steps are carried out successfully); the changes are
mage permanent through COMMIT. And in case of unsuccessful
termination, changes are undone with ROLLBACK statement.
Q.3. Answer the following queries based on EMP, DEPT and SALGRADE
tables of MySQL database :
Structures of these tables are given below :
emp (empno, ename, job, mgr, hiredate, sal, comm., deptno )
Dept (Deptno, dname, loc)
SalGrade (grade, losal, hisal)
(i) Practice – Restricting and Sorting Data
(a) Create a query to display the name and salary of employees earning
more than Rs. 2850.
(b) Create a query to display the employee name and department
number for employee number 7566.
(c) Display the employee name, job and start date of employees hired
between February 20,1991 and May 1,1991. Order the query in
ascending order of start date.
(d) Display the employee name and department number for all
employees in departments 10 and 30 in alphabetical order by name.
(e) List the name and salary of employees who earn more than Rs. 1500
and are in department 10 or 30. Label the columns Employee and
Monthly Salary, respectively.
(f) Display the name and hiredate of every employee who was hired
in1982.
(g) Display the name, job and salary for all employees whose job is Clerk
or Analyst and their salary is not equal to Rs. 1000, Rs. 3000 or Rs.
5000.
(h) Display name, salary and commission for all employees whose
commission amount is greater than their salary increased by 10%.
(ii) Practice –single-Row Functions
(a) Display the employee number, name, salary and salary increase by
15% expressed as a whole number. Label the column New Salary.
(b) Add an additional column that will subtract the old salary from the
new salary. Label the column Increase.
(c) For each employee display the employee name and calculate the
number of months between today and the date the employee was
hired. Label the column MONTHS_WORKED. Order the results by
100
(Class - XII: INFORMATICS PRACTICES)
101
(Class - XII: INFORMATICS PRACTICES)
MONTHS_WORKED”
FROM Emp
ORDER BY 2 ;
102
(Class - XII: INFORMATICS PRACTICES)
103
(Class - XII: INFORMATICS PRACTICES)
104
(Class - XII: INFORMATICS PRACTICES)
Substr(COACHNAME, ( 1, 2)
(c) (d)
POWER (3, 2) KA
9 KE
9 AN
9 ZA
SH
(e)
(i) 4
(ii) 34
(iii) 1100.0000
(iv) NULL
105
(Class - XII: INFORMATICS PRACTICES)
Q.2. Draw an entity relationship diagram to illustrate the case given below :
In a certain education institution, various student are taught by various
teachers. Each student has a student_id, name stream. A stream must
have at least one stream name and a stream code allocated to it, and
address, which further has got its own attributes like house no.,
pincode, area and state. Every Teacher must have a name, Teacher_id,
address again having specific attributes of it. Many teachers can belong
to one department.
Ans.
Teacher-id name Stud-id name
Department Stream
adress
Q.3.
(i) How does e-business improve customer satisfaction? Write one point.
(ii) How has our society benefited from e-governance? Write two points.
(iii) Vijayan works for the Customs Department. He wishes to create controls on
a form for the following functions. Choose appropriate controls from Text
field, Label, Option button, Check box, List box, Combo box, Button and write in
the third column.
S.No Control used to Control
1. Enter last name
2. Enter Gender
3. Choose City from a list of cities
4. Submit Form
Ans.
(i) Following points depict how e-business improves customer satisfaction :
106
(Class - XII: INFORMATICS PRACTICES)
(a) Goods sold through e-business are generally cheaper as cost incurred
in e-business is less compared to setting up a traditional business.
(b) Customers can receive highly customizable service.
(c) Even Remote area customers are reached in e-business.
107
(Class - XII: INFORMATICS PRACTICES)
108
(Class - XII: INFORMATICS PRACTICES)
Lambda
Beta
(ii) In both the layouts, a hub/switch each would be needed in all the
buildings, to interconnect the group of cables from the different computers in
each building.
Layout 1
Repeater
Lambda
Beta Hub
Hub
Layout 2
Repeater
Lambda
Beta
Hub
Hub
(d) The most economic way to connect it with a reasonable high speed would be to
use radio wave transmission, as they are easy to install, can travel long distances, and
penetrate buildings easily, so they are widely used for communication, both indoors
and outdoors. Radio waves also have the advantage of being omni directional, which
is they can travel in all the directions from the source, so that the transmitter and
receiver do not have to be carefully aligned physically.
109
(Class - XII: INFORMATICS PRACTICES)
Q.2. Lavanya Industries has set up its new center at Hari Om Nagar for
its office and web based activities. The company compound ha 4
buildings as shown in the diagram below :
Rudra Xavier
Building Building
Satnam
Building
Mohan
Building
Mohan Satnam
Building Building
110
(Class - XII: INFORMATICS PRACTICES)
(ii) Layout 2 : Since the distance between Xavier Building and Satnam
Building is quite short, following layout may also be considered :
Rudra Satnam
Building Building
Satnam
Building
Mohan
Building
(iii) The most suitable place/ building to house the server of this
organization would be Rudra building, as this building contains the
maximum number of computers, thus decreasing the cabling cost for
most of the computers as well as increasing the efficiency of the
maximum computers in the network.
(a) Rudra building
(b) In both the layouts, a hub/switch each would be needed in all the
buildings, to interconnect the group of cables from the different
computers in each building.
(iv) The type of network that shall be formed to link the sale counters
situated in various parts of the same city would be a MAN, because ,
MAN (Metropolitan Area Networks ar the networks) are the networks
that link computer facilities within a city.
Q.3. Lantastic Corporation caters to many high profile clients and has 6
buildings where it runs its operations (shown below)
50 mts
[55] Pro
35 mts
45 mts 65 mts
120 mts 30 mts
Robo Master
40 mts
[55] [70]
111
(Class - XII: INFORMATICS PRACTICES)
50 mts
[55] Pro
35 mts
45 mts 65 mts
120 mts 30 mts
Robo Master
40 mts
[55] [70]
(Total cable length required to connect buildings through this layout = 190 mts)
50 mts
[55]
Pro
35 mts
45 mts 65 mts
120 mts 30 mts
Robo Master
40 mts
[55] [70]
112
(Class - XII: INFORMATICS PRACTICES)
A.5. Any comp on a n/w & is seeking to share the resources of the network is
a workstation and any computer that facilitates the sharing of data, s/w ,
network resources on the network is a server.
Q.6. Define.
A.6. MAC address : It refers to physical address assigned by NIC
manufacturing
10:B5:03 : 63:2E:FC ( 6 digits no.)
Manufacturing- ID Card-no.
WS WS
WS WS SERVER
WS WS
WS WS
WS WS
SERVER
ws ws
ws ws ws ws
ws ws ws ws ws
Q.8. Define .
A.8. Hub : Hub is n/w device used to connect several Computers together.
(Active and Passive hubs)
Switch : Switch is used to segment n/w into different subnets.
113
(Class - XII: INFORMATICS PRACTICES)
(a) intval*longval – ch
114
(Class - XII: INFORMATICS PRACTICES)
int long ch
long
long
(b) fl +Longval/sh
Ans : float.
(iv) Rewrite using Switch :
(v) What will be the value of sum after the following code is executed.
(a) Sum = 20 (b) Sum =20
opt = 5 opt = 5
Sum = Sum + (opt++); Sum = Sum +(+ + opt);
Sum = 25 Sum = 26
(vii) What value will be stored in different variable when the following Java code
is executed.
115
(Class - XII: INFORMATICS PRACTICES)
int i = 10 O/PI
int j, k, l, m, n; 10 15 13 14 5 83
J=i+5
K = i + j/5
L = K+1;
m = L + 1 – i;
n=k+m *L
S.O.P( i +”\n” + j =
m+k+”/n”+l = n)
int i, j, n; o/p
n=0;i=1
do { n + + ; no o/p
i ++; because
S.O.P ( i , n); no S.O.P
} statement
While ( i< = 5);
116
(Class - XII: INFORMATICS PRACTICES)
1 int i, j;
2 2 for ( i = 1; i < = 4; i + + ) {
3 3 3 for (j = 1; j< = i; j + +)
4 4 4 4 S.O.Print( “ “ + i );
S.O.Print in ( );
}
117
(Class - XII: INFORMATICS PRACTICES)
Q.15. Inheritance.
Q: What is method overloading and method overriding.
A: A function which has same name but different method signatures is
called as Overloaded bus. A fx. In child class which has same method
name and signature as that of parent class, hides the parent class fx.
This is called as method overriding.
118
(Class - XII: INFORMATICS PRACTICES)
ANS.
119
(Class - XII: INFORMATICS PRACTICES)
WELCOME TO INDIA
________________________________________________________________
Welcome to India, a natural beautiful country in every season
NIRVANA HOLIDAYS LTD. is a tour operating agency that
arranges Sightseeing Tours Packages and Overland program
that have been creatively designed ofeering experiences of high
value.
We offer the following packages
1. Rajasthan Package
Jaipur
Udaipur
Pushkar
2. Kerala Package
Kumarokom Resort
Periyar Wildlife Sanctuary
Lovalam Beach
TARRIF
Package Normal Deluxe
Rajasthan ` 7,000 ` 10,500
Kerala ` 11,500 ` 18,000
_____________________________________________________________________________
For enquiries Mail to us
(i) Submit and Reset buttons of HTML form ar special buttons which
have a traditional purpose to serve
(a) When submit button is clicked then forms data is submitted to the
back-end application
(b) When Reset button is clicked then all forms controls are reset to
default state.
(ii) <FORM action = mailto:mymail@emailaccount.com method =
“post”>
(iii)
<HTML>
<HEAD>
<TITLE>Welcome to India</TITLE>
</HEAD>
<BODYbgcolor = “Pink” vlink = “Green”>
<FONT face = “Arial” color = “Maroon”>
<H3 align = “center”>WELCOME TO INDIA
</H3></FONT>
<FONT face = “Arial”>
120
(Class - XII: INFORMATICS PRACTICES)
<HR>
<IMG src = “map.jpg” align = “left” height = 90 width =90>
welcome to India, a natural beautiful country in every season.
<FONT color = “red”> <b>NIRVANA HOLIDAYS LTD.</B></FONT>
is a tour operating agency that arranges sightseeing Tour Packages and overland
program that have been creatively designed offering experiences o f high value.
<P>
We offer the following packages
<OL>
<li><A href = “raj.html”>Rajasthan Package</A>
<UL type = “disc”>
<li>Jaipur
<li>Udaipur
<li>Pushkar
</UL>
<li><A href = “Kerala.html”>kerala Packages</A>
<UL type = “circle”>
<li>Kumarokom Resort
<li>Periyar Wildlife Sanctuary
<li>Lovalam Beach
</ul>
<OL>
<TABLE border = 2 align = “center”>
<CAPTION> Tarrif </CAPTION>
<TR >
<TH> Package</TH>
<TH> Normal</TH>
<TH> Deluxe</TH>
</TR>
<TR >
<TD>Rajasthan</TD>
<TD>Rs. 7000</TD>
<TD>Rs. 10,500</TD>
</TR>
<TR >
<TD>Kerala</TD>
<TD>Rs. 11,500</TD>
<TD>Rs. 18,000</TD>
</TR>
<TABLE></FONT>
<HR>
<FONT size = 3><P align = “center”>
For enquiries <A href = « feedback@welcome.com »>Mail to us
</A>
121
(Class - XII: INFORMATICS PRACTICES)
<FONT>
</BODY>
</HTML>
Q.17.Questions given below are based on HTML :
(i) What is the difference between the <FRAME> and <FRAMESET> tags?
(ii) Specify the tag and attributes to create a TextArea with 5 rows and 20
columns.
(iii) Write the HTML code to generate web page in the format given below :
Hospitality Industry
________________________________________________________________
One of the industries which is on the path of rapid growth is the hospitality
industry.
The Hotels today aims to provide the highest standard of accommodation,
Facilities and services at competitive prices
Hotels are broadly classifies as:
Hotels Resorts
Business Hotels Beach resorts
Leisure Hotels Hill resorts
Budget Hotels Heritage resorts
Departments in a Hotel
1. Front Office
Reservations
Receptionist
Guest Relations
2. Food and Beverages
Room Service
Coffee Shop
Restaurant
_____________________________________________________________________________
For all further enquiries Contact us
122
(Class - XII: INFORMATICS PRACTICES)
=============================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=============================================
123