(agra region) session ending examination 2017-18 …

14
KENDRIYA VIDYALAYA SANGATHAN (AGRA REGION) SESSION ENDING EXAMINATION 2017-18 SUBJECT: INFORMATICS PRACTICES (065) CLASS-XI (SOLVED PAPER) TIME: 3 HRS MAX. MARKS: 70 General Instructions: (i) All questions are compulsory. (ii) Write the questions no. properly. (iii) Programming Language Java & Database MYSQL Q 1. Answer the following questions: (a) What is an operating system? Give two examples of an operating system? [1] (b) What is the difference between hardware and software? [1] (c) What is a computer virus? [1] (d) Write the full form of RAM and MICR [1] (e) Give one example for each of the following: [2] (i) A language processor. (ii) A utility software. (iii) A package software. (iv) Anti Virus. (f) Differentiate between Compiler and Interpreter. [2] (g) Write any two differences between System s/w and Application s/w. [2] Q. 2. (a) What do you understand by Java Byte Code? [1] (b) What is the difference between TextField and Text Area? [1] (c) What is the difference between ‘x’ and “x”? [1] (d) What is the significance of default clause in switch case statement? [1] (e) What is Program Maintenance? [2] (f) What is entry controlled and exit controlled loop? Give example. [2] (g) Write a program to find the factorial of an integer number. [2] Q. 3. Answer the following questions: (a) Write a command to view the structure of a table Employee. [1] (b) What is the significance of DELETE command in SQL? [1] (c) Differentiate between Char and Varchar datatypes in MySql. [2] (d) Define Primary Key. How it is different from Unique Key. [2] (e) Explain SQL subcategories giving at least one example in each category. [2] (f) Hari wants to add a column email of varchar type with size 20 in an existing table emp. Help him to write the command. [2] Q. 4. Answer the following questions: (a) What output will the following code fragment produce int val, Res, n=1000; Res=n+val>l750 ? 400 :200; System.out.println(res); (i) If the input is 2000. [1] (ii) If the input is 500. [1] To know about more useful books for class-11 click here

Upload: others

Post on 11-Nov-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

KENDRIYA VIDYALAYA SANGATHAN(AGRA REGION)

SESSION ENDING EXAMINATION 2017-18SUBJECT: INFORMATICS PRACTICES (065)

CLASS-XI(SOLVED PAPER)

TIME: 3 HRS MAX. MARKS: 70

General Instructions: (i) All questions are compulsory. (ii) Write the questions no. properly. (iii) Programming Language Java & Database MYSQL

Q 1. Answer the following questions: (a) What is an operating system? Give two examples of an operating system? [1] (b) What is the difference between hardware and software? [1] (c) What is a computer virus? [1] (d) Write the full form of RAM and MICR [1] (e) Give one example for each of the following: [2] (i) A language processor. (ii) A utility software. (iii) A package software. (iv) Anti Virus. (f) Differentiate between Compiler and Interpreter. [2] (g) Write any two differences between System s/w and Application s/w. [2] Q. 2. (a) What do you understand by Java Byte Code? [1] (b) What is the difference between TextField and Text Area? [1] (c) What is the difference between ‘x’ and “x”? [1] (d) What is the significance of default clause in switch case statement? [1] (e) What is Program Maintenance? [2] (f) What is entry controlled and exit controlled loop? Give example. [2] (g) Write a program to find the factorial of an integer number. [2] Q. 3. Answer the following questions: (a) Write a command to view the structure of a table Employee. [1] (b) What is the significance of DELETE command in SQL? [1] (c) Differentiate between Char and Varchar datatypes in MySql. [2] (d) Define Primary Key. How it is different from Unique Key. [2] (e) Explain SQL subcategories giving at least one example in each category. [2] (f) Hari wants to add a column email of varchar type with size 20 in an existing table emp. Help him to write the

