You are on page 1of 11

QUESTION BANK-2017-18 CLASS- XI ( INFORMATICS PRACTICES)

Q1. (a) What will be the value of j = -- k + 2* k+ (l = k, l++) if k is 20 initially.


(b) What do you mean by token?
(c) What is byte code ?
(d) What is Candidate key?
(e) Differentiate Syntax Error and Semantic errors.
(f) What is the difference between a Text Field and Text Area?

(g)Given the following code fragment


int ch = 20;
System.out.println( ++ ch);
System.out.println( ch);
(i) What output does the above code?
(ii) What is the effect of replacing ++ch with ch+1

Q2. (a) A list namely PlayerList has SelectionMode property set to SINGLE_INTERVAL. How
would you
obtain the selected values? Give example.
(b) Write a statement in java to display message ‘Hello’ using dialog box.
(c) What do you mean by conditional operator? Explain it with one suitable example.
(d) What will be displayed in output window after the execution of the following loop?
int ptr=5, cnt;
for(cnt= 10; cnt>0; cnt = cnt/2)
ptr = ptr +cnt;
SOP(“ptr : “ + ptr + “ “ + “cnt : “ + cnt);
(e) Write java code that takes one value of integer type. Find out cube of it. Assign result to the
String object
and display result.
Q3.(a) What do you mean class and object? Explain. Also mention the class from which the
jPasswordField1 belongs?

1
(b) Rewrite the following program using a switch statement.
String s = jTextField1.getText();
String message ;
char choice = s.charat(0);// a method to extract first character
if( choice==’A’)
message = “Better”;
else if (choice = =’ B’ || choice = = ‘C’)
message = “Good”;
else
message = “Average”;

(c) What will be displayed in jTextArea1 after executing the following statement?
1
jTextArea1.setText(“World\nCup\t2015”);
(d) Find the output of the following code:-
String text1 = “ Computer”
String text2 = “world”;
text1 = text1.toLowerCase ( );
String message = text1.concat (text2);
System.out.println (message+(message.length( )+4));
(e) How many times is the following loop executed? And also convert it into for loop.

int number =5;


do
{
System.out.println(number);
Number - - ;
}while( number > =1);
(f) Find out the errors, if any
int Counter =0;

2
mm=0;
While (Counter < 10)
{
if( Counter % 2 = 0)
{
mm = / 10;
jTF1.putText(mm);
}
Counter++;
}
(g) Kanak Enterprises is a Yarn Manufacturing Company. The Human Resource
Department manage 100 employees on regular basis. The company provides salary on
two categories ‘Temporary employee and Permanent Employee. The account
department instructs the computer department to develop a salary calculation as shown
below: ( the Image of Form is given at the End of Question Paper)
The list of Swing controls for the above is as follows:
Objects Description
CodeTF Code of the Employee
Name TF Name of the Employee
SalaryTF Basic Salary of the Employee
otpTF Over Time for Permanent Employee
ottTF Over Time for Temporary Employee
hrsTF House Rent Allowances of Employee
ccaTF A type of Allowance of Employee
daysTF Number of days worked
amtTF Salary Amount
totTF Total Amount
otaTF Over Time Amount

(i) Write code for the both Permanent and Temporary radio Button that when use
click Permanent button, then textboxes available in Temporary panel is
automatically disabled. Similarly, when use click on Temporary button then

3
textboxes available in Permanent panel is automatically disabled.

(ii) Write the code of clear button to clear all the values stored in all the text boxes
and temporary employee should be selected as default employee.
(iii) Write code for the calculate button to calculate the salary amount, over time
amount and total amount.
The criteria for salary calculation is as given below:

For - HRA is 20% of basic Salary


Permanent - CCA is Rs 500
Employee - Over time allowance is Rs. 75 per
overtime hour
- Salary amount is the sum of basic
+hra+cca
For - Salary is Rs. 250 per day
Temporary - Overtime is Rs. 50 per day overtime
Employee hours
Total amount for permanent and temporary employee will be calculated as the sum of
total salary amount and over time amount.
Q4 Predict the output Produced by following code:
int x = 0;
While(1){
System.out.println(“X Plus one is ” + (x+1));
}

