Top Banner
SAMPLE PAPER - 1 INFORMATICS PRACTICES – Class - XII SET – INNOVATION 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 Q1. Answer the following questions: - a) Why GNU is known as GNU not Unix? 2 b) What is an Inventory Control System? Name any two entities or tables that could be a part of this system? 2 c) Differentiate between ER Modeling and Object Modeling Techniques. 2 d) Write down the characteristics of Data Ware house. 2 e) Give the difference b/w Shareware and proprietary software. 2 Q2. Answer the following questions:- a) Differentiate between a form module and class module of Visual Basic. 1 b) Explain the methods for loading and unloading forms. 2 c) What is DSN? 1 d) When the GotFocus and LostFocus Events occurs. 2 e) Differentiate between 4 f) i) Date and Date$ function ii) Call ByVal and Call ByRef Q.3) Answer the following questions:
29

Solved Question Papers and Hots of Class-XII IP

Sep 06, 2014

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Solved Question Papers and Hots of Class-XII IP

SAMPLE PAPER - 1INFORMATICS PRACTICES – Class - XII

SET – INNOVATIONTime allowed: 3 hours Maximum Marks : 70Note:

(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

Q1. Answer the following questions: -

a) Why GNU is known as GNU not Unix? 2b) What is an Inventory Control System? Name any two entities or tables that could be a part of this system? 2c) Differentiate between ER Modeling and Object Modeling Techniques. 2d) Write down the characteristics of Data Ware house. 2e) Give the difference b/w Shareware and proprietary software. 2

Q2. Answer the following questions:-

a) Differentiate between a form module and class module of Visual Basic. 1b) Explain the methods for loading and unloading forms. 2c) What is DSN? 1d) When the GotFocus and LostFocus Events occurs. 2e) Differentiate between 4f) i) Date and Date$ function ii) Call ByVal and Call ByRef

Q.3) Answer the following questions:

a) Normalize the table with the following specification: 2 Employee (empno, dept_no, dept_name, salary, DOJ, dept_no, dept_name).

b) If a table is dropped what happens to views and indexes dependent upon this table. 2 c) How will you drop a constraint from a table? 2 d) Find the join of the following two tables: 2

e) What is the advantage of an anchored data type?

TEACHERTno. Tname TcityT1 Mr.Nayak DelhiT2 Mrs.Dubey Mumbai

STUDENT Roll Name City1 Divakar Delhi2 Puneet Mumbai3 Rohit Kolkata

Page 2: Solved Question Papers and Hots of Class-XII IP

SECTION –B

Q 4. Answer the following questions:

a) Write a VB program to compare two strings using function. 2

b) Write a sub program to find the largest, smallest, sum and average number of array of ten numbers. 4

c) What will be the output of the following program. 2

Private Sub Command_click()Dim str1 as stringstr1 =”Computer”n=1Do While n<=len(str1)Print left(str1,n)n=n+1LoopEnd Sub

d) Write a VB procedure to reverse the digits of given number. 2

Q 5. Do the following:

a. Find the Error: 3

Sub Fibonacci(S1 as NUMBER,S2 as INTEGER,N as INTEGER)

Output S1,S2

Dim count as Integer,dim term as Integer

For count EQUAL 3 TO N

Term = S1+S2

Print term

S1=S2

S2=term

Next value

End sub

b. Write the output of the given code: 3

Sub first()

Dim x as integer

x=20

Print x

Call second(x)

Print x

Page 3: Solved Question Papers and Hots of Class-XII IP

End Sub

Sub second (y as integer)

y=40

Print y

End Sub

Private Sub Command1_click()

Call first

End Sub

c. Find the output of the following: 2

Dim String1 as stringDim String2 as stringString1=”VB IS NOT AN OOP”String2=”an”S=Instr(3,String1,String2)Print S

d. If today’s date is 21/09/08 then what is the o/p of the statement 2Print Format(Now,”ddd,mmmm dd,yyyy”)

SECTION –C

Q 6. Answer the following questions:

a) Write the output of the following PL/SQL code block: 2 DECLARE

S NUMBER :=0;

BEGIN

I :=2;

FOR X IN 1..5

LOOP

IF MOD(X,2) = 1 THEN

S:=S + X;

ELSE

S:=S - X;

END IF;

DBMS_OUTPUT.PUT_LINE(TO_CHAR(:I*10));

END LOOP;

END;

Page 4: Solved Question Papers and Hots of Class-XII IP

b) Find the errors from the following PL/SQL code and rewrite the corrected code 2

underlining the correction made.

Declare

B_No Number(4);

Begin

B_No : = %Book_No;

Select Title Into B_Title from Books for Book_No = B_No

If B_Title : = ‘Leaarning ABC’

Update B_Title = ‘Learn ABC’ Where Book_No = B_No;

Else

Dbms_output.Put_Line(‘No Change’);

End

c) Write a PL/SQL block to create a trigger KVS to display a message WELCOME TO KVS

before each insert operation on the table KVS_EMP. 2

d) Write a PL/SQL procedure PRO_NUMBER to find the sum of first 10 natural numbers. 4

Q 7. Answer the following questions based on the STUDENT table:

a) Create the above table including constraints.

2

b) Write a Cursor to display all the students whose stream is ‘Medical’ and Grade ‘A’. 2

c) Write a Procedure MYSTIPEND to display the stipend of the student whose RNo is entered by user.

d) Write a PL/SQL FUNCTION Power that takes two numbers as argument and returns the value of the first number raised to the power of the second. 4

* * *

Column Name Data Type Size ConstraintRNo NUMBER 4 PRIMARY KEY Name VARCHAR2 20 Not NullStipend NUMBER 7,2 Stipend is greater than 0Stream VARCHAR2 15 Not NullGrade CHAR 1

Page 5: Solved Question Papers and Hots of Class-XII IP

SAMPLE PAPER - 1INFORMATICS PRACTICES – Class - XII

SET – INNOVATIONSOLUTIONS

Total Marks: 70 Duration: 3hrs

TIME : 3 HR MM : 70

SECTION-A

Q 1. Answers to the given questions :

a) GNU. Its name is a recursive acronym for “GNU’s Not Unix”,which was chosen because its design is Unix-like, but it contains no actual UNIX code.

b) Inventoy Control System is used to process inventory data. It can be used to improve the inventory control so that it become easier to reduce the storage cost and increase the working capability. For example,Order and Purchase table for a manufacture Company.

c) The Enity-Relationship modeling(or ER modeling)is a graphical representation of entities and their relationships to each other, used in organization of data within databases. An entity represents a discrete object and a relationship captures how two or more entities are related to one another.

Object Modeling technique is based on the concept of an “object” which is a data structure, which consists of data, and a set of routines, called methods/messages/functions, which operate on the data. It is used for figuring out what the objects of a system are, how they are related, and how they collaborate with each other.

d) Characteristics of DataWare house are:i) Subject Oriented ii) time Variant iii) Integrated iv) Non volatile

e) Shareware : It is made available with the right to redistribute copies. Proprietary : It is neither open nor freely available.

Q. 2 Answers to the given questions:

a ) Form Modules: A project is made up of modules, such as form modules. Form modules consist of small pieces called procedures. Their extension is .frm ,can contain textual descriptions of the form and its controls,including their property setting. In Form modules we can use general procedure also.

Class Module: .cls are the foundation of object-oriented programming in Visual Basic.You can write code in class modules to create new objects. These new objects can include your own customized properties and methods.

b) To load and unload Forms, use the Load and Unload statements. The Load/Unload statement has the following syntax:

Load formName

Unload formName

Page 6: Solved Question Papers and Hots of Class-XII IP

The formName variable is the name of the Form to be loaded or unloaded. Once a form is loaded,

it takes over the required resources, so you should always unload a Form that is no longer needed.

When a Form is unloaded, the resources it occupies are returned to the system and can be used by