command. [2] Q. 4. Answer the following questions: (a) What output will the following code fragment produce int val, Res, n=1000; Res=n+val>l750 ? 400 :200; System.out.println(res); (i) If the input is 2000. [1] (ii) If the input is 500. [1]

To know about more useful books for class-11 click here

Oswaal CBSE Solved Paper - 2018, INFORMATICS PRACTICES, Class-XI [ 7

To know about more useful books for class-11 click here

(b) What will be the final value of digit? [2] int digit ; for(digit = 0; digit <= 9; digit+ + ) System. out. print(digit); digit = 2 * digit ; - - digit; (c) Find the syntax error(s), if any in the following program; Rewrite the code after making the correction. [2] int sum;value;incr; int I; for(i= =0,i<=10,i+ + ) sum+=i; incr++; (d) Rewrite the following code using while loop: [2] int sum=0; for(int i=l;i<=5;+ + i) { sum =sum +c; } System.out. println(sum); (e) Write the equivalent switch statement for the following: [2] int Ch; Ch=Integer.parseInt(ChTextField.getText()); if(Ch = = 1) {System.out.println(‘‘ Arts”); } else If(Ch = = 2) {System.out.println(“ Commerce”); } else if(Ch= = 3) {System.out.println(“Science”); } else { System.out.println(“Invalid Entry”);} (f) Create a Java Desktop Application to find the Discount of an item on the basis of Category of item [Electrical

Appliance/Electronic Gadget / Stationary J.The Categories will be implemented in JRadioButton controls. The Discount will be calculated as follows: [3+1+1]

Cost Discount (%)

<=1000 5

Otherwise 10

The extra Discount will be calculated as followes:

Category Discount (%)

Electrical Appliance 3

Electrical Gadget 2

Stationary 1

(i) Calculate the total discount as : Discount on cost + Discount on Category Calculate the discount amount as: cost * discount & display it in txtDiscount.

(ii) Write the code to make txtDiscount uneditable. (iii) On clicking of Exit Button, it will exit the application

8 ] Oswaal CBSE Solved Paper - 2018, INFORMATICS PRACTICES, Class-XI

To know about more useful books for class-11 click here

Control Properly Name Property Value

JFrame Title Discount Calculator

Jlabel1 Text Enter Cost

Jlabel2 Text Discount

JTextField1 Variable Name txtCost

JTextField2 Variable Name txtDiscount

JRadioButtonl Text Electrical Appliance

Variable Name rdbtnl

Text Electrical Gadget

JRadioButton2 Variable Name rdbtn2

Text Stationery

JRadioButton3 Variable Name rdbtn3

JButtonl Variable Name btnComp

JButton2 Variable Name blnExit

Q. 5. Answer the following questions: (a) Which command is used to change column size from VARCHAR (10) to VARCHAR (50)? [1] (b) What is a NULL value? [1] (c) What is MySql? Write any two features? [2] (d) After creating the “employee” database, you want to use it. Write the command that you should give. [1] (e) What will be the output of the following : [2] (i) SELECT ROUND(22.417) + POW(4,3) ; (ii) SELECT LOWER (SUBSTR (TRIM (‘KENDRIYA VIDYALAYA SANGATHAN’), 4,10)); (iii) SELECT LEFT(TRIM(‘IPL2014-12APR’),5); (iv) SELECT CONCAT(CONCAT(‘INFORM’,’ATICS’),’PRACTICES’); (f) Write the purpose of ORDER BY clause using suitable example. [2] (g) Which command is used to make changes permanent? [1]

Oswaal CBSE Solved Paper - 2018, INFORMATICS PRACTICES, Class-XI [ 9

To know about more useful books for class-11 click here

Q. 6. Write SQL commands for the queries given from a to f and write the output of the SQL commands given in part g based on a table LIBRARY shown below: [8+2]

Table: LIBRARY

No. Title Author Subject Publisher Quantity Price

1 Data Structure Lipschute DS McGraw 4 217.00

2 DOS Guide NORTRON OS PHI 3 175.00

3 Turbo C++ Robort Lafore Prog Galgotia 5 270.00

4 Dbase Dummies Palmer DBMS PustakM 7 130.00

5 Mastering Windows Cowart OS BPB 1 225.00

6 Computer Studies French FND Galgotia 2 75.00

7 COBOL Stern Prog John W 4 1000.00

8 Guide Network Freed NET Zpress 3 200.00

9 Basic for Beginners Norton Prog BPB 3 40.00

10 Advanced Pascal Schildt Prog McGraw 4 350.00

(a) To display the title of all books with Price between 100 and 300. (b) To display Title and Author of all the books having type Prog and published by BPB. (c) To display the list of all the books with price more than 130 in ascending order of Qty. (d) To display the list of all books whose quantity is less than 4. (e) To display the publishers and the number of books of each book in the table. (f) To insert a new book in the table LIBRARY. (g) To increase the price of the book title ‘TURBO C++’ by Rs.30. (h) To display the Title and Total Price of all Computer books. The Total Price is calculated as Price * Qty. (i) Write the output of the following: (i) Select MIN(Price) from Library; (ii) Select Sum(Price * Qty) from Library where Qty > 3; (iii) Select Avg(Price) from Library where Qty < 4; (iv) Select Count(Distinct Publisher) from Library; Q. 7. Answer the following questions: (a) What is e-Governance? [1] (b) What is e-Learning, how e-Learning will benefit you? [2] (c) Write two advantage of e-Business sites [2]

10 ] Oswaal CBSE Solved Paper - 2018, INFORMATICS PRACTICES, Class-XI

To know about more useful books for class-11 click here

1. (a) Operating System is defined as a collection of programs that coordinates the operations of computer hardware and software. It acts as a bridge for the interface between man and machine. Examples of Operating System are: Windows, Linux, BOSS etc.

(b) All the physical components of the computer system are said to be as Hardware. For example: keyboard, mouse, monitor, printer etc. Whereas, Software represents the set of programs that govern the operations of a computer system and make the hardware run smoothly.

(c) Virus are the programs that can copy itself and can affect the health of the computer system. Viruses can automatically be transferred from one computer to another when its host is taken to the target computer.

(d) RAM – Random Access Memory. MICR – Magnetic Ink Character Recognition. (e) (i) Fortan, COBOL processor. (ii) Quick Heal, Disk Defrag. (iii) MS Office, Adobe Creative. (iv) Quick Heal, Norton, (f) Compiler converts the high level language

program into machine language in one stroke. Whereas, Interpreter converts the high level language into machine language line by line. It takes one statement at a time of HLL and converts it into machine code.

(g)

System Software Application Software

System software are mandatory for all computer systems to work.

Application software are made to perform the specific task.

For example: Operating Systems like BOSS, Windows and language processors like assembler interpreter and compiler.

For example: Word Pad, MS-Word etc.

2. (a) Byte code is the compiled format for Java programs. Once a Java program has been converted to byte code, it can be executed by Java Virtual Machines (JVM).

(b) Text field allows the user to enter single line of text only, whereas text area component allows accepting multiple line input from the user.

(c) ‘x’ indicates that this value is a single character and can be stored by a variable having the data type as char. Whereas, “x” indicates that even though it’s a single character, but it is going to be stored in the variable having data type as String.

(d) When the value does not matches with any case of switch statement then the statements written in default case are executed.

(e) Program maintenance can be defined as the modification of the program after delivery to improve its performance and to make it more reliable to handle the updated needs and emerging threats.

(f) The loop in which test condition is checked in the beginning of the loop, are known as entry controlled loop. For Example: while loop. Whereas, when statements inside the loop body is executed and then the condition is checked that loop is known to be as exit controlled loop. For Example: do-while loop.

(g) class factorial { public static void main(String args[ ]) {int n, c, fact = 1; System.out.println(“Enter an integer to

calculate it’s factorial”); Scanner in = new Scanner(System.in); n = in.nextInt(); if (n < 0) System.out.println(“Number should be non-

negative.”); else { for (c = 1; c <= n; c++) fact = fact*c; System.out.println(“Factorial of “+n+” is =

“+fact); } } } 3. (a) DESC Employee; (b) It helps the users to delete the record from the

Table. (c) The Char data-type stores fixed length strings.

If a string to be stored in a field having length smaller than the field size then padded on the right is done automatically before being stored.

Whereas, Varchar supports variable length strings and therefore if the string to be stored is smaller than the field size it stores without modification. And hence, it saves memory.

(d) In a table primary key is an attribute which is used to identify the records uniquely. A table can have multiple unique keys, but only 1 of them is the primary key.

Oswaal CBSE Solved Paper - 2018, INFORMATICS PRACTICES, Class-XI [ 11

To know about more useful books for class-11 click here

(e) SQL commands can be classified into following categories:

(i) Data Definition Language(DDL): They are used to define the structure of tables and other objects in a database. For example: CREATE, ALTER, DROP, TRUNCATE, RENAME.

(ii) Data Manipulation Language(DML): They are used to manipulate and access the data in the database. For Example: SELECT, INSERT, UPDATE, DELETE, LOCK TABLE.

(iii) Transaction Control Language(TCL): Used to manage transactions in the database. They are also used to manage the changes done by DML statements. For Example: COMMIT, SAVEPOINT, ROLLBACK, SET TRANSACTION.

(iv) Data Control Language(DCL): These commands are often used by Database Administrators and are considered as expert level commands because they are used to assign security levels in a database. Also, they are used to grant and define role and access privileges to the users. For Example: GRANT, REVOKE.

(f) ALTER TABLE emp ADD email VARCHAR(20); 4. (a) As there is no statement of input is given in the

question. Hence, it should be a tricky question. As by default when we declare an integer in Java, it stores the value 0(zero). Hence, the value of val=0.

(i) Output: 200 (ii) Output: 200 (b) 17. (c) int sum, value, incr; int I; for ( i=0; i<=10; i++) sum+=I; incr++; (d) int sum=0, i=1; while(i<=5) {sum=sum+c; i++; } (e) int Ch; Ch=Integer.parseInt(ChTextField.getText()); switch(Ch) { case ‘1’ : System.out.println(“Arts”); break; case ‘2’: System.out.println(Commerce); break; case ‘3’: System.out.println(Science);

break; default: System.out.println(Invalid Entry); } (f) (i) Code Snippet: float CostDisc, TotalDisc, temp, cost,

discountoncost, disountoncategory; cost= Integer.parseInt(txtCost.getText()); if(cost<=1000) discount on cost=.05; else discount on cost=0.10; if (rebtn1. is Selected( )) discount on category=.03; else { if (rebtn2. is Selected( )) discount on category=.02; else discount on category=.03; } Cost Disc=cost*discount on cost; temp=cost*discount on category; TotalDisc=CostDisc + temp; txt Discount.setText (TotalDisc); (ii) txt Discount.setEditable(False); (iii) System. exit(0); 5. (a) ALTER command with MODIFY command

should be used for this purpose. (b) In My SQL, the empty values are represented as

NULL in a table. When we perform arithmetic calculations to a NULL value it will still remain null because mathematical operations cannot be performed on NULL value.

(c) My SQL is Structured Query Language based open source Data Base Management System. Two features of MySQL are:

(i) Cross-Platform support. (ii) Free to download and use. (d) USE employee; (e) (i) 86. (ii) driya vidy (iii) IPL20 (iv) INFORMATICSPRACTICES (f) In SQL ORDER BY command is used to sort the

results of the query. Syntax: ORDER BY column name sorting

mechanism; For Example: SELECT Salary FROM Employee

ORDER BY Salary DESC; The above statement will display the Salary

of Employees in descending order from table Employee.

(g) COMMIT command is used to make changes permanent.

12 ] Oswaal CBSE Solved Paper - 2018, INFORMATICS PRACTICES, Class-XI

To know about more useful books for class-11 click here

6. (a) SELECT Title FROM LIBRARY WHERE (Price BETWEEN 100 AND 300);

(b) SELECT Title, Author FROM LIBRARY WHERE (Subject=’Prog’ AND Publisher=‘PBP’);

(c) SELECT * FROM LIBRARY WHERE Price>130 ORDER BY QUANTITY ASC;

(d) SELECT * FROM LIBRARY WHERE Quantity<4;

(e) SELECT Publisher, Quantity FROM LIBRARY; (f) INSERT INTO LIBRARY VALUES (11,’Question

Bank’, ‘Expert’, ‘IP’, ‘Oswaal Books’,10,150); (g) UPDATE LIBRARY, SET Price = Price+30

WHERE Title = ‘TURBO C++’; (h) SELECT Title, Price*Quantity FROM LIBRARY; (i) (i) 40.00 (ii) 1620 (iii) 143 (iv) 7 7. (a) It refers to application which provides

electronic solution for governance to fulfil the requirements of common man in least possible time at affordable costs.

(b) e-learning describes as a means of teaching and learning through e-technology like Internet

and multimedia, CD ROM or DVD. Some advantages of e-Learning are:

(i) It provides faster learning at low cost. (ii) Makes learning easy because student don’t

have burden of creating notes in class, they can concentrate on understanding the concepts.

(iii) It makes learning very easy as it typically along with written paragraphs they also contain audio and videos.

Some mostly used websites for e-Learning are: www.teachlearnweb.com, www.byjus.com. www.meritnation.com, www.extramarks.com

(c) Some benefits of e-Business are: (i) It reduces cost of production. (ii) Everyone can access the market with

comfort at home. (iii) It increases transparency of prices. (iv) Major companies provides 24/7 customer

service which is best for the users. (v) Easy orders cancellation and refund

process.

KENDRIYA VIDYALAYA SANGATHAN(JAMMU REGION)

SESSION ENDING EXAMINATION 2017-18 CLASS XI

SUBJECT- INFORMATICS PRACTICES(SOLVED PAPER)

TIME: 3:00 Hrs. Max. Marks: 70

Instructions: (i) All questions are compulsory. (ii) Answer the questions after carefully reading the text.

1 (a) What is the function of ALU? 1 (b) Expand the following 1 BIOS, BOSS (c) 1 TB(Tera Byte) = ? GB. 1 (d) Define firewall. 1 (e) Give one example of the following - (i) Web Browser (ii) File Compression Utility (iii) Developer Tools (iv) Database Management System. 4 (f) (i) Differentiate between Virus & worm. (ii) What do you mean by Biometric identification of a person? Suggest any two application areas where

biometric devices can be used. 4 2 (a) (i) Identify the invalid identifiers from the following and also give justification name$s, rollno, amount2,

92_xy, myprocess (ii) Write the java statements to declare a variable named ‘amount’ which may hold the value 400. Then

decrease the value of amount to 50 and store it again ‘amount’ 4 (b) Evaluate the following expression: 2 (i) X= k++ <=15, if value of k is 15 initially Give answer from given choices. (True/False) (ii) Evaluate y ++x + 3x, if x = 5 initially (tell value of y). (c) (i) What is the difference between implicit and explicit type conversion? Give example in each category. (ii) What do you mean by comments and Indentation? How single line and multiline comment are given in

a Java Program. 4 3 (a) What is a relation? 1 (b) Write name of any two RDBMS. 1 (c) Define cardinality and degree, Justify your answer with example 2+2 (i) Help Mr. Kamal, a student of class XI who wants to do the following task in MYSQL: • Open existing database school. • See the existing tables in the database school. • To see all the records of table student. • To remove the table student from memory. (d) What is Primary key? What is its purpose in a table? 4 (i) Predict the output of the following queries- • Select mid(‘Annual Examination’,8,4); • Select round(355.856,1); • Select concat(“abc”, concat(“pq”,”xy”)); • Select UPPER(“FitTneSS”);

To know about more useful books for class-11 click here

14 ] Oswaal CBSE Solved Paper - 2018, INFORMATICS PRACTICES, Class-XI

