Follow Us
Select Medium / माध्यम चुनें:
Eng (English) Hindi (हिन्दी)
ICSE • Class X • Information Technology • Ch 1
Estimated Time: 45 Mins
Study Progress: In Progress

Revision of Class IX Syllabus

Exhaustive review and synthesis of ICSE Class IX Computer Applications foundations. Comprehensive coverage of OOP principles, JVM architecture, primitive and reference data types, type conversions, operators, control flow structures, Math library functions, output tracing, and board problem-solving patterns.

Why This Chapter Matters

Exhaustive review and synthesis of ICSE Class IX Computer Applications foundations. Comprehensive coverage of OOP principles, JVM architecture, primitive and reference data types, type conversions, operators, control flow structures, Math library functions, output tracing, and board problem-solving patterns.

Chapter Roadmap & Progression

1 1. Object-Oriented Programming (OOP...
2 2. Java Virtual Machine (JVM), Byte...
3 3. Java Tokens, Primitive Data Type...
4 4. Type Casting, Conversion Hierarc...
5 5. Operators, Precedence Hierarchy...
6 6. Control Flow: Selection, Iterati...
7 7. Standard Math Library Functions...
8 8. ICSE Board Examination Output Tr...

Complete Concept Guide (100% Curriculum Coverage)

1. Object-Oriented Programming (OOP) Principles & Paradigm Architecture

Core OOP Principles
The Four Pillars of Object-Oriented Programming:

Object-Oriented Programming (OOP) is a software design paradigm where programs are organized around data (objects) and discrete functions (methods) rather than sequential procedures and logic. Unlike procedural programming (e.g., C or Pascal), OOP models real-world entities into computational units containing state and behaviour.

OOP Principle Definition & Conceptual Mechanism Real-World Analogy & Java Syntax
Encapsulation The wrapping up of data (fields/variables) and methods operating on that data into a single unit (Class), restricting direct external access via access specifiers (Data Hiding). A medical capsule containing medicinal ingredients. In Java, declaring instance variables private and providing public getter and setter methods.
Abstraction The act of representing essential features without including the background details or internal implementation complexities. Driving an automobile by pressing the accelerator and steering without needing to understand fuel injection or differential gear ratios. In Java, achieved via Interfaces and Abstract Classes.
Inheritance The mechanism by which one class (subclass/child) derives the state and behaviors of an existing class (superclass/parent), promoting code reusability. A child inheriting physical traits from biological parents. Implemented in Java using the extends keyword (e.g., class Car extends Vehicle).
Polymorphism The ability of a message, function, or method to be displayed in more than one form (derived from Greek: poly = many, morph = forms). A person behaving differently at home, in the classroom, and in a hospital. In Java, achieved at compile-time via Method Overloading and at runtime via Method Overriding.
Procedural vs Object-Oriented Paradigm:
  • Procedural: Top-down approach, emphasis on functions/algorithms, data moves openly around the system from function to function, low security and difficult to maintain as programs scale.
  • Object-Oriented: Bottom-up approach, emphasis on data security, access to data is strictly regulated through class methods, highly modular, reusable, and scalable.

2. Java Virtual Machine (JVM), Bytecode & Platform Independence

Execution Pipeline
Java Compilation & Execution Mechanics:

Java's revolutionary feature is platform independence, famously encapsulated in Sun Microsystems' slogan: "Write Once, Run Anywhere" (WORA). Understanding the architectural distinction between JDK, JRE, JVM, and Bytecode is a mandatory ICSE board topic.

1. Java Development Kit (JDK):

The complete software package required to develop and compile Java applications. It contains the Java compiler (javac), debuggers, archivers (jar), and the Java Runtime Environment (JRE).

2. Java Runtime Environment (JRE):

The software environment required to run already-compiled Java applications. It bundles the JVM along with core class libraries (e.g., rt.jar) and supporting binaries.

3. Java Virtual Machine (JVM) & Bytecode:

When source code written in a file named Program.java is compiled using javac Program.java, the compiler does not produce native machine code for the host CPU. Instead, it generates an intermediate, highly optimized set of instructions called Bytecode, stored in a file named Program.class.

  • Bytecode: A platform-neutral binary format consisting of 8-bit opcodes. It cannot be executed directly by any physical hardware CPU.
  • JVM (Java Virtual Machine): An abstract virtual computer that resides in memory. When the program runs (java Program), the JVM interprets the bytecode line-by-line or compiles hot spots into native machine instructions using the Just-In-Time (JIT) Compiler.
  • Architectural Synthesis: While Java Bytecode is 100% platform-independent, the JVM itself is platform-dependent (different JVM binaries exist for Windows, macOS, and Linux). This architectural separation guarantees seamless cross-platform execution.

3. Java Tokens, Primitive Data Types & Memory Storage Matrix

Data Types & Tokens
Tokens: The Smallest Individual Units of a Program:

A token is the smallest lexical component recognized by the Java compiler. Java programs consist of five token categories:

  1. Keywords: Reserved words with predefined meanings (e.g., class, public, static, void, int, if, new). Keywords cannot be used as identifiers.
  2. Identifiers: User-defined names given to classes, methods, and variables. Must begin with a letter, underscore (_), or dollar sign ($). Cannot begin with a digit or contain special punctuation.
  3. Literals (Constants): Fixed values assigned to variables (e.g., integer 45, floating-point 3.14F, character 'A', string "Hello", boolean true).
  4. Operators: Symbols that perform operations on operands (e.g., +, -, *, /, %, &&, ?:).
  5. Punctuators / Separators: Structural symbols used to organize code (e.g., ;, {}, (), [], ,).
Primitive Data Types Specification Matrix:
Data Type Category Size (Bytes / Bits) Range of Values Default Value
byteInteger1 Byte (8 bits)$-128$ to $+127$ ($-2^7$ to $2^7 - 1$)0
shortInteger2 Bytes (16 bits)$-32,768$ to $+32,767$ ($-2^{15}$ to $2^{15} - 1$)0
intInteger4 Bytes (32 bits)$-2^{31}$ to $+2^{31} - 1$0
longInteger8 Bytes (64 bits)$-2^{63}$ to $+2^{63} - 1$0L
floatFloating Point4 Bytes (32 bits)Single precision ($pprox 7$ significant decimal digits)0.0f
doubleFloating Point8 Bytes (64 bits)Double precision ($pprox 15$ significant decimal digits)0.0d
charCharacter2 Bytes (16 bits)Unicode characters ($0$ to $65,535$ / '\u0000' to '\uffff')'\u0000' (null character)
booleanLogical1 bit (virtual)true or falsefalse

4. Type Casting, Conversion Hierarchies & Arithmetic Promotion

Type Conversion Mechanics
Implicit (Widening) vs Explicit (Narrowing) Type Conversion:

Type conversion is the process of converting a value of one primitive data type into another. Java strictly differentiates between safe automatic widening and potentially lossy explicit narrowing.

1. Implicit Type Conversion (Automatic Widening):

Occurs automatically during runtime when a value of a smaller data type is assigned to or evaluated against a larger data type. There is zero risk of data loss. The conversion hierarchy strictly follows:

byte → short → int → long → float → double
char → int

Example: int a = 25; double b = a; // Valid: b becomes 25.0

2. Explicit Type Conversion (Narrowing / Type Casting):

Required when converting a wider data type into a narrower data type. It does NOT happen automatically because it carries the risk of truncation or precision loss. The programmer must explicitly specify the target type in parentheses using the cast operator: (target_type) expression.

Example 1 (Fractional Truncation): double d = 9.87; int i = (int)d; // i becomes 9, fractional part .87 is discarded!

Example 2 (Integer Overflow Wrap-around): int n = 130; byte b = (byte)n; // b becomes -126 due to 8-bit two's complement overflow!

Automatic Type Promotion in Expressions:
  • All byte, short, and char values are promoted to int before evaluating arithmetic expressions.
  • If one operand is double, the entire expression promotes to double.
  • If the highest operand is float, the expression evaluates to float; if long, to long.
  • Example: In byte b1 = 10, b2 = 20; byte b3 = b1 + b2;, the compiler throws an error: "cannot convert from int to byte" because b1 + b2 is automatically promoted to int. Correct code: byte b3 = (byte)(b1 + b2);

5. Operators, Precedence Hierarchy & Prefix vs Postfix Evaluation

Operator Precedence
Evaluation Hierarchy & Unary Operators:

Operators are special symbols that direct the Java compiler to perform specific mathematical, logical, or relational manipulations. Mastering precedence and associativity is essential for ICSE output tracing questions.

Precedence Operator Category Operators Associativity
1 (Highest)Postfix Unaryexpr++, expr--Left to Right
2Prefix Unary & Cast++expr, --expr, +, -, !, (type)Right to Left
3Multiplicative*, /, %Left to Right
4Additive+, -Left to Right
5Relational<, >, <=, >=, instanceofLeft to Right
6Equality==, !=Left to Right
7Logical AND&& (Short-circuit)Left to Right
8Logical OR|| (Short-circuit)Left to Right
9Ternary Conditional? :Right to Left
10 (Lowest)Assignment=, +=, -=, *=, /=, %=Right to Left
Prefix vs Postfix Increment/Decrement In-Depth Analysis:

Consider the variable mutation sequence in prefix vs postfix:

  • Prefix (++x / --x): "Change before use". The variable's memory is immediately updated, and the new value is returned to the surrounding expression.
  • Postfix (x++ / x--): "Use before change". The current value of the variable is supplied to the expression, and then the variable's memory is mutated in the background.
Classic ICSE Expression Trace Walkthrough:
int a = 5;
int b = ++a + a++ + --a + a;
System.out.println("b = " + b + ", a = " + a);

Step-by-Step Execution:

  1. ++a: Prefix increment. a changes from 5 to 6. Value supplied = 6. (Current a = 6)
  2. a++: Postfix increment. Value supplied = 6. Afterward, a increments to 7. (Current a = 7)
  3. --a: Prefix decrement. a changes from 7 to 6. Value supplied = 6. (Current a = 6)
  4. a: Simple variable read. Value supplied = 6.
  5. Sum = $6 + 6 + 6 + 6 = 24$. Final state: b = 24, a = 6.

6. Control Flow: Selection, Iteration & Jump Structures

Control Structures
1. Decision Making (Selection Statements):
  • if-else & Dangling Else: An else clause is always paired with the nearest preceding unmatched if within the same block, unless altered by braces {}.
  • switch-case Architecture: A multi-branch selection statement comparing an expression against constant literal values (case labels).
    • Compatible types: byte, short, char, int, String (from Java 7+), and enum. (float and double are strictly ILLEGAL).
    • Fall-through Phenomenon: If a case block does not terminate with a break; statement, control cascades unconditionally into subsequent case statements regardless of match, until a break or closing brace is reached.
2. Iteration (Loops) Comparative Taxonomy:
Loop Type Control Classification Syntax & Execution Mechanism Minimum Executions
for Loop Entry-Controlled for(initialization; test_condition; update) { ... }
Ideal when the exact number of iterations is known beforehand.
0 times (if initial condition is false)
while Loop Entry-Controlled while(test_condition) { ...; update; }
Ideal when iterations depend on an event/sentinel condition.
0 times
do-while Loop Exit-Controlled do { ...; update; } while(test_condition);
Condition evaluated AFTER the loop body executes. Semicolon ; is mandatory after while().
At least 1 time
3. Jump Statements:
  • break: Immediately terminates the innermost enclosing loop or switch statement, transferring control to the statement following the block.
  • continue: Skips the remaining statements in the current iteration of the loop and jumps directly to the update expression (in for) or test condition (in while/do-while).
  • return: Immediately exits the current method, optionally returning a value to the caller.

7. Standard Math Library Functions (java.lang.Math)

Mathematical Functions
High-Frequency java.lang.Math Methods in ICSE Board Exams:

The Math class is part of the default java.lang package and contains all-static methods for mathematical computation. Memorizing the exact parameter and return data types is crucial for Section A board questions.

Method Signature Description & Operation Example Call Output Value
double Math.pow(double a, double b) Calculates $a^b$ ($a$ raised to power $b$). Always returns double. Math.pow(4.0, 3.0) 64.0
double Math.sqrt(double a) Calculates positive square root $\sqrt{a}$. Returns NaN for negative arguments. Math.sqrt(64.0) 8.0
double Math.cbrt(double a) Calculates cube root $\sqrt[3]{a}$. Handles negative numbers. Math.cbrt(-27.0) -3.0
double Math.ceil(double a) Returns the smallest mathematical integer $\ge a$ as a double (rounds upward). Math.ceil(-4.2)
Math.ceil(4.2)
-4.0
5.0
double Math.floor(double a) Returns the largest mathematical integer $\le a$ as a double (rounds downward). Math.floor(-4.8)
Math.floor(4.8)
-5.0
4.0
long Math.round(double a)
int Math.round(float a)
Rounds to the nearest integer ($a + 0.5$ floored). Returns long for double, int for float. Math.round(4.5)
Math.round(-4.5)
5
-4
double Math.abs(double a) Returns the absolute (positive) magnitude of the value. Overloaded for int, long, float, double. Math.abs(-12.8) 12.8
double Math.random() Returns a pseudorandom double $\in [0.0, 1.0)$. (int)(Math.random() * 10) + 1 Random integer between 1 and 10

8. ICSE Board Examination Output Tracing & Algorithmic Problem Solving

Board Tracing Drills
Rigorous Board Tracing Exemplars (Questions with Answers & Logic):
Drill 1: Nested Ternary Evaluation
int x = 10, y = 20, z = 30;
int max = (x > y) ? ((x > z) ? x : z) : ((y > z) ? y : z);
System.out.println("Max = " + max);

Step-by-Step Logic: (x > y) is (10 > 20) which evaluates to false. Control skips the first branch and evaluates ((y > z) ? y : z). (20 > 30) is false, so the expression yields z, which is 30. Output: Max = 30.

Drill 2: Switch Fall-Through with Variable Mutations
int c = 2, k = 5;
switch (c) {
    case 1: k += 10; break;
    case 2: k *= 2;
    case 3: k += 4; break;
    default: k = 0;
}
System.out.println("k = " + k);

Step-by-Step Logic: c == 2 matches case 2. k *= 2 makes $k = 5 \times 2 = 10$. Because case 2 has no break;, fall-through occurs into case 3: k += 4 makes $k = 10 + 4 = 14$. Then break; halts execution. Output: k = 14.

Drill 3: Modulo & Division Arithmetic in Number Extractions
int n = 458, rev = 0;
while (n > 0) {
    int d = n % 10;
    rev = rev * 10 + d;
    n /= 10;
}
System.out.println("Reversed = " + rev);

Trace Table:

Iterationnd = n % 10rev = rev * 10 + dn /= 10
14588$0 \times 10 + 8 = 8$45
2455$8 \times 10 + 5 = 85$4
344$85 \times 10 + 4 = 854$0

Loop terminates since $n = 0$. Output: Reversed = 854.

Common Misconceptions & Examiner Traps

Common Misconception

Assuming Math.pow(a, b) and Math.sqrt(a) return an int when integers are passed

Scientific Reality & Correction

Math.pow() and Math.sqrt() ALWAYS return a double, even for perfect squares (e.g., Math.sqrt(25) returns 5.0, not 5).

Common Misconception

Confusing integer division with floating-point division (e.g., evaluating 5 / 2 as 2.5)

Scientific Reality & Correction

When both operands are integers, Java performs integer division which truncates the fractional part: 5 / 2 = 2. To get 2.5, at least one operand must be floating-point (e.g., 5.0 / 2 or (double)5 / 2).

Common Misconception

Forgetting the mandatory semicolon after the condition in a do-while loop

Scientific Reality & Correction

A do-while loop must conclude with a semicolon: 'do { ... } while(condition);'. Omitting the semicolon causes a syntax compilation error.

Common Misconception

Using float or double expressions in switch-case statements

Scientific Reality & Correction

Floating-point types (float, double) cannot be used in a switch expression due to IEEE 754 precision rounding issues. Only byte, short, char, int, String, and enum are valid.

Architectural Blueprint : Revision of Class IX Syllabus

ICSE Class 10 Java : Class IX Foundations Architecture & Execution Pipeline 1. OOP Principles • Encapsulation: Binding data + methods (Data Hiding) • Abstraction: Essential features without details • Inheritance: Reusability via 'extends' keyword • Polymorphism: Many forms (Method Overloading) 2. Java Execution Pipeline Source Code (.java): Human-readable high-level syntax ↓ JAVAC Compiler Bytecode (.class): Platform-independent 8-bit code ↓ JVM (Interpreter + JIT) Machine Code (Native): Hardware CPU instructions 3. Operators & Evaluation • Increment / Decrement: ++x (prefix) vs x++ (postfix) • Ternary Operator: (condition) ? expr1 : expr2 • Type Casting: Implicit (widening) vs Explicit (narrow) • Short-circuit Logical: && and || short-circuit evaluation 4. Control Flow & Loops • Selection: if-else, switch-case (fall-through) • Iteration (Loops): Entry (for, while) vs Exit (do-while) • Jump Statements: break (exit loop), continue (next step) • Math Functions: pow, sqrt, abs, round, ceil, floor ICSE Section A High-Yield Output Tracing & Evaluation Focus Areas • Prefix vs Postfix Tracing: Difference between int a = ++x + x++; evaluation mechanics and variable mutation state. • Switch-Case Fallthrough: Absence of break; causes sequential execution of all subsequent cases until break or block end. • Integer Division & Modulo: 7 / 2 = 3 (truncates fraction), 7 % 2 = 1 (remainder), -7 % 2 = -1 (sign follows dividend).

Chapter Summary & 10 Key Takeaways

Takeaway 1
Object-Oriented Programming (OOP) is anchored by four foundational pillars: Encapsulation (data hiding), Abstraction (essential features), Inheritance (reusability), and Polymorphism (many forms).
Takeaway 2
Java achieves platform independence ('Write Once, Run Anywhere' - WORA) through a two-step compilation model: source code (.java) compiles to bytecode (.class), which is executed by the platform-specific JVM.
Takeaway 3
Java primitive data types are divided into four groups: Integer (byte: 8-bit, short: 16-bit, int: 32-bit, long: 64-bit), Floating-point (float: 32-bit, double: 64-bit), Character (char: 16-bit Unicode), and Logical (boolean: true/false).
Takeaway 4
Type conversion operates in two directions: Implicit/Widening (automatic conversion from narrower to wider type without data loss) and Explicit/Narrowing (manual cast e.g. `(int)3.7` with truncation).
Takeaway 5
In operator precedence, unary operators (`++`, `--`, `+`, `-`, `!`) execute first with right-to-left associativity, followed by arithmetic (`*`, `/`, `%` before `+`, `-`), relational, logical, and assignment operators.
Takeaway 6
Prefix increment (`++x`) increments the variable value first and returns the updated value; postfix increment (`x++`) returns the current variable value first and increments subsequently.
Takeaway 7
Logical AND (`&&`) and Logical OR (`||`) utilize short-circuit evaluation: in `A && B`, if `A` is false, `B` is not evaluated; in `A || B`, if `A` is true, `B` is not evaluated.
Takeaway 8
Loops are categorized into entry-controlled loops (`for`, `while`), where the test condition is evaluated before executing the body (zero iterations possible), and exit-controlled loops (`do-while`), which always execute at least once.
Takeaway 9
The `switch-case` statement requires integral or compatible types (byte, short, char, int, String, enum); omitting a `break` statement causes 'fall-through' where subsequent cases execute regardless of condition.
Takeaway 10
Core `Math` methods return standard types: `Math.sqrt()` and `Math.pow()` always return `double`; `Math.round(double)` returns `long`; `Math.ceil()` and `Math.floor()` return mathematical boundary `double` values.

Check Your Understanding (Diagnostic Practice Questions)

Diagnostic questions testing core conceptual clarity. Answers are hidden initially — solve each problem first, then click to reveal the step-by-step verified solution.

1
Explain how Java achieves platform independence. Distinguish between Java Bytecode and Machine Code.
Reveal Answer & Explanation
Answer: Java achieves platform independence through a two-stage execution architecture. When Java source code (.java) is compiled, the compiler (javac) produces an intermediate, platform-neutral binary representation called Bytecode (.class) instead of native machine code. Bytecode consists of standardized 8-bit instruction opcodes that are independent of the underlying computer architecture. When running the application, a platform-specific Java Virtual Machine (JVM) interprets and executes this Bytecode on the local CPU using an interpreter and Just-In-Time (JIT) compiler. Machine code, by contrast, consists of raw binary instructions directly executed by a specific physical CPU architecture (x86, ARM) and cannot run across different operating systems without recompilation.
2
What is the difference between explicit type casting and implicit type conversion? Provide an example of data loss during explicit casting.
Reveal Answer & Explanation
Answer: Implicit type conversion (automatic widening) occurs automatically when a value of a smaller primitive data type is assigned to or evaluated against a larger data type (e.g., int to double). There is no risk of data loss. Explicit type casting (narrowing) occurs when a programmer manually converts a wider data type into a narrower data type using the cast operator '(target_type) expression'. It carries the risk of data loss due to fractional truncation or integer overflow. For example, in 'double d = 15.85; int x = (int)d;', explicit casting truncates the fractional portion .85, resulting in x = 15. Similarly, casting 'int n = 130;' into 'byte b = (byte)n;' causes 8-bit overflow, yielding b = -126.
3
Differentiate between prefix increment (++x) and postfix increment (x++) with an illustrative trace table.
Reveal Answer & Explanation
Answer: Prefix increment (++x) uses the 'change before use' rule: the variable is incremented by 1 first, and then the newly updated value is returned and used in the surrounding expression. Postfix increment (x++) uses the 'use before change' rule: the current value of the variable is used in the expression first, and only after expression evaluation is the variable mutated in memory. For example: 'int x = 5; int y = ++x;' results in x = 6, y = 6. In contrast, 'int x = 5; int y = x++;' results in y = 5, followed by x becoming 6.
4
Explain the concept of 'fall-through' in Java switch-case statements. How is it prevented?
Reveal Answer & Explanation
Answer: 'Fall-through' occurs in a switch-case construct when a matched 'case' statement does not terminate with a 'break;' statement. Consequently, execution cascades unconditionally into all subsequent case statements and the default block, executing their code regardless of whether their case labels match the switch expression, until a 'break;' or the closing brace of the switch is encountered. Fall-through is prevented by concluding every case block with a 'break;' statement, which immediately exits the switch construct.
5
Compare entry-controlled loops (for, while) with exit-controlled loops (do-while) in terms of structure and minimum execution count.
Reveal Answer & Explanation
Answer: Entry-controlled loops ('for' and 'while') evaluate their boolean test condition at the beginning (entry) before executing the loop body. If the condition is initially false, the loop body never executes (minimum execution count = 0). An exit-controlled loop ('do-while') executes the loop body first and tests the boolean condition at the end (exit). Therefore, a do-while loop always executes its loop body at least once (minimum execution count = 1), even if the test condition is initially false.
6
Explain the operation and return values of Math.ceil(-3.7), Math.floor(-3.7), and Math.round(-3.7).
Reveal Answer & Explanation
Answer:
  1. Math.ceil(-3.7) returns the smallest mathematical integer greater than or equal to -3.7 as a double. Since -3.0 is greater than -3.7, the return value is -3.0. 2. Math.floor(-3.7) returns the largest mathematical integer less than or equal to -3.7 as a double. Since -4.0 is less than -3.7, the return value is -4.0. 3. Math.round(-3.7) rounds to the nearest integer by calculating floor(-3.7 + 0.5) = floor(-3.2) = -4, returning a long value of -4.

7
What is short-circuit evaluation in logical operators (&& and ||)? Why is it computationally advantageous?
Reveal Answer & Explanation
Answer: Short-circuit evaluation is an optimization where the second operand of a logical operation is not evaluated if the overall boolean result can be determined from the first operand alone. In Logical AND (A && B), if A evaluates to false, the entire expression must be false, so B is skipped. In Logical OR (A || B), if A evaluates to true, the entire expression must be true, so B is skipped. This is advantageous because it avoids redundant CPU cycles and prevents runtime exceptions (e.g., in 'if (obj != null && obj.length() > 0)', if obj is null, the second expression is skipped, preventing a NullPointerException).
8
State the difference between Primitive Data Types and Composite/Reference Data Types in Java.
Reveal Answer & Explanation
Answer: Primitive data types (byte, short, int, long, float, double, char, boolean) are predefined, built-in types whose variables directly store the actual binary value in Stack memory; they have fixed bit sizes and do not have associated methods. Composite or Reference data types (Classes, Arrays, Interfaces, Strings) are user-defined or library types where the variable stores a memory reference (address) pointing to an object allocated dynamically on the Heap; their sizes depend on instance data, and they can invoke methods.
Finished Studying This Chapter?
READY TO PRACTICE?

Timed CBT Practice Tests (Exam Simulator)

Put your concepts to the test with official curriculum-aligned Foundation and Advanced practice tests. Get instant accuracy scores, time metrics, and step-by-step verified explanations.