other Forms and/or applications.

c) A DSN is a set of values that an application needs to correctly connect to a database. It includes

the name of ODBC driver, the name of the host database server machine, the path of the specific

database, the timeout connection, the name of the calling workstation, etc.

d) GotFocus event occurs when an object receives focus, and LostFoocus occurs when an object loses focus.

e) Date- Will display date in variant form and in mm/dd/yy format where leading 0 is not kept like

Suppose the date is 09-JULY-2008 then it displays 9/7/08.

Date$ - Will display date in string form and in mm-dd-yyyy format where leading 0 is there like

Suppose the date is 09-JULY-2008 then it displays 09-07-2008.

Call ByVal – This is a parameter passing mechanism in which a copy of the actual parameter is

passed to the called procedure. After the called procedure terminates the changes made to the

formal parameter by the called procedure are not reflected in actual parameters.

Call ByRef – Reference to the actual parameter is passed to the calling procedure. After the called

procedure terminates the changes made to the formal parameter by the called procedure are

reflected in actual parameters.

3.)a) To normalize the given relation we break the relation into two relations:

Employee(Empno, Empname, address, Salary, Doj, Deptno)Department(Dept_no, Dept_name)

b) If a table is dropped ,the views and indexes are no more in the same user.It will cause an error while viewing the view.

c) To drop a constraint you can identify the name of the constraint from theSyntax:

ALTER TABLE tablename DROP PRIMARY KEY|UNIQUE(column)|CONSTRAINT constraint[CASCADE];

d) Result of JOIN is:ROLL NAME CITY TNO TNAME TCITY 1 Divakar Delhi T1 Mr.Nayak Delhi 2 Puneet Mumbai T2 Mr.Dubey Mumbai

e) It becomes easy to declare composite variables to hold entire rows from a table or a query.

Page 7: Solved Question Papers and Hots of Class-XII IP

SECTION-BQ-4 Answers to the given questions:a) Public Function compareStr (ByVal str1 As string, ByVal str2 As string) As Integer

Dim ans As Integer If str1 = str2 Then ans=0 ElseIF str1 < str2 Then ans = -1 Else ans=1 End If compareStr = ansEnd Function

Private Sub cmdComp_Click() Dim st1,st2 As String Dim op1t As Integer St1=Text1.text St2=Text2.Text Opt=compareStr(st1,st2) If opt = 0 Then Label3.Caption =”Strings are Equal” ElseIf opt=1 Then Label3.Caption =”First string greater than second string” Else Label3.Caption = “Second string greater than first string” End if

End Sub

b) Option ExplicitDim arnum(10) as integerPublic Sub ArrayOperation(Byref arnum() As integer) Dim nstr As string Dim max,min,sum,avg opt as integer max=arnum(0) min=arnum(1) opt=1 print arnum(2) Do while opt<=4 Nstr=nstr+str(arnum(opt)+”,” If Max<arnum(opt)THEN Max=arnum(opt) End if If Min>arnum(opt) THEN Min=arnum(opt) End Sum=Sum+arnum(opt) Opt=opt+1 LOOP Avg=Sum/(opt-1) Text1.text=nstr Text2.text=Max Text3.text=Min Text4.text=Avg

Page 8: Solved Question Papers and Hots of Class-XII IP

Text1.Enabled =False Text2.Enabled =False Text3.Enabled =False Text4.Enabled =False End Sub Private Sub Form_Load() Dim ctr,nm As integer Ctr=1 Do while ctr<=4 Nm=Val(InputBox(“Enter any no”)) Arnum(ctr)=nm Ctr=ctr+1 LOOP Call ArrayOperation(arnum)End Sub

c) CCo

Com Comp Compu Comput Compute Computer

d) Private Sub Command1_Click()Dim a As longDim r as IntegerDim num as LongA=val(Text1.text)Num=reverse(a)Text2.text=numEnd SubFUNCTION reverse(By Val anum As Long) As LongDim rev As LongDo While anum<>0R=anum Mod 10Rev=rev*10+rAnum=Int(anum/10)LoopReverse=revEnd function

