Computer Science: Programming, Data, and Logic
Core concepts
Computer Science at Class XII covers computer fundamentals, number systems, Boolean logic, programming constructs (variables, control structures, functions, arrays), data structures such as stacks and queues, database concepts and SQL, and communication and networking basics. You must convert between binary, decimal, and hexadecimal, simplify Boolean expressions, and trace program output accurately.
Traps in questions
- Number conversion: forgetting positional weights when converting binary to decimal, or confusing hexadecimal digits A–F.
- Loop tracing: off-by-one errors; a loop from 1 to n inclusive runs n times, not n−1.
- Operator precedence: integer division truncates;
%gives remainder. - SQL syntax:
WHEREfilters rows,HAVINGfilters groups afterGROUP BY. - Stack vs queue: stacks are last-in-first-out; queues are first-in-first-out.
Worked example
Convert binary 1101 to decimal. Weights from right: $1, 2, 4, 8$. Bits are 1,0,1,1 from right. Value $= 1\times1 + 0\times2 + 1\times4 + 1\times8 = 1+0+4+8 = 13$. Check in hex: 1101 groups as 1101 = D, i.e. 13. Consistent.
Rule of thumb
Trace code line by line on paper with a table of variable values. For Boolean simplification, apply De Morgan's laws and absorption systematically rather than guessing.