0% found this document useful (0 votes)
36 views17 pages

CBSE Class 12 Informatics Practices Question Paper 2010 With Solutions

The document describes a case study about developing a billing software for a store. It provides details about the various form controls and their purpose. It then asks to write code for various form events like clearing textboxes, validating input, calculating discount and final price based on item category and membership.

Uploaded by

Yashika Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views17 pages

CBSE Class 12 Informatics Practices Question Paper 2010 With Solutions

The document describes a case study about developing a billing software for a store. It provides details about the various form controls and their purpose. It then asks to write code for various form events like clearing textboxes, validating input, calculating discount and final price based on item category and membership.

Uploaded by

Yashika Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

CBSE Class 12

Informatics Practices
Previous Year Question Paper 2010
Series: OSS Code no. 90

● Please check that this question paper contains 8 printed pages.


● Code number given on the right hand side of the question paper should
be written on the title page of the answer-book by the candidate.
● Please check that this question paper contains 7 questions.
● Please write down the Serial Number of the question before
attempting it.
● 15 minute time has been allotted to read this question paper. The
question paper will be distributed at 10.15 a.m. From 10.15 a.m. to
10.30 a.m., the students will read the question paper only and will not
write any answer on the answer-book during this period.

INFORMATIC PRACTICES

Time Allowed: 3 hours Maximum Marks: 70


Note:
I. This question paper is divided into 3 sections.
II. Section A consists of 30 marks.
III. Section B and Section C are of 20 marks each.
IV. Answer the questions after carefully reading the text.

SECTION - A

Class XII Information Practices www.vedantu.com 1


1. Answer the following questions.
(a) Expand the terms OSS and W3C. 2 Marks
Ans: OSS: Open Source Software
W3C: World Wide Web Consortium
(b) What are the following software used for? 2 Marks
(i) PHP
(ii) MySQL
Ans: PHP is used as server side scripting applications to publish webpages.
MySQL is used as multiuser open source RDBMS.
(c) Name any four application areas of databases. 2 Marks
Ans: Applications:
● Financial accounting
● Fees Management System
● Admission Management System
● Income Tax Management System
(d) What are the different types of relationships that can be depicted through
an ER model? Explain the concept of ER Model using the case study of a
Ticket Reservation System that has three entities Ticket, Passenger and
Train. Assume that each passenger can buy more than one ticket. 4 Marks
Ans:
● Many to One Relationship
● Many to Many Relationship
● One to Many Relationship
● One to One Relationship

Class XII Information Practices www.vedantu.com 2


2. Answer the following questions
(a) Differentiate between the FOR ... NEXT and FOR EACH ... NEXT loop
of Visual Basic giving a suitable example of each. 2 Marks
Ans: The difference between For...Next and For Each… Next:

For...Next For Each… Next

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.

Class XII Information Practices www.vedantu.com 3


Standard Module: It contains the functions relevant to a project.
(c) What are data-aware controls? Name any two ActiveX data aware
controls that can be used on a form. 2 Marks
Ans: Data aware controls are the controls in Visual Basics which help in
connecting and accessing database.
DataList and DataCombo are two data aware controls.
(d) Explain the term ADO object model. Differentiate between the
Connection Timeout and Command Timeout properties of the Connection
object. 2 Marks
Ans: ADO stands for ActiveX Data Objects which helps you connect, access and
modify the database in visual basics.
Connection Timeout is time limit to set up the connection to the database, after
which process to connect will be stopped while Command Timeout is the time
limit to execute the instruction/ command after which command execution will
be aborted.

3. Answer the following questions


(a) Differentiate between row-level and statement-level triggers. 2 Marks
Ans: The difference between row-level and statement-level triggers:

Row-level Triggers Statement-level Triggers

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

Class XII Information Practices www.vedantu.com 4


Ans: Candidate keys are the attributes of a table which are capable of becoming
the primary key. For example: Admission_No and Roll_No both can be primary
keys, so they are candidate keys.
Foreign keys are the attributes of a table which refers to the primary key attribute
of another table and acts as a bridge between both.
(c) Differentiate between DDL and DML commands. Give one example of
each type of command. 2 Marks
Ans: The difference between DDL and DML commands:

DDL Commands DML Commands

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.

Example: CREATE, ALTER etc Example: INSERT, UPDATE etc

(d) Mention any 2 advantages of PL/SQL as compared to SQL. 2 Marks


Ans: Advantages of PL/SQL as compared to SQL:
● PL/SQL can execute multiple operations or a block of operations at once
which reduces traffic in network.
● PL/SQL supports procedural programming.
(e) Name the keyword used to: 2 Marks
(i) Allow duplicate rows in a query.
Ans: SELECT *
(ii) Avoid duplicate rows in a query.
Ans: DISTINCT