Q-5. Answers to the given questions: a) Sub Fibonacci(S1 as NUMBER,S2 as INTEGER,N as INTEGER)

Output S1,S2Dim count as Integer,dim term as IntegerFor count EQUAL 3 TO NTerm = S1+S2Print termS1=S2S2=termNext value

End sub

Page 9: Solved Question Papers and Hots of Class-XII IP

Corrected Code: Sub Fibonacci(S1 as INTEGER,S2 as INTEGER,N as INTEGER)

Print S1,S2Dim count as Integer, term as IntegerFor count =1 to N Term = S1+S2Print termS1=S2S2=termNext count

End sub

b) 20 40 40 c) 0

d) Mon,September22,2008

SECTION C6.) a) 20

20202020

b) DeclareB_No Number(4);

BeginB_No : = &Book_No;Select Title Into B_Title from Books WHILE Book_No = B_No ;If B_Title: = ‘Leaarning ABC’

Update Books set B_Title = ‘Learn ABC’ Where Book_No = B_No;Else

Dbms_output.Put_Line (‘No Change’);End if;

End;

c) Create or Replace Trigger KVS BEFORE INSERT ON EMP_KVS FOR EACH ROW Dbms_output.put_line(‘WELCOME TO KVS’);

END;

d) CREATE OR REPLACE PROCEDURE PRO_NUMBER(result OUT number)AS I number; Tot number :=0; BEGIN FOR I IN 1..10 LOOP Tot := Tot+i; END LOOP;

RESULT := Tot; END;

Page 10: Solved Question Papers and Hots of Class-XII IP

Q-7 Answers to the given questions:

a) Create table STUDENT ( RNo number(4) Primary key, Name varchar2(20) Not Null,

Stipend Number(7,2) check (stipend > 0), Stream varchar2(15) Grade varchar2(1))

b) DECLARE

BEGIN

FOR student_record In (SELECT rno, name, stipend, stream, avgmark, grade FROM

STUDENT)

LOOP

IF student_record.stream =’Medical’ and student_record.grade =’A’ Then

Dbms_output.put_line(student_record.rno||’ ‘||student_record.NAME||’ ‘||

student_record.stipend||’ ‘||student_record.avgmark);

END IF;

END LOOP;

END;

c) CREATE OR REPLACE PROCEDURE MYSTIPENED(rno IN NUMBER)

AS

St NUMBER;

BEGIN

SELECT stipined INTO st from STUDENT where rno=&rno;

Dbms_output.put_line(‘my stipened is’||st);

END ;

d) CREATE OR REPLACE FUNCTION fun_Power(a NUMBER,b NUMBER)

RETURN NUMBER AS pw NUMBER;

BEGIN

Pw := a ** b;

RETURN pw;

END;

* * *

Page 11: Solved Question Papers and Hots of Class-XII IP

SAMPLE PAPER - 2INFORMATICS PRACTICES – Class - XII

SET – Higher Order Thinking Skills

Time allowed: 3 hours Maximum Marks : 70Note:

(v) This question paper is divided into 3 sections.(vi) Section A consists of 30 marks.(vii) Section B and Section C are of 20 marks each.(viii) Answer the questions after carefully reading the text.

SECTION – A1. Answer the following questions :

(a) What do you know about the LAMP suit of programs? 2

(b) If the two related entities are STUDENT AND TEACHER, which type of relationship 2 is shown by them? Also draw the ER model for this relationship.

(c) Why high performance database and machines are needed for data warehouse? 2

(d) Name the Information Systems that produce the following reports: 2

(i) Invoicing detail(ii) Recruitment Summary Report.

(e) Suggest the situations where we need the following data gathering techniques: 2

(i) On – Site Observation (ii) Interview

2. Answer the following questions :

(a) Can you explain the difference between the following two statements: 1Text1.TextText1(Index).Text

(b) A variable is Local but it has Global Lifetime, which type of variable it is? 1