To know about more useful books for class-11 click here

4 (a) Ramesh wants to disable jTextField1 at runtime. Suggest him the suitable method to be used for this purpose. 1

(b) Name any two container controls in Java. 1 (c) Differentiate between jTextField and jLabel. 1 (d) (i) Rewrite the following code segment using switch case statement: if (ch ==1) counta++; else if (ch==2) countb++; else if (ch==3) countc++; else counte++; (ii) Convert following code using for loop: int stripes=0; while(stripes <=13) { if(stripes%2==0) System.out.println(“CODE RED”); else System.out.println(“CODE BLUE”); System.out.println(“NEW STRIPES”); stripes=stripes+l; } (e) The following code has error(s). Rewrite the correct code and underline all the corrections made: integer num=20,i=l; long sum=0; do(i<num) { sum+=i ++i; } jTextFieldl.Settext(“”+sum); (f) The following GUI form has been created in Netbeans to calculate the total wages of worker. Number of days

and over time hours are to be entered by the user, wages and total amount should be calculated by program.

Control Control Name

Number of day jTextField1

Wages jTextField2

Over time h. jTextField3

Ov. Time am jTextField4

(a) Write code to make jTextField2 and jTextField5 un-editable at runtime. (b) Write the coding to calculate and display the wages when user click on Calculate Wages button based on

