XI IP Annual Sample Paper-I
XI IP Annual Sample Paper-I
XI IP Annual Sample Paper-I
CLASS – XI
Time Allowed: 3 Hours Maximum Marks: 70
Instructions:
(i) All questions are compulsory.
(ii) Programming Language : Java, SQL
(d) What type of damages can be caused by viruses to the computer system? 1
(e) Explain the term Integrated Development Environment with its tools. 2
(f) Explain the basic architecture of computer along with the functioning of each of 2
its subunit.
2. (a) Amit is developing GUI application in Java in which he wants to get vehicles 1
which are available with the person (like car, bike, scooter, bicycle etc. any one or
all or few). He is confused that which swing control he will use for this purpose.
Suggest him best suitable swing control for this purpose.
(b) Write the name of the method which is used to receive the data from JTextField 1
in our program which is entered by user at run time.
(c) Rohit wants to know in his program that which radio button is selected by the 1
user at run time. Tell him the name of the method which he will use to find out.
(d) Write the name of the property which is used to make any control disable. 1
Page 1 of 15
(e) What is the difference between the / and % operator in Java. Describe it with 2
suitable example.
(f) What are arithmetic operators in Java? Describe any one with suitable example. 2
(g) What is the difference between if – else-if statement and nested - if statement? 2
Describe it with suitable example.
(c) Explain the use of MODIFY keyword in ALTER table command with example. 2
(e) Write mysql command to remove a table Employee from the database. 1
(g) What is the default value inserted in a field if the value is not provided by the 2
INSERT command? Explain using example.
4. (a) Vinitha is using switch statement in her program. She wants that if the value is 1
not matching with any case then a set of commands should be executed. Tell her
how she will achieve it.
(b) Write the name of the method which is used to convert string value in to float 1
value in Java.
(c) Write the name of the method which is used to display message dialog by using 1
the JOptionPane control.
Page 2 of 15
}while(a>0);
System.out.println(c+"");
(f) Following code has some error(s). Rewrite the correct code underlining all the 2
corrections made:
int a = Integer.parseInt(jTextField1.setText( ) );
int b = 20 ;
int c;
c = a X b;
jTextField1.getText(toStr(c));
(f) Following code has some error(s). Rewrite the correct code underlining all the 2
corrections
int i;
for(i=0,i<=10,i++){
if(i % 2 =0 ) {
System.println(i+” “)
}
}
(g) The following GUI form is created in Netbeans for a Shop.
(i) Write the code for Discount Amount button which calculate and display gross 3
amount and discount amount by using following table:
Type of sales Discount %
Cash 10
Cheque 5
Page 3 of 15
Credit 0
(ii) Write the code for Net Amount button which calculate and display Net Amount 2
(Net amount = gross amount – discount amount)
(iii) Write the code for Exit button to close the application. 1
5. (a) Write any two difference between DELETE & DROP command. 2
(c) Write the SQL commands for the (i) to (iv) and write the output of the (v) and (vi) 6
on the basis of table STUDENT given below:
STUDENT
No. Name Stream Marks Grade Class DOB
1 Kamlesh Computer 78.0 B 12B 1984-04-12
2 Praveen Commerce 88.2 A 11C 1987-05-02
3 Manoj Commerce 67.6 C 12C 1990-02-09
4 Laxmi Computer 77.1 B 12C 1990-12-07
5 Suja Biology 78.6 B 11A 1987-12-02
6 Basima Commerce 89.4 A 12B 1984-05-12
7 Soju Biology 88.4 A 11A 1985-09-05
8 Deepa Computer 75.5 A 12A 1990-02-15
9 Shushil Biology 92.4 A 12A 1984-04-13
10 Baba Commerce 92.5 A 12C 1984-03-13
(i)
To display the details of Computer stream students in class 11(A,B & C).
(ii)
To display name marks & grades in descending order of marks.
(iii)
To display names in upper case.
To display the position of „a‟ in every name.
(iv)
(v)
SELECT NAME,LEFT(CLASS,2) FROM STUDENT
WHERE STREAM = ‟Biology‟;
(vi) SELECT NAME,STREAM,MARKS FROM STUDENT
WHERE STREAM = ‟Computer‟ AND GRADE IN („A‟,‟B‟);
6. (a) Create table Employee as per following Table Instance Chart. 2
Page 4 of 15
Length 30 30 20
Constraint Primary key Not Null
(c) Write the sql commands for (i) to (vi) based on the given table BOOK. 6
Table : Book
Book_Id Book_Name Author_Name Publisher Price Type Quantity
C0001 Fast Cook Lata Kapoor EPB NULL Cookery 5
F0001 The Tears William Hopkins First Pub 650 Fiction NULL
T0001 My First C++ Brain & Brooke EPB 350 Text 10
C++ Brain
T0002 works A.W. Rossaine TDH 350 Text 15
F0002 Thunderbolts Anna Roberts First Pub 750 Fiction 50
(i) To display Book id, Book name, Author name and price of books where
names ending with s.
(ii) To display the names and Total Price of books in ascending order of their
quantity where Total Price is calculated as price * quantity.
(iii) To increase the quantity of Fast Cook book by 10.
(iv) To display Cookery and Fiction type books.
(v) To display all books which are not from EPB publisher.
(vi) To add a new column discount (int) in the table.
(b) What do you mean by e-Learning? What are the limitations of E-learning? 2
Page 5 of 15
ANSWER KEY
2. (a) Amit is developing GUI application in Java in which he wants to get vehicles 1
which are available with the person (like car, bike, scooter, bicycle etc. any one or
Page 6 of 15
all or few). He is confused that which swing control he will use for this purpose.
Suggest him best suitable swing control for this purpose.
Ans :
Check Box
1 marks for correct answer
(b) Write the name of the method which is used to receive the data from JTextField 1
in our program which is entered by user at run time.
Ans :
getText()
1 marks for correct answer
(c) Rohit wants to know in his program that which radio button is selected by the 1
user at run time. Tell him the name of the method which he will use to find out.
Ans :
isSelected()
1 marks for correct answer
(d) Write the name of the property which is used to make any control disable. 1
Ans :
Enabled(false);
1 marks for correct answer
(e) What is the difference between the / and % operator in Java. Describe it with 2
suitable example.
(f) What are arithmetic operators in Java? Describe any one with suitable example. 2
(g) What is the difference between if – else-if statement and nested - if statement? 2
Describe it with suitable example.
Page 7 of 15
1 marks for suitable example.
4. (a) Vinitha is using switch statement in her program. She wants that if the value is 1
not matching with any case then a set of commands should be executed. Tell her
how she will achieve it.
Ans :
She has to use default statement in her switch statement and write all such
instructions in default statement.
1 marks for correct answer.
(b) Write the name of the method which is used to convert string value in to float 1
value in Java.
Page 8 of 15
Ans :
parseFloat()
1 marks for correct answer.
(c) Write the name of the method which is used to display message dialog by using 1
the JOptionPane control.
Ans :
showMessageDialog()
1 marks for correct answer.
Answer :
25
2 marks for correct answer.
(f) Following code has some error(s). Rewrite the correct code underlining all the 2
corrections made:
int a = Integer.parseInt(jTextField1.setText( ) );
int b = 20 ;
int c;
c = a X b;
jTextField1.getText(toStr(c));
answer :
int a = Integer.parseInt(jTextField1.getText( ) );
int b = 20 ;
int c;
c = a * b;
jTextField1.setText(Integer.toString(c));
Page 9 of 15
½ marks for each error
(f) Following code has some error(s). Rewrite the correct code underlining all the 2
corrections
int i;
for(i=0,i<=10,i++){
if(i % 2 =0 ) {
System.println(i+” “)
}
}
Answer :
int i;
for(i=0;i<=10;i++){
if(i % 2 == 0 ) {
System.out.println(i+” “);
}
} (1/2 mark for each correction)
(i) Write the code for Discount Amount button which calculate and display gross 3
amount and discount amount by using following table:
Page 10 of 15
Type of sales Discount %
Cash 10
Cheque 5
Credit 0
Answer :
Answer :
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
float na,ga,da;
ga = Float.parseFloat(grossTF.getText());
da = Float.parseFloat(discountTF.getText());
na = ga-da;
netTF.setText(" "+na);
}
Page 11 of 15
2 marks for correct answer
(iii) Write the code for Exit button to close the application. 1
Answer :
5. (a) Write any two difference between DELETE & DROP command. 2
Ans: delete is to delete the data records from the table. Drop is to remove
complete table from the database.
Delete is DML, can be rollback. Drop is DDL, can‟t be rollback.
(1 mark for each correct difference)
(b) Write the output of the following SQL queries: 2
(v) SELECT CONCAT ( „ Mit ‟,RIGHT( „Suresh‟,3 ) ) ;
Ans: Mitesh
(c) Write the SQL commands for the (i) to (iv) and write the output of the (v) and (vi) 6
on the basis of table STUDENT given below:
STUDENT
No. Name Stream Marks Grade Class DOB
1 Kamlesh Computer 78.0 B 12B 1984-04-12
2 Praveen Commerce 88.2 A 11C 1987-05-02
3 manoj Commerce 67.6 C 12C 1990-02-09
4 laxmi Computer 77.1 B 12C 1990-12-07
5 suja Biology 78.6 B 11A 1987-12-02
6 basima Commerce 89.4 A 12B 1984-05-12
7 soju Biology 88.4 A 11A 1985-09-05
8 Deepa Computer 75.5 A 12A 1990-02-15
9 shushil Biology 92.4 A 12A 1984-04-13
10 baba Commerce 92.5 A 12C 1984-03-13
(vii) To display the details of Computer stream students in class 11(A,B & C).
SELECT * FROM STUDENT WHERE STREAM=‟Computer‟ AND CLASS LIKE
Page 12 of 15
„11_‟;
SOJU 11
SHUSHIL 12
Page 13 of 15
(iv) To change the head office of Titan company to Indore.
ANS: UPDATE COMPANY SET HO=‟Indore‟ WHERE CNAME=‟Titan‟;
(c) Write the sql commands for (i) to (vi) based on the given table BOOK. 6
Table : Book
Book_I Quantit
d Book_Name Author_Name Publisher Price Type y
C0001 Fast Cook Lata Kapoor EPB NULL Cookery 5
F0001 The Tears William Hopkins First Pub 650 Fiction NULL
T0001 My First C++ Brain & Brooke EPB 350 Text 10
C++ Brain
T0002 works A.W. Rossaine TDH 350 Text 15
F0002 Thunderbolts Anna Roberts First Pub 750 Fiction 50
(vii) To display Book id, Book name, Author name and price of books
where names ending with s.
SELECT BOOK_ID,BOOK_NAME,AUTHOR_NAME,PRICE FROM BOOK
WHERE BOOK_NAME LIKE „%s‟ ;
(viii) To display the names and Total Price of books in ascending order
of their quantity where Total Price is calculated as price * quantity.
SELECT BOOK_NAME,PRICE*QUANTITY AS “TOTAL PRICE” FROM BOOK
ORDER BY QUANTITY;
(ix) To increase the quantity of Fast Cook book by 10.
UPDATE BOOK SET QUANTITY =QUANTITY+10 WHERE BOOK_NAME=‟Fast
Cook‟ ;
(x) To display Cookery and Fiction type books.
SELECT * FROM BOOK WHERE TYPE IN („Cookery‟,‟Fiction‟);
(xi) To display all books which are not from EPB publisher.
SELECT * FROM BOOK WHERE PUBLISHER<>‟EPB‟;
(xii)To add a new column discount (int) in the table.
ALTER TABLE BOOK ADD DISCOUNT INT;
Page 14 of 15
the teachers, school and learners.
The limitations of E-learning are as follows:
* Up-front investment
* Inappropriate content
* Portability of training
(1 mark for definition and 1 mark for benefit any two)
(c) What is difference between traditional business system and e-business? 2
(2 marks for 2 correct difference)
Page 15 of 15