The Air Force School Mock Pre-Board Marking Scheme 2016-17The Air Force School Mock Pre-Board...
Transcript of The Air Force School Mock Pre-Board Marking Scheme 2016-17The Air Force School Mock Pre-Board...
P.T.O. 1
The Air Force School Mock Pre-Board Marking Scheme – 2016-17
(INFORMATICS PRACTICES)
1.
(i) Write examples of one proprietary and one Open Source Software. 1
Proprietary software :MS Office, Oracle, Windows , Photoshop
Open Source Software: Linux, Google Chrome OS, Android smart, GIMP, OpenOffice,org,
Python, MySQL, Java,OR Any other correct answer for each type of software
( ½ mark for each correct answer)
(ii) What do you understand by LAMP? 1
LAMP is a web server program (Linux, apache, MySql, PHP). Apache Server is
the most common web server. MYSQL is one of the most popular open source
database system. Linux: - free and open source operating system . PHP is server side
programming language.
(iii)List any two measures to secure a network. 1
Measures to secure a network are:
Use of
(i) Login-Password
(ii) Firewall
(iii) Anti Virus Software
(iv) File permissions
(iv) Divyansh wants to download/upload files from/to a remote internet server. Which
communication protocol will let him do the same. 1
FTP – File Tranfer Protocol
(v) Differentiate between MAC address and IP address 2
MAC Address IP Address
MAC(Media Access Control) address
is a unique 12 digit hexadecimal number
assigned to each Network Interface Card.
IP (Internet Protocol ) address
is a numerical label that is
assigned to a device which is a part of a
computer network using Internet
Protocol
2
It is constant and cannot be changed. It Can be changed.
It is device dependent It is area dependent
e.g. 00.A0.C9:14:C8:35 e.g. 192.168.0.2
(vi) What is denial of services? Explain briefly. 2
Denial-of-services attacks: are those attacks that prevent the legal users of a system from
accessing or using the resources, information or capabilities of a system. This term
is also used to refer to any outwardly induced condition that renders a computer
unusable. It may be of following types:
a) Denial of Access to Information: Such attacks cause deletion or changing of impor
tant information to non-readable format.
b) Denial of Access to Applications: Such attacks make the applications unusable or
unavailable for legal user of the system.
c) Denial of Access to Communications: Such attacks includes cutting of communication
wire, jamming radio communications, flooding a system with junk mail.
d) SYN flooding: It is a denial of service attack. It takes advantage of a loop hole in the way
TCP connection are created.
e) Pentium F00F Bug: It is a series of assembly language code sent to genuine Intel Pentium
processor that reboots a machine.
(vii) Give 2 advantages and 2 disadvantages of star topology 2
Advantages of Star Topology
i. No disruptions to the network when connecting or removing devices.
ii. Easy to detect faults and to remove parts.
Disadvantages of a Star Topology
i. Requires more cable length than a linear topology.
ii. If the hub or concentrator fails, nodes attached are disabled.
2.
(a) Which property is used for setting the password character as „&‟. 1
P.T.O. 3
Echochar
(b) Which attributes of HTML are used to- 1
(i) path of the picture file to be displayed on a web page. <img src>
(ii) to combine more than 2 columns . colspan
(c) Give the value of variable „a‟ and „b‟ after the execution of the following code: 1
int a;
int b;
b=6;
a = (4 *(++b) )% 4 ;
a=0, b =7
(d) Distinguish between „%‟ and „ /‟ mathematical operator in Java. 1
„%‟ is a mathematical operator which returns the remainder after dividing the given
numbers while „/‟ is a mathematical operator which returns the quotient after
dividing the given numbers.
Eg 5%3= 2 and 5/3 =1
(e) Give any 2 features of XML. Explain with the help of an example that we can create our
own tags in XML. 2
FEATURES OF XML
1. XML is designed to carry data not to display data.
2. XML was created to structure, store and to send information.
3. XML is self-descriptive. Tags are not pre-defned; rather they are created to describe the
content in appropriate manner.
4. XML is free and extensible.
5. XML is platform independent.
XML tags are created by the user as there are no standard tags.
For example :
To store address , the tag <address> may be used as :
< address > Punjabi Bagh </ address >
(f) What will be value of x and y when following code will be executed? 2
int x = 5;
int y = 20;
4
while(x<=y)
x+=y--;
y+=2;
System.out.println(“Values are “+x+” “+y);
x=25
y=21
(g)Write the output that will be generated by the code given below: 2
int ans;
int i;
for (i = 15; i <=25; i = i+5)
ans = i+4;
System.out.println(" "+ans);
19
24
29
g. Write a function in Java that takes length and breadth of float data type as parameter and returns the
area of a rectangle. 2
float area(float l, float b)
float ans = l*b;
return ans;
h. Differentiate between Actual and Formal parameters 2
Actual Parameter A parameter used in the function call is known as Actual Parameter. It
is used to send the data to function.
Formal Parameter A parameter used in the function definition is known as Formal
Parameter, It is used to accept the data from actual parameter.
3.
(a) Distinguish between DROP TABLE and DELETE commands of MySQL. 1
DROP TABLE DELETE
The statement is used to delete a table This statement is used to REMOVE the rows in a
P.T.O. 5
table
It is a DDL command It is a DML command
It is non conditional command It is a conditional command
It cannot be rolled back. It can be rolled back.
The structure of the table is deleted hence no
more rows can be added after Drop Table
command.
New rows can be added after the execution of this
command.
(b) How is NULL value different from 0 (zero) value. 1
NULL means Unknown/No value/Empty while 0 is a numeric value.
(c) When using the LIKE clause, which wildcard symbol represents any sequence of
none, one or more characters 1
% (d) A table COURSE has 10 rows and 12 columns and table STUDENT has 12 rows and 8
columns. What is the cardinality and degree of the Cartesian product of the tables? 1
120 and 20
(e) A numeric column MONEY contains 98765.7896. Give the SQL commands to truncate
MONEY. 2
(i) Up to 2 decimal places. (i.e. expected result 98765.78)
SELECT ROUND (MONEY,2);
(ii) Up to -3 places (i.e expected result 98000)
SELECT ROUND (MONEY,2);
(f) What happens when ROLLBACK command is issued in a transaction process?
What is a savepoint? 2
ROLLBACK To revert all operations on transaction
SAVEPOINT Make a mark upto certain operations
(g) Is a primary and candidate key same. Explain ? 2
Candidate Key: All attribute combinations inside a relation that can serve as primary key
(uniquelyidentifies a row in a relation) are Candidate Keys as they are candidates for the primary key position.
Primary Key: It is a field or collection of fields through which a record can be uniquely
identified in a table. Primary keys may consist of a single attribute or multiple attributes in
combination.
6
4.
(a) Given a string object named Salary having value as “65000” stored in it. Obtain the output
of the following. 1
JOptionPane.showMessageDialog(null,””+Salary.length()+
Integer.parseInt(Salary)));
(b) What is a button group? Which control is generally used with a button group? 1
Button Group control manages the selected /unselected state for a group of radio
buttons/checkboxes.
RadioButton is generally used with a button group.
(c) Define Object Oriented Programming. Is a class same as an object. Clarify. 2
OOP (Object Oriented Programming) CONCEPT
The basic idea of OOP language is to combine data and the functions that operate on this
data into a single unit. Such a unit is called object. An object represents an entity that can
store data and has its interface through functions. The data of an object are data
members and functions are called member functions in java.
Class
It is a collection of characteristics and behaviors of an entity. For example HUMAN is an
entity. Characteristics are color, height, weight etc. Behaviors are to walk, to speak, to eat
etc. In java, class is a collection of data members and member functions which operates
on those members into one unit. Eg JTextField is a class.
Objects
It is an instance of a class which uses the common behaviors and characteristics of that
class. For example
KARAN is the instance of class HUMAN. JTextField1, JTextField2 are examples of
object.
(d) The following code has some error(s). Rewrite the correct code underlining all the
corrections made. 2
public Static Void Main (String [] args)
Integer Nos = 100;
while (nos => 45)
IF (Nos%5 = 0);
Nos+=10;
Otherwise
P.T.O. 7
Nos + = 20;
public Static Void Main (String [] args)
int Nos = 100;
while (Nos >=45)
if (Nos%5 == 0);
Nos+=10;
else
Nos + = 20;
(e) A table Employee has the following columns: Code, Name, Salary, Deptcode
Will the command SELECT Deptcode, Max (Salary) FROM Employee;
display maximum salary department wise.If not Rewrite the above query correctly 2
SELECT Deptcode, MAX(Salary) FROM Employee GROUP BY Deptcode;
(f) Rewrite the following program code using a if statement: 2
int C = jComboBox1.getSelectedIndex( );
switch (C)
case 0: FinalAmt = BillAmt;
break;
case 1: FinalAmt=0.9*BillAmt;
break;
case 2: FinalAmt= 0.8*BillAmt;
break;
default: FinalAmt= BillAmt;
int C = jComboBox1.getSelectedIndex( );
if (C==0)
FinalAmt = BillAmt;
else if (C==1)
FinalAmt=0.9*BillAmt;
else if (C==2)
FinalAmt= 0.8*BillAmt;
else
FinalAmt= BillAmt;
8
(g) Suman Enterprises wants to computerize its billing system.
Units Ordered Cost/unit
Whole Seller
1-30 Rs 50
31-50 Rs 45
>50 Rs 30
Retailer
1-30 Rs 60
31-50 Rs 55
>50 Rs 40
(i) Calculate the discount and total cost that a customer has to pay based on the conditions given
above.if units orederd is more than 1000 then the special customer check box should be selected
and a discount of 10% is to be given . The discount textfield should display 10% if checkbox is
selected else should display 0%. 3
private void cmdExitActionPerformed(java.awt.event.ActionEvent evt)
System.exit(0);
private void cmdCalcActionPerformed(java.awt.event.ActionEvent evt)
int ordUnit; // Order unit
float TCost=0; // Total cost
float Discount = 0 ; // Discount percent
ordUnit=Integer.parseInt(txtUnit.getText());
if (optWhole.isSelected()==true)
P.T.O. 9
if (ordUnit >= 1 && ordUnit <= 30)
TCost = ordUnit * 50;
else if (ordUnit >= 31 && ordUnit <= 50)
TCost = ordUnit * 45;
else
TCost = ordUnit * 30;
else if (optRetail.isSelected())
if (ordUnit >= 1 && ordUnit <= 30)
TCost = ordUnit * 60;
else if (ordUnit >= 31 && ordUnit <= 50)
TCost = ordUnit * 55;
else
TCost = ordUnit * 40;
if (ordUnit>1000)
Chk1.setSelected(true);
Dis=10;
Cost = TCost-TCost*10/100;
else
dis=0;
Cost=TCost;
T2.setext(“”+dis);
T3.setext(“”+cost);
(ii)Write the code to clear all textfields, deselect checkbox and set retail as the default category. Write
the code to exit the application. 2
Chk1.setSelected(false);
T1.settText(“”);
Retail.setSElected(true);
5.
10
(a) What is the difference between “%” and “ _ “ wild card character with reference to LIKE
clause of MySQL? 1
% stands for 0 to n number of characters .
_ stands for 1 fixed character
(b) Name a function of MySQL used to give the first occurrence of a string2 in string1. 1
Instring()
(c) State difference between date functions NOW() and SYSDATE() of MySQL. 2
NOW() returns the date and time at which the statement began to execute.
SYSDATE() returns the exact time at which the function executes. Sleep argument pauses
for the number of seconds given in the argument
(d) Mr Datta is using table STUDENTS with the following columns :
RNO, ADMNO, NAME, AGGREGATE.
He wants to display all information of students in descending order of name and ascending order of
aggregate. He wrote the following SQL query and did not get the desired output.
SELECT * FROM STUDENTS
ORDER BY NAME, AGGREGATE DESC;
Rewrite the above query to get the desired output.
SELECT * FROM STUDENTS ORDER BY AGGREGATE ASC, NAME DESC;
P.T.O. 11
6.
(a) Raj by mistake forgot to make item_no as the primary key in a table item . Give the command
to do so? 1
Alter table item add primary key(item_no);
(b) Write SQL command to change the width of column Item_Name to char(30) in a table item. 1
Alter table item modify item_name char(30);
(c) Write a MySQL command for creating a table "PAYMENT" whose structure is given below: 2
Table: PAYMENT
In a database there are two tables "Product" and "Client" as shown below: 2
Ans: CREATE TABLE PAYMENT
(Loan_no INTEGER(4) PRIMARY KEY ,
Payment_no integer(3) ,
Payment_date DATE ,
Payment_amount INTEGER (8) NOT NULL);
(d) In a Database BANK, there are two tables with a sample data given below:
Table: EMPLOYEE
Field Name Datatype Size Constraint
Loan_no Integer 4 Primary key
Payment_no Varchar 3
Payment_date Date
Payment_amount Integer 8 Not Null
ENO ENAME SALARY ZONE AGE GRADE DEPT
1 Amit 70000 EAST 40 A 10
2 Vinay 71000 West 45 B 20
3 Reena 60000 East 26 A 10
4 Abhay 65000 South 30 A 20
5 Surya 58000 North 30 B 30
12
Table: DEPARTMENT
DEPT DNAME HOD
10 Computers 1
20 History 2
30 English 5
(i)To display ENO, ENAME, SALARY and corresponding DNAME of all the employees whose age
is between 55 and 85 (both values inclusive) 2
Select ENO,ENAME,SALARY,DNAME
from EMPLOYEE E , DEPARTMENT D
where E.DEPT = D.DEPT and AGE between 55 and 85 ;
(ii) To display DNAME and corresponding ENAME from the tables DEPARTMENT and
EMPLOYEE. 2
Select DNAME,ENAME
from EMPLOYEE E , DEPARTMENT D
where D.HOD = E.ENO ;
(iii) To display ENAME, SALARY, ZONE and INCOME TAX which is calculated as 20% of salary
for all the employees and give it the heading income tax. 2
Select ENAME, SALARY, ZONE , SALARY * 0.2 INCOMETAX from EMPLOYEE ;
7.
(a) How has popularity of e-Business benefited a common man? 1
Improved speed of response
Improved efficiency and productivity
Cost savings
Convenient and comfortable for customers
Examples of e-Business site
www.amazon.com,www.ebay.com
(b) Give any 2 advantages and 2 disadvantages of e-Governance ? 2
Advantages
Improves transparency in governance
P.T.O. 13
Speedy governance
Brings more accountability
Checks corruption
Disadvantages
Manual methods cannot be avoided.
Network connection not available everywhere.
(c) John works for a Garments company. He has created a form for the employees. Help him choose
most appropriate controls from ListBox, ComboBox,TextField,TextArea, RadioButton, Checkbox,
Label and Command Button for the following entries: 2
S.No. Function
1 To select NATIONALITY from all the nationalities given as options Combo box
2 To enter AGE between a range 20 to 25 Text field
3 To allow to select one or more FAVORITE SPORT out of the given 6
options
List
4 To take SUGGESTIONS in the form of a paragraph Text area