Information Technology 802 Class 12 Sample Paper Term 2
Subject Code: 802
Session: 2021-2022 Term II
Time Allowed: 90 min/ Max. Marks: 30
General Instructions:
1. Please read the instructions carefully
2. This Question Paper is divided into 03 sections, viz., Section A, Section B and Section C.
3. Section A is of 05 marks and has 06 questions on Employability Skills.
a) Questions numbers 1 to 4 are one mark questions. Attempt any three questions.
b) Questions numbers 05 and 06 are two marks questions. Attempt any one question.
4. Section B is of 17 marks and has 16 questions on Subject specific Skills.
a) Questions numbers 7 to 13 are one mark questions. Attempt any five questions.
b) Questions numbers 14 to 18 are two marks questions. Attempt any three questions.
c) Questions numbers 19 to 22 are three marks questions. Attempt any two questions
5. Section C is of 08 marks and has 03 competency-based questions.
a) Questions numbers 23 to 25 are four marks questions. Attempt any two questions.
6. Do as per the instructions given in the respective sections.
7. Marks allotted are mentioned against each section/question.
SECTION A (3 + 2 = 5 marks)
Answer any 03 questions out of the given 04 questions (1 mark each)
1. Who are social entrepreneurs?
Ans: Individuals, who focus on developing solutions that benefit the society, are called social entrepreneurs. They develop, fund and implement solutions that are directed towards society, culture and environment.
2. An entrepreneur may face many personal barriers. Give any two personal barriers to entrepreneurship.
Ans:
i-Self-doubt comes when we do not have confidence in ourselves and our abilities
ii. Forming a team /team work -Finding suitable people and training them to put in their best
3. What are the possible green jobs in building and construction?
Ans: Areas for green jobs in building and construction include landscape, gardening, maintenance of green components, water management developing new green building, rating programmes, certification services.
4. What is the mission of National Action Plan on Climate Change?
Ans: The National Action Plan on Climate Change deals with adverse impacts of climate change on environment, forests, habitat, water resources and agriculture.
Answer any 01 question out of the given 02 questions (2 marks)
5. What are the attitudes that make a successful entrepreneur?
Ans: The attitudes that make a successful entrepreneur are
1. Decisiveness
2. Initiative
3. Interpersonal Skills
4. Perseverance
5. Organisational Skill
6. List some ways to minimise waste and pollution.
Ans: Ways to minimise waste and pollution
1. Reusing scrap material.
2. Ensuring quality control
3. Waste exchange
4. Managing e-waste
5. Use of eco-friendly material
SECTION B (5 + 6 + 6 = 17 marks)
Answer any 05 questions out of the given 07 questions (1 mark each)
7. Why Java program is platform independent?
Ans: A Java compiler instead of translating Java code to machine language code, translates it into Java Bytecode. A Java interpreter, called the Java Virtual Machine (JVM), translates the bytecode into machine code and then executes it.
The bytecode can be run on any platform as long as it has a JVM running on it. This makes Java programs platform independent and highly portable.
8. Think of any two work areas which uses Database Management Systems.
Ans: Education, banking, railways, telecommunication, hotels, air lines, ecommerce, companies, government sector
9. How can you write multiline comments in java program?
Ans: Beginning a comment line with two consecutive forward slashes (//)
Writing the comment between the symbols /* and */
10. What should we do to make a data member or a method member of a class visible only within the class?
Ans: To make a data member or method of a class visible only within the class. add keyword private before its declaration.
11. Why main is special method in java program?
Ans: Main is a special method that every Java application must have. When you run a program, the statements in the main method are the first to be executed.
12. How many times the loop will execute?
for (int number = 5; number >= 1; number = number-1)
{ System.out.print(“Square of ” + number);
System.out.println(” = ” + number*number); }
Ans: 5 times
13. Write the statement to create an array that stores percentage of 5 students.
Answer any 03 questions out of the given 05 questions (2 marks each)
14. Explain the difference between a Class and an Object with an example.
Ans: A class is a physical or logical entity that has certain attributes. A class is a template from which objects are created. Object is an instance of a class .
Class book can have title, author, publisher, price as the data members. To display the details of class book you would call the method member display().
Method members of a class are invoked through the object like book1 to perform the action associated with that method.
15. Find the error and give correct code
int number = 1;
while (number <= 5)
{System.out.print(“Square of ” + number);
System.out.println(” = ” + number*number);}
Ans: This loop will run forever since number never changes – it remains at 1.
Correct code
int number = 1;
while (number <= 5)
{System.out.print(“Square of ” + number);
System.out.println(” = ” + number*number);
number++; }
16. Give two differences between while loop and do while loop.
Ans:
while loop
1.A while loop is an entry controlled loop
2.Body of loop may never be executed
3. The variables in the test condition must be initialized prior to entering the loop structure.
do while loop
1.A do-while loop is an exit control loop.
2. Body of loop is executed at least once
3. It is not necessary to initialize the variables in the test condition prior to entering the loop structure.
17. What is the need of a constructor in OOP? Also write one feature of a constructor.
Ans: A special method member called the constructor method is used to initialize the data members of the class.
Feature
The constructor has the same name as the class, has no return type, and may or may not have a parameter list.
18. What will be the value of n after the execution of the following selection statement :
int n=0;
if (6>7 II 5>4)
{n=5;}
else n=7;
Ans: n=5
Answer any 02 questions out of the given 04 questions (3 marks each)
19. Read the code carefully and give its output :
package javaprogarms;
public class StringDemo{
public static void main(String[]args)
{
String myString = “INFORMATION TECHNOLOGY”;
System.out.println(myString.indexof(’E’));
System.out.println(myString.contains(“NO”));
System.out.println(myString.length(); }};
Ans:
13
True
22
20. What will be the value of rem after the execution of the following code snippet? Give reason.
code =2;
switch(code)
{ case 1: rem= 8;
case 2: rem= 9;
case 3: rem= 10; break;
case 4: rem= 11; break;}
Ans: rem=10
case 2 will be executed and rem will become 9 but because of absence of break statement the control will move down(fall through) and case 3 will be executed which will make rem as 10 now break will terminate the switch case statement .
21. Write a for loop that displays all odd numbers between 1 to 10.
i) How can we enable assertions to debug our code in java?
Ans: To enable assertions at runtime, you can enable them from the command line by using the –ea option
ii) What are the two ways to create threads in java?
Ans: In Java, threads can be created in two ways
1. By extending the Thread class
2. By implementing the Runnable interface
iii) Which member function of the Integer wrapper class allows access to the int value held in it.
Ans: intValue()
SECTION C (2 x 4 = 8 marks)
(COMPETENCY BASED QUESTIONS)
Answer any 02 questions out of the given 03 questions. (4 marks each)
23. What are methods in Java? Write a user defined method that return product of two numbers .
Ans: A method in Java is a block of statements grouped together to perform a specific task. A method has a name, a return type, an optional list of parameters, and a body.
24. What is an exception? How are exceptions handled in java? Explain with example.
Ans: An error situation that is unexpected in the program execution and causes it to terminate unexpectedly is called an exception.
For example Division by zero exception:
try
{
int quotient = divide(10,0);
System.out.println(quotient);
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
25.
i) How database management concepts are helpful in Government sector?
Ans: Database management concepts are helpful in Government sector for storing details of electoral roll, all types of taxes, criminal records, PAN cards, AADHAR cards, vehicle registration, birth/death certificate registration.
ii) A Hospital is making database of patients and its staff. Doctor table includes Docid, Dname, and Department. Give details of Patient Table along with its schema.