the following table:

Male 500 Rs per Day

Female 550 per Day

(c) Write the coding to calculate and display the over time amount, total amount when user click on the Total Amount button. Total amount is sum of wages amount and over time amount.

Over time amount should be calculated by using following table:

Male 1. 100 Rs perHour

Female 2. 125 Rs per Hour

Oswaal CBSE Solved Paper - 2018, INFORMATICS PRACTICES, Class-XI [ 15

To know about more useful books for class-11 click here

5 (a) Differentiate between char and varchar. Justify your answer. 2 (b) Write SQL query to create a table “EMP” with the following structure: 2

Column name Dala type Size

EMPNO Integer 4 digits

ENAME Varchar 25 characters

GENDER Char 1

DOB Date

SAL Decimal 7,2

(c) Predict the output based on the following table- 4 STUDENT

Rollno Name Class Gender Hobby Fees

101 AMAR 10 M Painting 100

102 MANI 7 F Drama 200

103 RAMA 6 F Cooking 150

104 SHAMA 10 F Cooking 250

105 KAJOL 9 F Sports 100

106 BUNTY 5 M Drama 120

107 AKBAR 4 M Sports 150

108 TONY 8 M Sports 100

109 JEETU 9 M Painting 200

(i) SELECT Hobby from Student WHERE Fees IN (120,150); (ii) SELECT LEFT(name,3) FROM Student WHERE Gender=’M’; (iii) SELECT DINSTICT Hobby FROM student; (iv) SELECT Name, Fee+100 From Student where Hobby=”Sports” And Class < 8; (d) On the basis of the Table Student in Que. No. 5(c), write SQL commands for the following; 2 (i) Arrange records of student table in the ascending order of name (ii) Show rollno, name of those students whose name start with ‘A’’ and fee in the range 200 and 250. 6 (a) Differentiate between alter and update commands. Give example. 2 (b) Consider the following table and write SQL queries for i) to vi) 6 STAFF

