Class 12 Information Technology 802 Previous Year Question Paper 2022 – Term 2 – Solution

Series %BAB%
Question Paper Code 326 Set 4

Time allowed : 1.5 hours
Maximum Marks : 30

General Instructions :

  1. Please read the instructions carefully.
  2. This question paper is divided into three sections, viz., Section A, Section B and Section C.
  3. Section A is of 5 marks and has 6 questions on Employability Skills.
    (a) Questions number 1 to 4 are one mark questions. Attempt any three questions.
    (b) Questions number 5 and 6 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 number 7 to 13 are one mark questions. Attempt any five questions.
    (b) Questions number 14 to 18 are two marks questions. Attempt any three questions.
    (c) Questions number 19 to 22 are three marks questions. Attempt any two questions.
  5. Section C is of 8 marks and has 3 Competency-Based Questions.
    Questions number 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 – Employability Skills (3+2=5 marks)

Answer any 3 questions out of the given 4 questions. (3X1=3)

1. Write about any two interpersonal skills you know.
Answer: (a) Positive attitude (b) Communication (c) Problem solving (d) Stress management etc.

2. Define Initiative.
Answer: Initiative means being able to step forward and take action in a situation before others do. It’s about being proactive and taking the lead.

3. Write the full form of ILO.
Answer: International Labour Organization

4. What do you understand by the term ‘environment quality’?
Answer: Environmental quality refers to the overall condition and health of a particular environment, whether it’s a local ecosystem, a community, or the planet as a whole.

Answer any 1 question out of the given 2 questions. (1X2=2)

5. Explain perseverance and efficiency.
Answer: Perseverance is about not giving up, even when things get tough. It means sticking to your goals and working through challenges, even if it takes a long time.
Efficiency means doing things in a smart and organized way.

6. What do you mean by ‘adapting to the effects of climate changes’?
Answer: “Adapting to the effects of climate change” means getting ready for the changes that happen because of climate change. It’s about making changes to stay safe and protect the environment.

SECTION B – Subject Specific Skills (5+6+6=17 marks)

Answer any 5 questions out of the given 7 questions. (5X1=5)

7. Write the operator used to access members of a class object.
Answer: dot operator

8. Java compiler translates the Java program into ____.
Answer: Java bytecode

9. Expand the term JVM.
Answer: Java Virtual Machine

10. What is a method ?
Answer: A method is a block of code which only runs when it is called.

11. How many primitive data types does Java support in all ?
Answer: The eight primitives datatypes support Java are int, byte, short, long, float, double, boolean and char.

12. What is the size of a Boolean variable in Java ?
Asnwer: In Java, a boolean variable, which represents a Boolean value (either true or false), typically takes up 1 byte of memory.

13. Write the use of database management in Railways.
Answer: Database management in railways is essential for passenger ticketing, schedule management, safety, inventory control, and resource management. It ensures the efficient operation of railways, manages passenger information, and helps with logistics for both passengers and cargo.

Answer any 3 questions out of the given 5 questions. (3X2=6)

14. How do the following two codes differ :
(a) System.out.print("Hello World");
(b) System.out.println("Hello World");

Answer: Statement (a) println method appends a newline character (‘\n’) to output, while statement (b) print method does not.

15. Identify the errors in the following code and write the corrected code :
Class-12-IT-802-Previous-Year-Question-Paper-2022-term-2-Q15

public class IFDemo{
public static void main(String [] args) {
   int percentage = 55;
   String day = " ";
   if ( percentage >= 40)		//parenthesis apllied
   {						//curly braces applied
      System.out.println(“PASSED”) ; 
   }
   else
					//colon removed
   { 
      System.out.println(“FAILED”);   //println applied
   }
  }			 //curly braces applied
}			//curly braces applied

16. Differentiate between Short and String data type.
Answer: short is a primitive data type used to store integer values. It is a 16-bit signed two’s complement integer.
example: short num = 42;
String is a class in Java used to store sequences of characters (text). It’s not a primitive data type but a reference type.
example: String text = “Java is Awesome!”;

17. Write a method in Java that accepts two numbers as parameters and returns the greater number.

public class GreaterNumberFinder {
    public static int findGreaterNumber(int num1, int num2) {
        if (num1 > num2) {
            return num1;
        } else {
            return num2;
        }
    }

    public static void main(String[] args) {
        int number1 = 10;
        int number2 = 20;
        
        int result = findGreaterNumber(number1, number2);
        System.out.println("The greater number is: " + result);
    }
}

18. What will be the value of b after the execution of the following code ? Also, identify the logical operator being used in the code :
Class-12-IT-802-Previous-Year-Question-Paper-2022-term-2-Q18
Answer: After the execution of this code, the value of b will be 10.
The logical operator being used is &&, which represents the logical AND operator.

Answer any 2 questions out of the given 4 questions. (2X3=6)

19. Consider the following class :
Class-12-IT-802-Previous-Year-Question-Paper-2022-term-2-Q19
Write a command to create a constructor of the above class that initializes the data members of a class.

public class Stud {
    // Data members
    private String Rno;
    private String Sname;
    private String Address;
    private double marks;

