CBSE Class 12 Informatics Practices Question Paper 2010 With Solutions
CBSE Class 12 Informatics Practices Question Paper 2010 With Solutions
Informatics Practices
Previous Year Question Paper 2010
Series: OSS Code no. 90
INFORMATIC PRACTICES
SECTION - A
This loop will work for the given This loop will work for every element
number of times. in collection.
Example: Example:
For i = 1 to 5 Dim A() As Integer = {1,3,5,7,9}
Console.WriteLine(i,” ”) Dim aItem As Integer
Next For Each aItem in A
Console.WriteLine(aItem)
Next
(b) Name and explain the usage of any two types of modules available in
Visual Basic. 2 Marks
Ans: Form Module: It contains the pre-defined functions relevant to a form.
These triggers get executed for all the These triggers get executed for the
rows in the transaction. whole transaction only once.
Example: for inserting 100 rows in a Example: for inserting 100 rows in a
table, this trigger will be executed 100 table, all the rows will be executed at
times to insert each row. once.
(b) Define the terms Candidate key and Foreign key with respect to a
database. 2 Marks
These are the commands used to These commands are used to store,
create table or to modify its structure. access, update the data in the table.
SECTION - B
4. (a) Read the following case study and answer the questions that follow:
(a) Write the code for the CmdClear command button to clear all the
textboxes except the TxtBillDate textbox. 1 Mark
Ans: //CmdClear
TxtBillno.Text = “ ”
TxtIname.Text = “ ”
TxtPrice.Text = “ ”
TxtDisc.Text = “ ”
TxtFinal.Text = “ ”
(b) Write the code for the form load event of FrmBill so as to: 2 Marks
(i) Display the system date in the TxtBillDate textbox.
Ans: TxtBillDate.text = Date
(ii) Disable the TxtBill Date, TxtDisc and TxtFinal textboxes
Ans: TxtBillDate.ENABLED = FALSE
TxtDisc.ENABLED = FALSE
TxtFinal.ENABLED = FALSE
(c) Write the code for the change event of the TxtPrice textbox to ensure that
the user does not enter a negative or a zero value. If a negative or a zero value
is entered then the textbox should be made blank and a warning message
should be displayed. 3 Marks
Ans: price=Val(TxtPrice.text)
If price<=0 Then
Msgbox(“Re-enter a positive value greater Than 0”)
SECTION - C
6. Read the questions given below and answer accordingly:
a) Write the output produced by the following PL/SQL code: 2 Marks
DECLARE
A NUMBER;
B NUMBER;
TEMP NUMBER;
BEGIN
FOR X IN 1. .4 LOOP
TEMP:=A;
A := B;
B := TEMP;
A := A + 1;
B := B - 1;
DBMS_OUTPUT. PUT_LINE (‘A = ’ | | A);
DBMS_OUTPUT. PUT_LINE (‘B = ’ | | B);
END LOOP;
END;
(a) Write the SQL command to create the table CompLab including the
constraints. 2 Marks
Ans: CREATE TABLE CompLab(
It_Code NUMBER(2) PRIMARY KEY,