Professional Documents
Culture Documents
(Time Allowed: 3hours) (Maximum Marks: 70) I) All Questions Are Compulsory (Ii) Programmi NG Language: Java
(Time Allowed: 3hours) (Maximum Marks: 70) I) All Questions Are Compulsory (Ii) Programmi NG Language: Java
1(a) Raj kamal International school is planning to connect all computers, each spread over distance 1
within 45 meters. Suggest an economical cable type having high-speed data transfer, which can
be used to connect these computers.
Ans. Coaxial Cable
(b) Name two Indian Script included in UNICODE. 1
Ans. Devnagari, Bengali, Gurmukhi, Gujarati, Kannada, Malayalam, Oriya, Tamil, Arabic, Telugu
(c) Write examples of one Proprietary and one Open Source Software. 1
Ans Open source software:
Linux
My Sql
Proprietary Software
Microsoft Office
Oracle
(d) Name any two most popularly used internet browsers. 1
Ans. Firefox
Internet Explorer
(e) Ms. Rani Sen, General Manager of Global Nations Corporate recently discovered that the 2
communication between her company’s accounts office and HR office is extremely slow and
signals drop quite frequently. These offices are 125 meters away from each other and connected
by an Ethernet cable.
(i) Suggest her a device, which can be installed in between the offices for smooth
communication.
(ii) What type of network is formed by having this kind of connectivity out of LAN,MAN
and WAN?
(b) What is the purpose of break keyword while using Switch Case Statement? Illustrate with the 1
help of an example.
Ans. The purpose of Break statement is used to terminate the switch block statement.
switch(grade)
{
case 'A' :
System.out.println("Excellent!");
break;
case 'B' :
System.out.println("Well done");
break;
case 'D' :
System.out.println("You passed");
break;
default :
System.out.println("Invalid grade");
}
(c) Write the name of HTML tag used to include numbered list in a HTML Web Page. 1
Ans. <OL>
(d) Write HTML code for the following: 1
To provide hyperlink to a website :http://www.cbse.nic.in”
Ans. <a href="http://www.cbse.nic.in">www.cbse.nic.in</a>
(e) What will be the content of the jTextArea1 after executing the following code (Assuming that 2
the jTextArea1 had no content before executing this code)?
for(int c=1;c=4;c++)
{
jTextArea1.setText(
jTextArea1.getText()+””+Integer.toString(c*c));
}
Ans. This code will give error because in for loop in place of relation operator (==), assignment
operator (=) is used.
If you replace the assignment operator (= ) with relational operator(==) then output will be
blank text area because condition will be c==4 which is false and loop will not execute. For
execution of a loop condition must be true.
(f) Which of the following units measures the speed with which data can be transmitted from one 2
node to another node of a network? Also give the expansion of the suggested unit.
(i) KMph
(ii) KMpl
(iii) Mbps
Ans. Mbps
(g) Write java code that takes value for a number (n) in jTextField1 and cube (n*n*n) of it to be 2
displayed in jTextField2.
Ans. int n=Integer.parseInt(jTextField1.getText());
int cube=n*n*n;
jTextField2.setText(“”+cube);
3(a) Write MySql command to open an existing database. 1
Page 2 of 8
Ans. USE<database name>;
(b) Ms. Mirana wants to remove the entire content of a table “BACKUP” alongwith its structure to 1
release the storage space. What MySql statement should she use?
Ans. DROP TABLE BACKUP;
(c) Give one difference between ROLLBACK and COMMIT commands used in MySql. 1
Ans.
ROLLBACK COMMIT
ROLLBACK command is used COMMIT command is used to
to end the current transaction make all the changes permanent
and undo all the changes we to the underlying database which
made since the current we made during the current
transaction began. transaction.
Rollback is used to revert the Commit is used to save all the
last transaction in the Sql. recent transactions.
(d) A table STUDENT has 4 rows and 2 columns and another table TEACHER has 3 row and 4 1
columns. How many rows and columns will be there if we obtain the Cartesian product of these
two tables?
Ans. 12 rows and 6 columns
(e) Mr. Sanghi created two tables with CITY as Primary key in Table1 and Foreign Key in Table2. 2
While inserting a row in Table2, Mr. Sanghi is not able to enter a value in the column CITY.
What could be the possible reason for it?
Ans. Mr. Sanghi was trying to enter the name of CITY in Table2 which is not present in Table1.
(f) Item code consisting of 5 digits is stored in an integer type variable intItemCode. Mr. Srikant 2
wants to store this Item code in a String type variable called strItemCode.
Write appropriate java statement(s) to help her in performing the same.
Ans. String strItemCode=Integer.toString(intItemCode);
(g) Mr. Janak is using a table with following columns: 2
Name, Class, Course_Id, Course_name
He needs to display names of students, who have not been assigned any stream or have been
assigned Course_name that ends with “economics”.
He wrote the following command, which did not give the desired result.
Help Mr.Janak to run the query by removing the error and write the correct query.
Ans. SELECT Name FROM Students WHERE Course_name IS NULL OR Course_name LIKE
’%economics’;
4(a) What message will be displayed after the execution of the following code? 2
int Age=64,Relaxation=4;
int ModiAge=Age – Relaxation;
if (ModiAge<60)
jOptionPane.showMessageDialog(Null,”NOT eligible”);
else
jOptionPane.showMessageDialog(Null,”eligible”);
Ans. eligible
(b) Rewrite the following program code using a If statement. 2
int c=jComboBox1.getSelectedIndex();
Page 3 of 8
switch(c)
{
case 0 : Amount=Bill; break;
case 1 : Amount=0.9*Bill; break;
case 2 : Amount=0.8*Bill; break;
default : Amount=Bill;
}
Ans. int c=jComboBox1.getSelectedIndex();
if(c==0)
Amount=Bill;
else if(c==1)
Amount=0.9*Bill;
else if(c==2)
Amount=0.8*Bill;
else
Amount=Bill;
(c) How many times does the following while loop get executed? 1
int K=5;
int L=36;
while(K<=L)
{
K+=6;
}
Ans. 6 // explanation: value of K 5,10,15,20,25,30,35 than it increased than L
(d) What will be displayed in jTextArea1 after executing the following statement? 1
jTextArea1,setText(“GREAT\n COUNTRY\tINDIA”);
Ans. GREAT
COUNTRY……….INDIA
Note:(……….. denotes the blank tab space given by \t dots will not display in output)
(e) What will be the values of variables ‘m’ and ‘n’ after the execution of the following code? 2
int P,Q=0;
for(P=1;P<=4;P++)
{
Q+=P;
Q--;
}
Ans. This question is doubtfull, if we consider the question same as it is in question paper than this
is an error because ‘m’ and ‘n’ variable is not used in code istead of ‘m’ and ‘n’, ‘P’ and ‘Q’ is used
whch will give error of variable not found.
And if we consider as it is printing mistake in place of ‘m’ and ‘n’, we take ‘P’ and ‘Q’ then
output will be
P is 4
Q is 6
(f) Given a string object named Pay having value as “68000” stored in it. Obtain the output of the 2
following:
JOptionPane.showMessageDialog(null,
” “+Salary.length()+Integer.parseInt(Salary));
Ans. 568000 // explanation length and Salary is concatenated with “ “which represent blank string,
so they are not calculated as number.
Page 4 of 8
(g) Janav Raj is a programmer at Path Educo Enterprises. He created the following GUI in 5
NetBeans. Help him to write code for the following:
jTextField1
jTextField2
jTextArea1 jButton2
jButton1
jButton3
ii. To clear both the text fields and text area, on clicking [Reset] button. 2
iii. To terminate the application on the click of [stop] button. (Assume suitable names for the 1
various controls on the Form)
Ans. i. int num1=Integer.parseInt(startTextField.getText());
int num2=Integer.parseInt(stopTextField.getText());
seriesTextArea.setText(null);
if((num1 % 2)==0)
{
for(int i=num1;i<=num2;i=i+2)
{
seriesTextArea.append(i+" ");
}
}
else
{
for(int i=num1;i<=num2;i=i+2)
{
seriesTextArea.append(i+" ");
}
}
Page 5 of 8
ii. seriesTextArea.setText(null);
startTextField.setText(null);
stopTextField.setText(null);
iii. System.exit(0);
5(a) What is the purpose of ORDER BY clause in MySql? How is it different from GROUP BY 2
clause?
Ans. Order by clause is used to sort a particular field in either ascending order or descending
order.
Difference:
ORDER BY is used in MySQL query to sort the result in specified columns name
whereas GROUP BY is used to group your result in specified columns.
The GROUP BY clause must come after any WHERE clause and before any ORDER BY
clause while ORDER BY takes the name of one or more columns by which to sort the
output.
(b) Table SCHOOL has 4 rows and 5 columns. What is the Cardinality and Degree of this table? 1
v. Item
Jam
Coffee
vi. 3
Page 6 of 8
vii. MIN (QTY
56
6(a) Write a MySql command to creat the Table STOCK including its Constraints. 2
Table STOCK:
Name of Column Type Size Contraint
Id Decimal 4 Primary Key
Name Varchar 20
Company Varchar 20
Price Decimal 8 Not Null
Ans. CREATE TABLE STOCK (Id Decimal(4) PRIMARY KEY , Name VARCHAR(20) , Company
VARCHAR(20) , Price Decimal(8) NOT NULL) ;
(b) In a database there are two tables: 6
Table ITEM:
ICode Iname Price
101 Television 75000
202 Computer 42000
303 Refrigerator 90000
404 Washing Machine 27000
Table BRAND:
ICode Brand
101 Sony
202 HP
303 LG
404 IFB
Write MySql queries for the following:
(i) To display ICode,IName and corresponding Brand of those Items, whose price is between 2
20000 and 45000 (both values inclusive).
(ii) To display ICode, Price and BName of the item which has IName as “Television”? 2
(iii) To increase the price of all the Items by 15%. 2
(c) Mr. Anurag Das working as Manager in Vivian Enterprises wants to create a form in NetBeans 2
to take various inputs from user. Choose appropriate controls from Label, TextBox, Radio
Button, CheckBox, ListBox, ComboBox & Command Button and write them in the third
column:
SNO Control used to Control
1. Enter Name, Address and Salary
2. Select Gender (Male / Female)
3. Select Department from available List
Choose Hobby of Employee
(Singing/Dancing/Skating/Swimming)
Ans. 1. TextBox
2. Radio Button
3. ComboBox
4. CheckBox
Page 8 of 8