Total Pageviews

Saturday, September 5, 2026

srijit hitartho

🚗
🤖
🗼 💻 🖥️ 🧠
🖥️
🗼
✨ ICSE Computer Applications Assessment ✨

Computism Lab

Class 8 - Java Programming & Basic Concepts

🧠
🤖
Subject: Computer Applications (Java)
Max Marks: 70
Time Allowed: 2 Hours
Section A: Multiple Choice Questions on Datatypes10 Marks
  1. What is the size of an `int` data type in Java?
    • a. 2 bytes
    • b. 4 bytes
    • c. 8 bytes
    • d. 1 byte
  2. Which of the following is a non-primitive (reference) data type in Java?
    • a. int
    • b. char
    • c. String
    • d. double
  3. What is the default value of a `boolean` data type variable in Java?
    • a. true
    • b. false
    • c. 0
    • d. null
  4. Which data type occupies the maximum memory space in Java?
    • a. float
    • b. int
    • c. double
    • d. short
  5. What is the size of a `char` data type in Java?
    • a. 1 byte
    • b. 2 bytes
    • c. 4 bytes
    • d. 8 bytes
  6. Which of these integer data types has the smallest range?
    • a. int
    • b. long
    • c. byte
    • d. short
  7. Which data type is appropriate for storing fractional numbers like `99.99` by default?
    • a. float
    • b. double
    • c. int
    • d. char
  8. What kind of literal is `true` in Java?
    • a. Integer literal
    • b. Boolean literal
    • c. Character literal
    • d. String literal
  9. Which category do primitive data types belong to?
    • a. User-defined
    • b. Reference
    • c. Built-in / Fundamental
    • d. Derived
  10. What is the default data type for whole integer numbers in Java expressions?
    • a. byte
    • b. short
    • c. int
    • d. long
Section B: Assertion-Based MCQs on Java Basics10 Marks
  1. Assertion (A): Java is a platform-independent language.
    Reason (R): Java code is compiled into bytecode which can execute on any system with a JVM.
    a) Both A and R are true, and R is the correct explanation of A.
    b) Both A and R are true, but unrelated.
    c) A is true, R is false.
    d) A is false, R is true.
  2. Assertion (A): Variable names in Java are case-sensitive.
    Reason (R): `Rate` and `rate` are interpreted as two distinct identifiers by the Java compiler.
    a) Both A and R are true, and R is the correct explanation of A.
    b) Both are true, unrelated.
    c) A is true, R is false.
    d) A is false, R is true.
  3. Assertion (A): Every executable Java application requires a `main()` method.
    Reason (R): The JVM looks for the `main()` method as the starting point for program execution.
    a) Both A and R are true, and R is the correct explanation of A.
    b) Both are true, unrelated.
    c) A is true, R is false.
    d) A is false, R is true.
  4. Assertion (A): Semicolons are optional at the end of statements in Java.
    Reason (R): Every complete Java statement must be terminated with a semicolon.
    a) Both are true.
    b) A is true, R is false.
    c) A is false, but R is true.
    d) Both are false.
  5. Assertion (A): Comments are executed during runtime to calculate values.
    Reason (R): Comments are ignored by the compiler and are meant only for documentation.
    a) Both are true.
    b) A is true, R is false.
    c) A is false, but R is true.
    d) Both are false.
  6. Assertion (A): The assignment operator (`=`) is used to test equality between two variables.
    Reason (R): Equality is tested using the relational operator `==`.
    a) Both A and R are true.
    b) A is true, R is false.
    c) A is false, but R is true.
    d) Both are false.
  7. Assertion (A): The `print()` method prints text and keeps the cursor on the same line.
    Reason (R): `println()` automatically inserts a newline character after printing output.
    a) Both A and R are true, and R is the correct explanation of A.
    b) Both are true, unrelated.
    c) A is true, R is false.
    d) A is false, R is true.
  8. Assertion (A): Keywords can be used as variable names in Java.
    Reason (R): Keywords are reserved words with pre-defined meanings in the Java language.
    a) Both A and R are true.
    b) A is true, R is false.
    c) A is false, but R is true.
    d) Both are false.
  9. Assertion (A): The `if-else` statement is used for decision-making in Java.
    Reason (R): It allows alternate blocks of code to execute depending on a boolean condition.
    a) Both A and R are true, and R is the correct explanation of A.
    b) Both are true, unrelated.
    c) A is true, R is false.
    d) A is false, R is true.
  10. Assertion (A): Division of two integers using `/` yields an integer result, discarding fractional parts.
    Reason (R): Integer division truncates any decimal remainder in Java.
    a) Both A and R are true, and R is the correct explanation of A.
    b) Both are true, unrelated.
    c) A is true, R is false.
    d) A is false, R is true.