(c) Dolly declares two variables as follows but none of the declaration is correct, 2 can you suggest why?

i) Dim i% as Integer ii) Dim 1A as Integer

(d) Can you skip arguments in a function call? How? 1

(e) Roshan create an MDI application, but when he runs the application and open the child 1 form the menus of MDI form will disappear, Can you suggest the reason why?

(f) Give the use of Table type, Snap Shot, Forward Only and Dynamic Type Recordset? 4

3. Answer the following questions:

Page 12: Solved Question Papers and Hots of Class-XII IP

(a) What is Read Only View? Give an example of it. 2

(b) Give one advantage and one disadvantage of a serial execution of transaction. 2

(c) How are errors in a PL/SQL block be managed? Name the errors raised when 2 a query returned:

(i) No rows (ii) Many rows

d) Suggest the parameter modes for the following: 2i) Passed value must not get changedii) A value is to be received from a procedure but used in any expression

e) Compare and Contrast triggers and constraints. 2

SECTION – B4. Do as directed:a) Rewrite the following code using DO …. LOOP WHILE construct without changing output. 2

Sub My_Arr_Procedure( ) a = 5

DoPrint aa = a - 1

Loop While a < > 0 End Sub

b) Find the error in the following code and rewrite the correct code, underline the corrections 4 made:

i) Sub MyProc (X as Integer) ii) Private sub Check_Proc( )MyProc = X * X Call MyFun

End Sub End SubFunction MyFun (byVal a as Integer)

MyFun = a + a – 10End Function

c) Write a VB program to enter a number and print the product of its digit, as if a number 4 entered is 234 then the program gives o/p as 24.

5. Read the following case study and answer the questions that follow:The Cotton County showroom has computerized its billing. A new bill is generated for

each customer. The showroom allows three different payment modes. The discount rate is based on the payment mode. The following screen shot used to generate the bill:

Page 13: Solved Question Papers and Hots of Class-XII IP

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

Object Type Object Name Description

Form FrmDiscount The main form

Text Box

TxtAmt To input the total Shopping Amount

TxtDisc To display Discount Rate

TxtNet To display Net Price

Option Button

OptCash To select mode of payment as cash

OptCheque To select mode of payment as cheque

OptCredit To select mode of payment as credit card

Command Button

CmdCalc To calculate Discount and Net Amount

CmdClear To clear all textboxes

CmdExit To exit from the application

a) Write code for the CmdClear command button to clear all the textboxes. 1

b) Write the code for the form load event of FrmDiscount so as to 2

i) Disable the TxtDisc and the TxtNet textboxes and set default choice in the

option button as cash.

ii) Set the focus to the TxtAmt textbox.

c) Write the code for the change event of the TxtAmt textbox to ensure that the user does 2

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.

d) Write code for the CmdCalc command button to display the discount rate and net price 5

in the TxtDisc and TxtNet textboxes respectively. Note that net price is calculated

as shopping amount – discount amount. The discount amount is calculate according to

the discount rate which is based on the payment mode and total shopping amount

Page 14: Solved Question Papers and Hots of Class-XII IP

according to the following table.

Payment Mode Shopping Amount Discount RateCash < 10000 20 %

> = 10000 25 %Cheque < 15000 10 %

> = 15000 15 %Credit Card < 10000 10 %

> = 10000 12 %

Page 15: Solved Question Papers and Hots of Class-XII IP

SECTION – C6. Do as Directed: a) Write a PL/SQL script to print numbers 2,4,6,8,10,….,20 using for loop. 2b) Find the error(s), if any, in the following code: 2

DECLAREv_empno NUMBER[4];v_empname varchar2(20);

BEGINSelect empno, ename, sal Into v_empno, v_ename FROM emp FOR empno = 1234;

END;c) Find the O/P in the given PL/SQL block. 2

DeclareCount Number;Num1 Number;

BeginCount :=10;For num1 IN 5..8Loop

If Mod (num1,2)=0 thenCount :=count – num1;