SECTION - B
4. (a) Read the following case study and answer the questions that follow:

Class XII Information Practices www.vedantu.com 5


Mr. Presi of Super Store decided to computerize the billing department. The
accounts manager at Super Store is creating billing software to generate the
bill during the sale period. A new bill is generated for each item sold. The
discount is given based on the item category. An additional discount of 5%
is given to the Store Membership Card holders. The following is the data
entry screen used at the store:

The list of controls for the above form is as follows:

Object Type Object Name Description


Form FrmBill The main form
Text Box TxtBillno To enter Bill Number
TxtBillDate To display System Date
TxtIName To input Item Name
TxtPrice To input Item Price
TxtDisc To display Discount
TxtFinal To display Final Price
Option Buttons OptMens To select Men’s Category
OptWomens To Select Women’s Category
OptKids To select Kid’s Category

Class XII Information Practices www.vedantu.com 6


Command Button ChkMember To be checked for members
CmdCalc To calculate discount and Final Price
CmdClear To clear all textboxes
CmdExit To Exit from the application

(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”)

Class XII Information Practices www.vedantu.com 7


TxtPrice.text = “ ”
End If
(d) Write the code for the CmdCalc command button to display the discount
and final price in the TxtDisc, and TxtFinal textboxes respectively. Note that
Final price is ealculated as price - discount and the discount is calculated
based on the category and price according to the following table. Also
remember to give an additional 5% discount for membership card holders
i.e if the ChkMember check box is checked. 4 Marks

Category Price Discount


Men’s <1000 30%
>=1000 50%
Women’s <1500 40%
>=1500 50%
Kid’s <500 20%
>=500 30%

Ans: price=Val(TxtPrice. text)


If OptMens.value=True THEN
If price<1000 Then
disc=0.3
Else disc=0.5
End If
Else If OptWomens.Value=True Then
If price<1500 Then
disc=0.4
Else disc=0.5
End If
Else If OptKids.Value =True Then
If price<500 Then

Class XII Information Practices www.vedantu.com 8


disc=0.2
Else disc=0.3
End If
End If
If ChkMember.Value=1 Then
disc = disc+0.05
End If
TxtDisc.text = disc
TxtFinal.text = price*(1-disc)

5.Answer the following questions


(a) Find the errors from the following code segment and rewrite the
corrected code underlining the correction made. 2 Marks
Private Function IsPrime (num As Integer) As Bool
Dim limit As Integer
limit = num / 2
For ctr = 2 To limit
If num Modulo ctr = 0 Then
Exit For loop
End If
Next
IsPrime = IIf(ctr > limit, True, False)
End Sub
Ans: Private Function IsPrime(num As Integer) As Bool
Dim limit As Integer

Class XII Information Practices www.vedantu.com 9


limit = num/2
For ctr = 2 To limit
If num Mod ctr = 0 Then
Exit For
End If
Next
IsPrime = If(ctr > limit, True, False)
End Function
(b) Find the output of the following code: 2 Marks
Dim astr as string
Dim I as Integer
I=1
astr = "Come"
Do while I <= Len (astr)
Print Mid(astr, I)
I=I+1
Loop
Ans: Output:
Come
ome
me
e
(c) Rewrite the following code using If Then Else construct without affecting
the output: 2 Marks
Dim a As Integer

Class XII Information Practices www.vedantu.com 10


a=1
Select Case a
Case 1
Print “Sunday”
Case 2 To 6
Print “WeekDay”
Case 7
Print “Nearing Weekend”
End Select
Ans: DIM a As Integer
a=1
If a = 1 Then
Print “Sunday”
Else If a>=2 and a<=6 Then
Print “WeekDay”
Else If a = 7 Then
Print “Nearing Weekend”
End If
(d) Write a Visual Basic procedure that takes 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)). 4 Marks
Ans: Sub SumAllDigits(num As Integer)
Dim sum As Integer
sum = 0
Dim i As Integer

Class XII Information Practices www.vedantu.com 11


For i = 1 To Len(Str(num))
sum = sum + Mid(Str(num),i,1)
Next
MsgBox(“Sum = ”&sum)
End Sub

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;

Class XII Information Practices www.vedantu.com 12