EMPNO ENAME GENDER DOB DEPTNO SAL

1001 RAHIM M 2002-01-20 10 8500

1002 AMAR M 2001-03-20 11 9500

1003 SURYA F 2004-11-25 10 9000

1004 ANIL M 2005-10-23 13 11000

(i) To Display ENAME, GENDER, DOB for all the employees who are the not working in the Deptno 10 and 13.

(ii) To Display the ENAME, GENDER and SAL of employees who are born in the year 2005. (iii) Write a query to display name and Date of Birth whose Salary lies in range of 9000 to 10000. (iv) Write a query to display details of all male employees whose salary is more than 10000. (v) Write a query to increase the SAL of all the female employees by 5% of Salary. (vi) Write a query to delete the record for Empno 1004. (c) Differentiate between SYSDATEQ and NOWQ function? 2

16 ] Oswaal CBSE Solved Paper - 2018, INFORMATICS PRACTICES, Class-XI

To know about more useful books for class-11 click here

7 (a) You are making an GUI application, which swing control you will pick from Text Box, Label, Radio Button, Check Box, List Box, Combo Box, command button for following given Function / Purpose. 2

S.No Function/Purpose of Control

1 Choose gender

2 Enter Address

3 Hobbies

4 Choose country Name

(b) Write down any two benefits of net banking. 2 (c) Give two examples each of major e-Governance web sites. 1