ElseCount := count + 2 * num1;

End if;Dbms_output.put_line(count) ;

End Loop;End;

d) Write a PL/SQL function CHECK_YEAR that accepts a date from the user and 4

returns 1 if the year is a leap year and returns 0 otherwise.

7. Answer the questions based on the table Metro given below.

TABLE : MetroColumn name Data type Size Constraint DescriptionMT_No NUMBER 4 PRIMARY KEY Metro numberMT_Origin VARCHAR 2 15 NOT NULL Name of origin stationMT_Dest VARCHAR 2 15 NOT NULL Name of the final destination

stationMT_KM NUMBER 3 CHECK For greater

then 10Total kilometers from origin to destination

MT_Time NUMBER 4,2 DEFAULT 11.00 Time of the metro to start from the origin station

MT_Cap NUMBER 3 No. of seats in the metro

a) Write the SQL command to display the different destination without repetition. 2b) Write the SQL command to display number of metros starting from each MT_Origin. 2c) Write the PL/SQL code to change the destination OF ALL METROS ENDING AT “ABC” 3 Station to “XYZ” station which are covering a distance of more than 15 km.d) Write the PL/SQL code to create a stored procedure TIME to display the details of all the 3 metros which start at a particular time of the day which is entered by the user. The time should be accepted as a parameter.

* * *

Page 16: Solved Question Papers and Hots of Class-XII IP

SAMPLE PAPER - 2INFORMATICS PRACTICES – Class - XII

SET – Higher Order Thinking SkillsSOLUTIONS

Time allowed: 3 hours Maximum Marks : 70

SECTION A1) Answer the following questions: a) LAMP - Linux Apache Mozilla PHP ½ x 4= 2

b) Many to Many Relationship is there. 1 for Type, 1 for ER model 2

c) Since DW stores a large volume of data to support and accommodate possible types 2 of queries. To efficiently store and process and quesry on such large volumes of data, high performance platforms are needed that include high performance RDBMS, high performance O/S and high performance H/W.

d) i) The Invoice Management System produce invoicing details. 1 ii) The Human Resource Development System produce Recruitment Summary Report. 1 e) i) If the closer look of the real system is needed onsite observation is helpful. 1 For any manufacturing unit it is a well suited data gathering technique. ii) Interview helps to extract as much information as possible, as vital as possible, as 1 honest as possible. To know the performance of a product it is used.

2) Answer the following questions:a) Text1.Text - It is a text control.

½ Text1(index).Text - It is a control array of text.½

b) STATIC variable has local scope and global lifetime. 1

c) i) In Dim i% as Integer, since % is a type declaration for Integer so we can not use 1 it as a part of variable name.

ii) In Dim 1A as Integer, name of a variable can not starts with a digit. 1

d) Yes, if we declare arguments as OPTIONAL then this argument can be skip while 1 calling function.

e) If the MDI as well as Child form both having their own menus, then when child form is 1 loaded its menus takes over the menus of parent form and then parent menu bar is

TEACHERTAUGHT

STUDENT

Page 17: Solved Question Papers and Hots of Class-XII IP

disappear. f) Use of each Recordeset - 1 mark 1 x 4 = 4

3) Answer the following questions:

a) A Read Only View does not allow any updation of data on the base table. 1

Create view V_Read_Only_EMP as select * from EMP WITH READ ONLY 1

b) Advantage - Correct Execution – as only one transaction is running at a time 1 and if the I/P is correct then definitely the O/P is correct.

Disadvantage - Inefficient Resource Utilization 1

c) Errors in a PL/SQL block are managed by means of exception handling. 1i) NO_DATA_FOUND ½ ii) TOO_MANY_ROWS½

d) The parameter modes are: 2i) INii) OUT

e) Triggers affect only those row where insertions take place after the trigger is created 1 whereas a constraints can be made to affect all rows in the table.

Triggers can be used to define custom constraints, which might not be possible 1 through the inbuild constraints.

SECTION – B