Ans: A and B have not been initialized.
Let A = 2 and B = 3
Output: A = 4
B=1
A=2
B=3
A=4
B=1
A=2
B=3
(b) Find the errors from the following PL/SQL code and rewrite the
corrected code underlining the correction made. 2 Marks
DECLARATION
V_MNO MOVIES.MOVIENO%TYPE;
V_TITLE MOVIES.TITLE%TYPE;
V_PRICE MOVIES.PRICE%TYPE;
BEGIN
V_MNO EQUALS 101
LOOP
SELECT TITLE, PRICE, RATING INTO V_TITLE,
V_PRICE, V_RATE
FROM MOVIES
WHERE MOVIENO = V_MNO;
DBMS_OUTPUT.PUTTEXT (V_TITLE ||‘ ’|| V_PRICE);
EXIT WHEN V_RATE < 4;

Class XII Information Practices www.vedantu.com 13


V_MNO : = V_MNO + 1;
LOOP END;
END;
Ans: DECLARATION
V_MNO MOVIES.MOVIENO%TYPE;
V_TITLE MOVIES.TITLE%TYPE;
V_PRICE MOVIES.PRICE%TYPE;
V_RATE MOVIES.RATING%TYPE;
BEGIN
V_MNO := 101;
LOOP
SELECT TITLE, PRICE, RATING INTO V_TITLE, V_PRICE,
V_RATE
FROM MOVIES
WHERE MOVIENO = V_MNO;
DBMS_OUTPUT.PUTTEXT (V_TITLE ||‘ ’|| V_PRICE);
EXIT WHEN V_RATE < 4;
V_MNO : = V_MNO + 1;
END LOOP;
END;
(c) Differentiate between the IN and IN OUT modes of a parameter in a
PL/SQL block. 2 Marks
Ans: IN mode is used when we need to read the value of actual parameter value
for formal parameter.
IN OUT mode is used when we need to read and reflect back the changes in
formal parameter value to the actual parameter.

Class XII Information Practices www.vedantu.com 14


(d) Write a PL/SQL Function POWER that takes two numbers as arguments
and returns the value of the first number raised to the power of the second.
4 Marks
Ans: CREATE OR REPLACE Function Power (n IN number, m IN number)
RETURN number
IS result number
BEGIN
result = n**m;
Return result;
END;

7. Answer the questions based on the table CompLab given below:


Table: CompLab

Column Name Data Type Size Constraint Description


It_Code NUMBER 4 PRIMARY KEY Item Code
It_Cat CHAR 1 ‘H’ or ‘S’ Item category as
Hardware or
Software
It_Name VARCHAR2 25 NOT NULL Name of the item
It_Cost NUMBER 8.2 Cost of each unit of
an item
It_Qty NUMBER 3 Item Quantity In the
Lab
Dt_Pur DATE Date of Purchases

(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,

Class XII Information Practices www.vedantu.com 15


It Cat CHAR CHECK(It_Cat IN ('H','S')),
It_Name VARCHAR2(30) NOT NULL,
It_Cost NUMBER(8, 2)
It_Oty NUMBER (3) ,
Dt_pur Date
);
(b) Write the SQL command to display the details of the item with the
maximum It_Cost. 2 Marks
Ans: SELECT * FROM CompLab
WHERE It_Cost=(SELECT MAX(It_Cost) FROM CompLab) ;
(c) Write the PL/SQL code to increase the item cost by 10% for an item code
accepted from the user if the date of purchase of the item is later than 12-
Oct-2005. 3 Marks
Ans: CREATE OR REPLACE Procedure Inc_Cost (code IN number)
IS
V_Cost CompLab.It_Cost%TYPE;
BEGIN
UPDATE CompLab
SET It_Cost = 1.1*IT_Cost
WHERE It_Code = code AND Dt_Pur > ‘12-Oct-2005’;
END;
(d) Write the PL/SQL code to create a stored procedure Disp_Details to
display the details of all the items with It_Cat as ‘H’. The code should also
display the total quantity of all such Items. 3 Marks
Ans: CREATE OR REPLACE Procedure Disp_Details
IS

Class XII Information Practices www.vedantu.com 16


cursor c IS
SELECT * FROM CompLab
WHERE It_Cat = ‘H’;
record c%ROWTYPE;
Total_Qty number(5) :=0;
BEGIN
open c;
LOOP
fetch c INTO record;
EXIT WHEN c%notfound;
Total_Qty :=Total_Qty+ record.It_Qty;
DBMS_OUTPUT. PUT_LINE ( record.It_Code ||‘ ’||
record.It_Name ||‘ ’|| record.It_Qty);
END LOOP;
CLOSE c;
DBMS_OUTPUT. PUT_LINE (Total_Qty) ;
END;

Class XII Information Practices www.vedantu.com 17

You might also like