Section C: True or False5 Marks
  1. Java is an object-oriented programming language. (True / False)
  2. A variable name in Java can start with a numeric digit. (True / False)
  3. The postfix increment operator (`++`) increases the value of the variable after its evaluation. (True / False)
  4. The `else` block is compulsory whenever an `if` statement is used. (True / False)
  5. Single-line comments in Java begin with `//`. (True / False)
Section D: Find the Output (Prefix/Postfix & If-Else Snippets)20 Marks
  1. Snippet 1:
    int a = 5;
    int b = ++a + a++;
    System.out.println("a = " + a + ", b = " + b);
  2. Snippet 2:
    int x = 10;
    int y = x++ + 3;
    System.out.println("x = " + x + ", y = " + y);
  3. Snippet 3:
    int m = 8;
    int n = --m - m--;
    System.out.println("m = " + m + ", n = " + n);
  4. Snippet 4:
    int a = 12;
    if (a % 2 == 0) {
      System.out.println("Even");
    } else {
      System.out.println("Odd");
    }
  5. Snippet 5:
    int p = 5, q = 10;
    if (p > q) {
      System.out.println(p);
    } else {
      System.out.println(q);
    }
  6. Snippet 6:
    int val = 4;
    int res = --val * 2;
    System.out.println("val = " + val + ", res = " + res);
  7. Snippet 7:
    int num = 7;
    if (num > 5) {
      num += 3;
    } else {
      num -= 2;
    }
    System.out.println(num);
  8. Snippet 8:
    int x = 2;
    int y = x++ + ++x + x;
    System.out.println(y);
  9. Snippet 9:
    int score = 75;
    if (score >= 90) {
      System.out.println("Grade A");
    } else if (score >= 60) {
      System.out.println("Grade B");
    } else {
      System.out.println("Grade C");
    }
  10. Snippet 10:
    int c = 3;
    int d = c++ * ++c;
    System.out.println("c = " + c + ", d = " + d);
Section E: Java Basic Programs (5 Programs)25 Marks
  1. Program 1: Even or Odd Number Checker
    Write a Java program to check whether a given integer (`int n = 14`) is even or odd using an `if-else` statement.

  2. Program 2: Greatest of Three Numbers
    Write a Java program to find and print the greatest among three given numbers (`a = 15`, `b = 25`, `c = 20`) using nested `if-else`.

  3. Program 3: Simple Interest Calculator
    Write a Java program to calculate Simple Interest given Principal (`P = 5000`), Rate (`R = 7.5`), and Time (`T = 3` years) using the formula $SI = (P \times R \times T) / 100$.

  4. Program 4: Print Numbers from 1 to 10
    Write a Java program using a `for` loop to print numbers from 1 to 10, each separated by a space or on a new line.

  5. Program 5: Vowel or Consonant Checker
    Write a Java program using a `switch` statement to check whether a given character (`char ch = 'e'`) is a vowel or a consonant.

⭐ Best of Luck for Your Examination! Code with Precision and Confidence! 🚀
CREATED BY BIJAN KRISHNA PAUL

No comments:

Post a Comment