Q5. Given the following code fragment:


if(a==0)
System.out.println(“Zero”);
if(a==1)
System.out.println(“One”);
if(a==2)
System.out.println(“Two”);
if(a==3)
System.out.println(“Three”);
Write an alternate code using if-else that save on number of comparison.

6Compare and contrast a List Box and Combo Box.

4
7.Write code to obtain list of selected items from a list namely List1?

8.Why does a Combo Box fires item event twice?

9. What is dispose( ) used for?

10. Identify the errors in the following code that written in action event handler of a button
namely OKbtn.
double d = nameTF.getText( );
String age = ageTF.getText( );
double marks = Double.parseDouble( marksTF.getText( ));

11. Design a GUI Application as follows:

Create a java desktop application Temperature Converter Fahrenheit to Celsius and vice versa.
For an incorrect choice or input an appropriate error message should be displayed.

12. Write code for Calculate Button to find all prime no. between 0 to given number by user
for given application.

5
Q13. (a) Which MySQL command helps you to see the structure of the table?

(b) Mr. Karan Bairagi wants to remove the entire content of a table “Hospital” along with its
structure to
release the storage space. What MySQL command should be use? And also write the category
of the command
(DDL/DML).
(c) Table Employee has 3 rows and 4 columns. Table Status has 5 rows and 2 columns. What
will be the cardinality and degree of the Cartesian Product of Employee and Status?
(d) While Creating table Status , Ms. Poonam forget to add the field TYPE with type Character
and size 10.
Help her to write MySQL command to do so.
(e) Distinguish between alter table and update command of MYSQL with one example of each
one.
(f) There is a column Price in a table Product. The following two statements are giving different
outputs. What
may be the possible reasons?
- select count(*) from Product.
- select count(price) from Product;
(g) What is the use of constraints in MYSQL ? Write MySql Query to remove constraint the
Primary Key for the
field Account_Number in the table Bank.
Q14.(a) What is the use of SELECT statements in SQL? How is it different from ALTER TABLE
Statement?
(b) Mr. Anoop Singhvi created a table SUPER with 5 rows and 7 columns. He added 4 more
rows to it and delete two columns. What will be the cardinality and degree of the table SUPER?
1
(c) Mr. Ramdin runs his medical store and he created table STORE with Ayurvedic Medicines.
Write SQL commands for (i) to (iv) and output for (v) to (vii)

6
Q15. (a) Write an SQL query to create the table SalesPerson with the following structure.

(b) In a database there are two tables “Books” and “Issued” are shown below:

7
Write MySql queries for the following:
i. To list the names from books of text type and quantity issued is more than 2.
ii. ii. To display the book_id, book_name and quantity_issued for all books which have
been issued.
iii. iii. Display total number of books according to their types.
Q16. What is the following command doing?
ALTER TABLE Persons
ADD CONSTRAINT chk_Person CHECK( P_Id> 0 AND City = ‘Shimla’);
Q17. Given a statement as follows.
CREATE TABLE Orders
( O_ID int NOT NULL,
OrderNo int NOT NULL,
P_ID int,
PRIMARY KEY (O_ID),
FOREIGN KEY(P_ID) REFERENCES Persons(P_ID));
Indentidy the number and types of constraints in the table Orders.

Q18. An examination agent designs the following database tables to store the information on
candidates who register for examination.
Table:- CAND
Field Name Type Width Description
CNUM Character 8 Unique candidates number of the candidate
where the first three characters are the
unique school code of the candidates
school.
CNAME Character 30 Name of the Candidates
DOB Date Date of birth of the Candidate.

Table: REGISTER
Field Name Type Width Description
CNUM Character 8 Candidate number of the candidate who sits the
examination of the subject.
SCODE Character 2 Unique subject code

Table:-SUBJECT
Field Name Type Width Description
SCODE Character 2 Unique subject code
SNAME Character 30 Name of the Subject