4. a) 2Sub My_Arr_Procedure( )

a = 5Do Until a = 0

Print aa = a - 1

LoopEnd sub

b) 2 x 2 = 4

i) Funtion MyProc ( X as Integer ) ii) Private sub Check_Proc( )MyProc = X * X Msgbox MyFun (4)

End Function ORAns = Myfun (4)

End Sub

i) A Procedure can’t return a value. Function MyFun ( byVal a as Integer )MyFun = a + a – 10

ii) A function can not be called by Call Statement. End Function

Page 18: Solved Question Papers and Hots of Class-XII IP

c) Write a VB program to enter a number and print the product of its digit, as if a number 4 entered is 234 then the program gives o/p as 24.

5) a) Private sub CmdClear_Click ( ) 1

TxtAmt. Text = “ “TxtDisc.Text = “ “TxtNet.Text = “ “

End Sub

b) Private sub Form_Load ( ) 2

TxtDisc.Enabled = FALSETxtNet.Enabled = FALSEOptCase.Value = TRUETxtAmt.Setfocus

End Sub

c) Private sub TxtAmt_Change ( ) 2If Val (TxtAmt.Text) < = 0 then

Msgbox “Pls enter a valid amount”Txt.Amt = “ “

End IfEnd Sub

d) Private sub CmdCalc _ Click ( ) 5If Option1.Value = True Then

If Val(Text1.Text) < 10000 Then Text2.Text = 20 net = Val(Text1.Text) - Val(Text2.Text) Else Text2.Text = 25 net = Val(Text1.Text) - Val(Text2.Text) End If

ElseIf Option2.Value = True Then If Val(Text1.Text) < 15000 Then Text2.Text = 10 net = Val(Text1.Text) - Val(Text2.Text) Else Text2.Text = 15 net = Val(Text1.Text) - Val(Text2.Text) End If ElseIf Option3.Value = True Then If Val(Text1.Text) < 10000 Then Text2.Text = 10 net = Val(Text1.Text) - Val(Text2.Text) Else Text2.Text = 12 net = Val(Text1.Text) - Val(Text2.Text) End If

End If

Page 19: Solved Question Papers and Hots of Class-XII IP

Text3.Text = netEnd Sub

Page 20: Solved Question Papers and Hots of Class-XII IP

SECTION – C

6) a) Declare 2X number:=2;

Begin

For I In 1..10Loop

Dbms_output.put_line(X);X:=X+2;

End Loop;End;

b) DECLARE 2 V_empno NUMBER (4); V_empname varchar2 (20); S_salary ;

BEGIN

Select empno, ename, sal INTO v_empno, v_empname, S_salary FROM emp WHERE empno = 1234;

END;

c) 20 2142820

d) Declare 4Y Date;X number;

BeginY := ‘&Enter_Date’;X := To_Number(SUBSTR(Y,8,4));If Mod ( X, 4) = 0 then

Dbms_Output.Put_Line ( ‘Leap Year’ );Else

Dbms_Output.Put_Line (‘Not a Leap Year’);End if;

End;

8) a) Select Distinct (MT_Dest) from Metro; 2

b) Select MT_Origin, count (*) from Metro Group by MT_Origin; 2

Page 21: Solved Question Papers and Hots of Class-XII IP

c) Declare 3

Cursor Cur_metro IS Select MT_KM, MT_No from Metro where MT_Dest=’ABC’;

Rec Metro%RowType;

Begin

Open Cur_metro;

Loop

Fetch Cur_metro Into Rec;

Exit when Cur_metro%NOTFOUND;

If Rec.MT_KM > 15 then

Update Metro set MT_Dest=’XYZ’ where MT_No=Rec.MT_No;

End if;

d) Create or replace procedure TIME (T IN Number) AS 3

RecMetro Metro%ROWTYPE;

Begin

Select * Into RecMetro from Metro where MT_Time = T;

Dbms_output.put_line (RecMetro.MT_NO || RecMetro.MT_Origin || ….. );

End ;

* * *