Oswaal CBSE Solved Paper - 2018, INFORMATICS PRACTICES, Class-XI [ 17

To know about more useful books for class-11 click here

SOLU-TIONS

1. (a) Arithmetic Logic Unit. (b) Basic Input/Output System, Bharat Operating System Solutions. (c) 1024 GB. (d) A firewall is used for network security. Its objective is to control the incoming as well as outgoing traffic by

analysing the data packets and determining that it should be sent/received or not. A firewall can be software as well as hardware based.

(e) (i) Google Chrome. (ii) WinRAR. (iii) Netbeans. (iv) MySQL. (f) (i) Virus is a program with malicious intention to corrupt important files and data. Worm is self-replicating program that expands itself with every program run and eat up all the memory

and make system crash. (ii) Biometrics or sometimes called biometric authentication is referred to the identification of humans by

their traits or characteristics like retina, DNA scan, finger prints. Biometrics is used in computer science as identification and access control.

2. (a) (i) 92_xy is invalid identifier because an identifier cannot start with a numeric character. (ii) int amount=400;

amount-=50;

(b) (i) False. (i) Note: This is a tricky question. Because, in programming there is nothing like 3x. It is valid in algebra but

in the terms of programming it should be written as 3*x. Hence, this statement will give error. (c) (i) In Implicit type conversion conversion java compiler converts all operands up to the type of largest

datatype. For example: int i=4;

double K = 2*2.5+i;

Whereas , in explicit type conversion, conversion is user defined that forces an expression to be of specific data type converting it explicitly.

For example: double d=4.25;

int i= (int)d;

3. (a) A relation is a table with columns and rows which represent the data items and relationships amongst them. (b) MySQL and MSSQL. (c) (i) Degree refers to the number of columns and cardinality refers to the number of rows in a table. If R is a

relation with 7 rows and 6 columns, then Degree: 6 and Cardinality: 7. (ii) • USE school; • SHOW TABLES; • SELECT * FROM student; • DROP student. (d) (i) In a table primary key is an attribute which is used to identify the records uniquely. Sometimes combination

of more than one attributes are declared as primary key, in that case primary key is known as composite key.

(ii) • Exam • 355.9 • abcpqxy • FITTNESS

18 ] Oswaal CBSE Solved Paper - 2018, INFORMATICS PRACTICES, Class-XI