8
(a) (i) Write an SQL command to create CAND
(ii) Which of the following can be a candidate key of CAND ? Explain Briefly. (A) CNUM
(B) CNAME+DOB
(b) Identify the primary key(s) and foreign key(s) of REGISTER.
(c) (i) Write an SQL Command to increase the width of CNUM in CAND to 12.
(ii) The subject code and subject name of a new subject are 09 and LAW respectively.
Write a SQL command to insert this record in to SUBJECT.
Q19. What is data redundancy & inconsistency?

Q20. What should be the length of text literal in MySQL?

Q21 Write any two limits of MySQL?

Q22. Differentiate between DDL and DML?

Q23.

Table:CLUB
Coach_ID CoachName Age Sports DataOfApp Pay Sex
1 Kukreja 35 Karate 27/03/1996 1000 M
2 Ravina 34 Karate 20/01/1998 1200 F
3 Karan 34 Squash 19/02/1998 2000 M
4 Tarun 33 Basketball 07/01/1998 1500 M
5 Zubin 36 Swimming 12/01/1998 750 M
6 Ketki 36 Swimming 24/02/1998 800 F
7 Ankita 39 Squash 20/02/1998 2200 F
8 Zareen 37 Karate 22/02/1998 1100 F
9 Kush 41 Swimming 13/01/1998 900 M
10 Shilya 37 Basketball 19/02/1998 1700 M
Consider the above given Table and answer the following Questions
(i) To display the details of coaches whose age is greater than 40.
(ii) To display the coach name, their game with highest pay.
(iii) To display coach_ID , coach name and date of appointment in
descending order.

Q24.Write the command to display the table name with their columns name with example.

Q25. Write a query to enter the following record in the table- Employee.

9
‘E25001’ ‘Albert Sieman’ ‘D012’ To insert the NULL value in Designation and Default value in
Salary.

Q26.Given the following tables:

Orders(OrdNo, Ord_date, ProdNo#, Qty)

Product(ProdNo, Descp, Price)

Payment(OrdNo,Pment) Note:- Pment field is Boolean data type.

Q27. Write a query to delete all those records from table Orders whose complete payment has
been made.

Q28. How is FOREIGN KEY commands different from PRIMARY KEY command?

Q29. What is the role of UNIQUE constraint? How is PRIMARY KEY constraint different from
UNIQUE constraint?

Q30. Identify the Error:

DELETE ALL FROM TABLE EMPL;

Q31. Write Query statements for the following transactions : (Consider tables of Question 3 (c))

(i) Increase price of all products by 10%


(ii) List the details of all orders whose payment is pending as per increased price.
(iii) Decrease prices by 10% for all those products for which orders were placed 10
months before.

Q32. Write a query to display the name of employee whose name contains ‘A’ as third
alphabet.

Q33. Write query to display the name, job title and salary of employee who don’t have
manager.

Q34. Write the command to create the name of Constraint using Create Table.

Q35. Write a query to update the salary with 12 % of existing salary of Employee Table.

Q36. Write a query to display a list of members from ‘DELHI’, ‘MUMBAI’, ‘CHENNAI’ or
‘BANGLORE’ cities from member table.

10
Q37. Write Query statements for the following transactions:

(i) To change the existing column name ENAME of table Employee to EMP_NAME.
(ii) Write a query to delete the DESIG column of the EMPLOYEE table.
(iii) What is following query doing?
ALTER TABLE Persons
DROP PRIMARY KEY;

Q38 (a) What social impact does e-Governance have on society?

(b) Write two important features of e-business. Give two most commonly used.
Q39. How has e-governance benefitted the common man?
Q40. What benefits does an e-business offer to the customers?
Q41. Why do you think e-learning courses have high dropout rate?
Q42. How has society benefitted from the e-governance? What issues are still to be care of?
Q43. What are the impacts of ICT on Society?
Q44. What is an infomania?
Q45. What are the challenges of e-learning?
Q46. What are the disadvantages of the followings:
e-business, e-governance , e-learning.

11

You might also like