Sie sind auf Seite 1von 7

Sree Sankara Bala Vidyalaya Golden Jubilee School & Junior College

Pallikaranai, Chennai – 600100.


Std : XII Pre Midterm Exam(2019-2020) Marks:70
Sub: Informatics Practices(Set 1) Time:3.00hrs

 All the Questions are compulsory


Q. Part Question Description Mark
No
1 (a) Identify the odd one out of the following statements. State reason for your choice. 1
i) switch ii) do while iii) while iv) for
(b) Ms. Meena is not able to understand the statement “Java is a case sensitive language”. 1
Help her in understanding the above mentioned statement by giving suitable example.
(c) Write the output of the following SQL queries: 1
SELECT POW(INSTR(‘My_Database’,’_’),2);

(d) What will be displayed in jTextArea1 after the following code is executed: 1
int i;
for(i=10;i<50;i=i+30)
{
i=i+15;
jTextArea1.append(""+i);
}
jTextArea1.append("\n"+i);
If there are 10 rows in ‘Emp’ table and 5 rows in ‘Department’ table, How many rows 1
will be displayed by the following query?
SELECT * FROM Emp, Department;
Write the term used for the Join being used on the two tables mentionedabove.
(e) Given below is HTML code. Rewrite the correct code underlining all the corrections 2
done.
<ol type = “A” start="D">
<li>Bake in oven for an hour
<li>Remove from oven
<li>Serve
2 (a) What is the purpose of SQL? 1
(b) Mr. Manav, a database administrator in “Global Educational and Training Institute” has 4
created following table named “Training” for the upcoming training schedule:

Help him in writing SQL query for the following purpose:


i. To count how many female candidates will be attending the training.
ii. To display list of free trainings.
iii. To display all the cities where Cyber Security training is scheduled along with its fee.
iv. To add a column feedback with suitable data type
(c) In today’s digitized world with a need to store data electronically, it is very important to 4
store the data in the databases. SQL is used to interact with the Database Management
System.
I. Classify the following commands according to their type :(DDL/DML) i.
INSERT INTO ii. ALTER TABLE II. Which clause would you use with Select to
achieve the following: i. To select the values that match with any value in a list of
specified values. ii. Used to display unrepeated values of a column from a table. III.
Chhavi has created a table named Orders, she has been asked to increase the value of a
column named salesamount by 20. She has written the following query for the same.
Alter table Orders Add salesamount =salesamount+20;
Is it the correct query?Justify.
(d) Dev, a website designer with “Creative Designers Pvt. Ltd.” has written the following 4
code. Observe the code given below and answer the following questions:
<company>
<employee eid=1>
<name>Albert</name>
<dept deptid=“d1”>Computer</dept>
</employee>
<employee eid=2>
<name>Manisha</name>
<dept deptid=“d2”>Accounts</dept>
</employee>
</company>
i.Are these tags part of HTML code or XML code?
ii. Identify the root element.
iii. Mention any two child elements.
iv. Mention any two attributes.
(e) Mention any two main differences between HTML and XML. Also mention any two 4
main features of XML for which it’s used extensively now a days.
(f) 1

3 (a) Consider the table given below. 5


Write Answer to (i). Write SQL queries for (ii) to (viii) and output for SQLqueries
(ix) and (x).

i. To display SID, Names along with Salaries increased by 500. (Increase of Rs.500 is
only to be displayed and not to be updated in the table),
ii. Display names of Salespersons and their Salaries who have salaries in the range
30000.00 to 40000.00.
iii. To list names, phone numbers and DOB (Date of Birth) of Salespersons who were
born before 1 st November, 1992.
iv. To display names and salaries of salespersons in descending order of salary.
v. To display areas in which Salespersons are working. Duplicate areas should not be
displayed.
(b) Consider the tables given below and answer the question that follows. 8

i. WorkshopId ‘552’ is missing in the table Workshop. Is there any discrepancy


(something not correct) ? Give reason for your answer.
ii.WorkshopId ‘551’ is present twice in the table Participant. Is there any discrepancy
? Give reason for your answer
Write SQL command for the following.
iii. To display names of Participants along with workshop titles for only those
workshops that have more than 2 speakers
iv. To display ParticipantId, Participant’s name, WorkshopId for workshops meant for
Senior Managers and Junior Managers.
v. To display WorkshopId, title, ParticipantId for only those workshops that have fees
in the range of 5000.00 to 8000.00
(c) Write the values that will be assigned to a, b, c and m after executing the following 2
Java code :
String p, q, r, a, b, c;
int m;
p = “AISSE2017”;
q = “Learning Java”;
r = “ Programming Fun ”;
a = p.substring(3,6);
b = q.concat(p);
c = r.trim();
m = c.length();
(d) Rewrite the following program code using IF ELSE IF instead of SWITCH statement. 2
String rem;
int code = Integer.parseInt(jTextField1.getText());
switch (code)
{
case 1 : rem = “Classes start on 8th April”;
break;
case 2 :
rem = “Classes start on 10th April”;
break;
case 3 :
rem = “Classes start on 12th April”;
break;
default : rem = “Contact Admin Office”;
}