To know about more useful books for class-11 click here

4. (a) He can use setEditable( ) method for this purpose. (b) Frame, Window. (c) jTextField is typically used to take input from the user. Whereas, jLabel is used to make the application more

understandable using proper identification terms and names for the controls. It can be said that jLabel is somewhat non-editable jTextField.

(d) (i) switch (ch) {

case 1: counta++;

break;

case 2: countb++;

break;

case 3: countc++;

break;

default: counte++;

}

(ii) for(stripes=0; stripes<=13; stripes++) {if(stripes%2==0)

System.out.println(“CODE RED”);

else

System.out.println(“CODE BLUE”);

System.out.println(“NEW STRIPES”);

}

(e) int num=20,i=1; long sum=0;

while(i<num)

{

sum+=i;

++i;

}

OR int num=20,i=1;

long sum=0;

do

{

sum+=i;

++i;

} while(i<num);

(f) (i) jTextField2.setEditable(false); jTextField5.setEditable(false);

(ii) Let us assume that for male the radio control is referred by rMale and for female it is referred by rFemale. Code Segment: int wages;

if(rMale.isSelected())

wages=500;

if(rFemale.isSelected())

wages=550;

jTextField2.setText(wages);

(iii) Code Segment: int hours, wages, overtime;

wages=Integer.parseInt(jText Field2.getText());