    // Constructor
    public Stud(String rno, String sname, String address, double m) {
        Rno = rno;
        Sname = sname;
        Address = address;
        marks = m;
    }

    // Display method
    public void display() {
        // Add code to display the student information
    }
}

20. (a) Name the package to be imported in Java to take input from the user at run time.
Answer: java.util
(b) Consider the following two declarations and differentiate between them :
int a = 50;
Integer b = new Integer(50);

Answer: int a = 50; It directly assigns the integer value 50 to the variable a.
Integer b = new Integer(50); It creates an instance of the Integer class using the constructor and assigns it to the variable b
The difference is that int is a primitive data type, while Integer is a class that wraps an int value, allowing it to be treated as an object. In many cases, you can use int for simple numerical values, but Integer provides more flexibility and object-oriented capabilities when needed.

21. Write a program in Java to print the average of the first ten numbers.

public class AverageOfFirstTenNumbers {
    public static void main(String[] args) {
        int n = 10; // The number of values to average
        int sum = 0;

        // Calculate the sum of the first ten numbers
        for (int i = 1; i <= n; i++) {
            sum += i;
        }

        // Calculate the average
        double average = (double) sum / n;

        // Print the average
        System.out.println("Average of the first ten numbers: " + average);
    }
}

22. (a) Explain wait() method in Java threads.
Answer: In Java, the wait() method is used for thread synchronization. It is used to make a thread pause and release the lock on the object it’s called on, allowing other threads to acquire the lock and execute their synchronized code.
(b) Explain setPriority() method in Java and give the range of priority levels.

Answer: The setPriority() method allows you to specify the priority level of a thread.
The range of priority levels in Java threads is defined by the constants Thread.MIN_PRIORITY and Thread.MAX_PRIORITY, which have the values 1 and 10, respectively.

SECTION C – Competency-Based Questions (2X4=8 marks)

23. Write the method in Java to accept a string as parameter from the user and print whether string contains the characters ‘old’ or not.

public class StringContainsExample {
    public static void main(String[] args) {
        String userInput = getUserInput(); // Get a string from the user
        boolean containsOld = containsOld(userInput);

        if (containsOld) {
            System.out.println("The string contains 'old'.");
        } else {
            System.out.println("The string does not contain 'old'.");
        }
    }

    // Method to get a string from the user
    public static String getUserInput() {
        // You can use a Scanner to get input from the user
        java.util.Scanner scanner = new java.util.Scanner(System.in);
        System.out.print("Enter a string: ");
        String input = scanner.nextLine();
        scanner.close();
        return input;
    }

    // Method to check if a string contains 'old'
    public static boolean containsOld(String text) {
        return text.contains("old");
    }
}

24. Consider the following string variable :
String str1="Hello";
String str2= "morning";
Write the code statements in Java :
(a) To convert the first letter of a string variable 'str1' into uppercase.
(b) To display combined length of string str1 and str2.
(c) To display the index value of the first occurrence of letter 'e' in str1.
(d) To display str1 and str2 after joining them.

String str1 = "Hello";
str1 = Character.toUpperCase(str1.charAt(0)) + str1.substring(1);
System.out.println(str1);
String str1 = "Hello";
String str2 = "morning";
int combinedLength = str1.length() + str2.length();
System.out.println("Combined length: " + combinedLength);
String str1 = "Hello";
int index = str1.indexOf('e');
System.out.println("Index of 'e' in str1: " + index);
String str1 = "Hello";
String str2 = "morning";
String joinedString = str1 + " " + str2;
System.out.println(joinedString);

25. (a) How are database management concepts helpful in Telecommunications ?
Answer: Database management concepts are essential in telecommunications for efficiently managing subscriber data, network configurations, billing, fault management, performance monitoring, inventory, CRM, compliance, data analysis, security, and more. Databases store critical information used for network operations, customer service, regulatory compliance, and data-driven decisions.
(b) An Airlines company is making a database of its flights and staff.
The staff table includes : Emp_id, Emp_name, Emp_dob, E_sal. Give the details of Flight table with its schema.

Answer: The details of the Flight table for the airline company along with its schema as follows:

  • Flight_ID: INT (Integer) – A unique identifier for each flight.
  • Flight_Number: VARCHAR – The flight number associated with the flight, stored as a string.
  • Departure_Location: VARCHAR – The location where the flight departs from, stored as a string.
  • Arrival_Location: VARCHAR – The location where the flight arrives, stored as a string.
  • Departure_Date: DATE – The date when the flight departs.
  • Departure_Time: TIME – The time when the flight departs.
  • Arrival_Date: DATE – The date when the flight arrives.
  • Arrival_Time: TIME – The time when the flight arrives.
  • Aircraft_Type: VARCHAR – The type of aircraft used for the flight, stored as a string.
  • Seat_Capacity: INT (Integer) – The total number of seats available on the flight.
  • Ticket_Price: DECIMAL – The price of a ticket for the flight, stored as a decimal number.

Find Class 12 Information Technology Previous Year Question Papers

Find Class 12 Information Technology Previous Year Question Papers Solution

Find Class 12 Information Technology Previous Year Compartment Question Papers

Find Class 12 Information Technology Previous Year Compartment Question Papers Solution

Leave a Comment