(e) 1
(f) 2

(g) Write the output of the following SQL queries: 2


(i). SELECT MID(‘BoardExamination’, 2, 4);
ii). SELECT ROUND (67.246, 2);
iii).SELECT INSTR(‘INFORMATIONFORM’, ‘FOR’);
iv).SELECT DAYOFYEAR(‘2015-01-10’) ;
(h) Given below is the ‘Department’ table : 2

UPDATE Department SET DEPNAME = ‘OFFICE’ WHERE


DEPNAME = ‘ADMIN’;
INSERT INTO Department VALUES (104, ‘HRD’);
UPDATE Department SET DEPNAME = ‘FRONT OFFICE’ WHERE
DEPNAME = ‘RECEPTION’;
COMMIT;
DELETE FROM Department WHERE DEPNAME = ‘FRONT OFFICE’;
ROLLBACK;
SELECT * FROM Department;
What will be the output of the above given SELECT statement ?
4 (a) Ms. Arora is creating a form for accepting Visa applications. Help her to choose most 2
appropriate controls out of ListBox, ComboBox, TextField, TextArea, RadioButton,
CheckBox, Label and Command Button for the following entries.
S.NO FUNCTION
1 To enter Email-id
2 To choose Gender
3 To enter the country from the given as options
4 To enter REMARKS in the form of a paragraph about the purpose
of visit.
(b) Seema is a junior programmer at ‘Avon Shoe Factory’. She has created the following 6
GUI in Netbeans.
3 items namely Shoes, Sandals and Slippers are manufactured by the factory.
 A buyer can buy more than one item at a time.
 Each pair of shoes costs Rs.1,500.00, each pair of sandals costs Rs.1,000.00
and each pair of slippers cost Rs.500.00.
 The item bought will be selected by the user and the Quantity (number of
pairs) bought will be entered by the user.
 Amount to be paid for that item will be displayed in front of the item.
For example if ‘Shoe’ is selected and Quantity entered is 20, then Amount should be
displayed as 30000. Help Seema write code for the following:
(a) When ‘Calculate’ button is clicked, the amount should be displayed in front of
each item (in the appropriate textfield) and Total amount (sum total of all the
amounts) should be displayed in the appropriate textfield.
(b) When ‘exit’ button is clicked.it should be exit from output screen.
(c) When ‘clear’ button is clicked ,all the input controls should be cleared.

(c) Anju, a beginner in java programming has written following code with some 2
mistakes:
int k=0;
string s="Save Earth";
int l=s.length;
for(int i=0;k<l;i++)
{
jTextArea1.append(s+\n);
k++;
};
Help her in identifying and correcting the errors.
Convert the correct code into do while looping statement.
(d) Rewrite the following code using while loop: 2
int i,j;
for(i=1,j=2;i<=6;i++,j+=2)
System.out.println(i++);
System.out.println(“Finished!!!”);
(e) Explain the purpose of pow() method with the help of suitable java code. Also 2
mention that pow() method belongs to which class?
(f) Distinguish between isSelected( ) and setSelected( ) methods of java with the help of 4
example.
G What will be displayed in jTextField1 and jTextField2 when the following code is
executed?
Int x,y,z,t;
X=3;
Y=8;
Z=x+y/8;
T=z++;
jTextField1.setText(“”+z);
jTextField2.setText(“”+t;)
What will be displayed in jTextField1 and jTextField2 when the following code is
executed?
Int x,y,z,t;
T=3;
Z=0;
Do{
Z=z+1;
}
While(t>3)
jTextField1.setText(“”+z);
jTextField2.setText(“”+t;)
Write the output that will be displayed on jlabel1 and jlabel2.
Stirng a,b,c,d,x;
A=”Keep”;
B=”your”;
C=”surroundings”;
D=”clean”;
Int e=b.length()/4+d.length()*2;
X=b+c+d;
X=a.concat(x);
Jlabel1.setText(“The value of e =”+e);
jLabel2.setText(x.toUpperCase());
Table student has the column RNO and Score.It has 3 rows init.Following two SQL
statement were entered that produced the output ( AVG(SCORE) AS 45 AND
COUNT(SCORE) AS 2):
DATA is SCORE column is same in two rows. What data is present in the SCORE
coloumn in the rows?
What will displayed in jtextField1 when the following code is executed?
Int x=3,y=6,z=0;
If(x>3)
Z=z+1;

If ( (x<4) && <y>6))


Z=z+1;

If(x>2 && y>=6)

Z=z+3;
If(x<3 | y>6)
Z=z+4;
jTextField1.setText(“ “+z);
Write the output in jTextField1 when the following code is executed

Int k,n,sum=0;
For(k=2; k<=5; k++)
{
N=k-2*3;
Sum=sum+n;
}
jTextField.setText( “ “+sum);

Das könnte Ihnen auch gefallen