hours=Integer.parseInt

(jTextField3.getText());

Oswaal CBSE Solved Paper - 2018, INFORMATICS PRACTICES, Class-XI [ 19

To know about more useful books for class-11 click here

if(rMale.isSelected())

overtime=hours*100;

if(rFemale.isSelected())

overtime=hours*125;

jTextField4.setText(overtime);

jTextField5.setText(overtime + wages);

5. (a) The Char data-type stores fixed length strings. If a string to be stored in a field having length smaller than the field size then padded on the right is done automatically before being stored.

Whereas, Varchar supports variable length strings and therefore if the string to be stored is smaller than the field size it stores without modification. And hence, it saves memory.

(b) CREATE TABLE EMP (EMPNO INT CHECK (EMPNO BETWEEN 1000 AND 9999), ENAME VARCHAR(25), GENDER CHAR(1), DOB DATETIME, SAL DECIMAL(7,2)); (c) (i) Cooking Drama Sports (ii) AMA BUN AKB TON JEE (iii) Painting Drama Cooking Sports (iiv) AKBAR 250 (d) (i) SELECT * FROM STUDENT ORDERBY Name ASC; (ii) SELECT Rollno, Name FROM STUDENT WHERE(Name LIKE ‘A%’ AND Fees BETWEEN 200 AND 250); 6. (a) ALTER is DDL command which is used to manipulate the structure of the table. Whereas, UPDATE is DML

command which is used to update the data in the table. (b) (i) SELECT ENAME, GENDER, DOB FROM STAFF WHERE (DEPTNO NOT(10,13)); (ii) SELECT ENAME, GENDER, SAL FROM STAFF WHERE (YEAR(DOB)=2005); (iii) SELECT ENAME, DOB FROM STAFF WHERE SAL BETWEEN 9000 AND 12000; (iv) SELECT * FROM STAFF WHERE (GENDER=’M’ AND SAL>10000); (v) UPDATE STAFF SET SAL = SAL + SAL*0.05 WHERE GENDER = ‘F’; (vi) DELETE FROM STAFF WHERE EMPNO = 1004; (c) SYSDATE( ) is the function used to display the system date. Whereas, NOW( ) function is used to get the

current date and time of the system. 7. (a) (i) Radio Button. (ii) Text Box. (iii) Check Box or Combo Box. (iv) List Box. (b) Benefits of net banking are: (i) User can transact through the own convenience and comfort. (ii) Status of any transaction can be checked instantly. (c) nic.in (National Informatics Centre), ssc.nic.in (Staff Selection Commission), mha.nic.in (Ministry of Home

Affairs), rbi.org.in(Reserve Bank of India), upsc.gov.in(Union Public Service Commission), india.gov.in(National Portal of India), gst.gov.in(GST Portal).