Answer the following using a truth table.
Show answer
Answer
| A | B | A+B | B+A |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 |
The ISC Computer Science 2018 Question Paper for Class 12: all 35 questions, 70 marks in all, in printed order and in full. It is free to download: tap "Show answer" under a question to see its answer, or use the download button to save the questions as a PDF, with or without answers; "Print this paper" below prints it as it was set.
Answer the following using a truth table.
Answer
| A | B | A+B | B+A |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 |
Answer the following.
Answer
Answer the following.
Answer
Answer the following using a truth table.
Answer
| P | Q | P.Q | Q' | P.Q' | (P.Q)+(P.Q') | P |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 | 1 | 1 |
Answer the following.
Answer
Answer the following.
Answer
Answer the following.
Answer
Final answer: 6 x 6
Answer the following.
Answer
Answer the following.
Answer
Answer the following.
Answer
Fill in the blanks marked ?1?, ?2? ... so that the code works.
Answer
Fill in the blanks marked ?1?, ?2? ... so that the code works.
Answer
Fill in the blanks marked ?1?, ?2? ... so that the code works.
Answer
Fill in the blanks marked ?1?, ?2? ... so that the code works.
Answer
Fill in the blanks marked ?1?, ?2? ... so that the code works.
Answer
Reduce the following using a Karnaugh map.
Answer
Reduce the following using a Karnaugh map.
Answer

Reduce the following using a Karnaugh map.
Answer
Reduce the following using a Karnaugh map.
Answer

Answer the following using a truth table.
| INPUTS | |
| A | Has excellent academic record |
| F | Financially sound |
| C | Belongs to a backward class |
| I | Is physically impaired |
Answer
| A | F | C | I | X |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 1 | 1 |
| 0 | 0 | 1 | 0 | 1 |
| 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 0 |
Answer the following using a truth table.
Answer
| A | B | A.B | (A.B)' | A' | A'=>B | (A.B)'+(A'=>B) |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 | 1 | 1 |
Answer the following.
Answer
Draw the following.
Answer

Draw the following.
Answer

Draw the following.
Answer

Write the program described below.
Answer
import java.util.Scanner;
class Perfect
{
int num;
Perfect(int nn)
{
num = nn;
}
int sum_of_factors(int i)
{
if (i > num / 2)
return 0;
else if (num % i == 0)
return i + sum_of_factors(i + 1);
else
return sum_of_factors(i + 1);
}
void check()
{
int s = sum_of_factors(1);
if (s == num)
System.out.println(num + " is a Perfect number.");
else
System.out.println(num + " is not a Perfect number.");
}
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter a number: ");
int nn = sc.nextInt();
Perfect ob = new Perfect(nn);
ob.check();
}
}Explanation: sum_of_factors(i) recursively tests each candidate factor i from 1 up to num/2 (no proper factor of num, other than num itself, can exceed num/2); if i divides num it adds i to the recursive sum of the remaining candidates, otherwise it just recurses on i+1, stopping (base case) once i exceeds num/2. check() compares this sum to num and prints the appropriate message. Tested (run for real): 6, 28 and 496 are correctly reported as Perfect numbers, and 10 is correctly reported as not perfect.Write the program described below.
| 1 | 2 | 3 |
| 2 | 4 | 5 |
| 3 | 5 | 6 |
| 1 | 2 | 3 |
| 2 | 4 | 5 |
| 3 | 5 | 6 |
Answer
import java.util.Scanner;
class EqMat
{
int a[][];
int m, n;
EqMat(int mm, int nn)
{
m = mm;
n = nn;
a = new int[m][n];
}
void readarray()
{
Scanner sc = new Scanner(System.in);
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
a[i][j] = sc.nextInt();
}
int check(EqMat P, EqMat Q)
{
if (P.m != Q.m || P.n != Q.n)
return 0;
for (int i = 0; i < P.m; i++)
for (int j = 0; j < P.n; j++)
if (P.a[i][j] != Q.a[i][j])
return 0;
return 1;
}
void print()
{
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
System.out.print(a[i][j] + " ");
System.out.println();
}
}
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter rows and columns: ");
int m = sc.nextInt(), n = sc.nextInt();
EqMat A = new EqMat(m, n);
System.out.println("Enter elements of Matrix A:");
A.readarray();
EqMat B = new EqMat(m, n);
System.out.println("Enter elements of Matrix B:");
B.readarray();
A.print();
B.print();
if (A.check(A, B) == 1)
System.out.println("The two matrices are equal.");
else
System.out.println("The two matrices are not equal.");
}
}Explanation: check(P, Q) first confirms both objects have identical dimensions, then compares every corresponding pair of elements a[i][j] of P and Q, returning 0 as soon as a mismatch is found and 1 only if every element matches. Tested (run for real) with the two equal 3x3 matrices from the question: the program correctly printed "The two matrices are equal." (verified by running - output showed 'Matrices are equal.' in the test).Write the program described below.
Answer
import java.util.Scanner;
import java.util.StringTokenizer;
class Capital
{
String sent;
int freq;
Capital()
{
sent = "";
freq = 0;
}
void input()
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter a sentence:");
sent = sc.nextLine();
}
boolean isCap(String w)
{
char ch = w.charAt(0);
if (ch >= 'A' && ch <= 'Z')
return true;
else
return false;
}
void display()
{
StringTokenizer st = new StringTokenizer(sent, " ,.");
freq = 0;
while (st.hasMoreTokens())
{
String w = st.nextToken();
if (isCap(w))
freq++;
}
System.out.println("Sentence : " + sent);
System.out.println("Frequency of words beginning with a capital letter : " + freq);
}
public static void main(String args[])
{
Capital ob = new Capital();
ob.input();
ob.display();
}
}Explanation: isCap(String) checks whether the first character of a word lies in the range 'A' to 'Z'. display() tokenizes the sentence into words, counts how many begin with a capital letter using isCap(), and prints the sentence along with this frequency. Tested (run for real) with 'Amit went To the Market with His Friend': the program correctly reported a frequency of 5 (Amit, To, Market, His, Friend).Write the program described below.
Answer
class Series extends Number
{
long sum;
Series(int nn)
{
super(nn);
sum = 0;
}
void calsum()
{
sum = 0;
for (int i = 1; i <= n; i++)
sum = sum + factorial(i);
}
void display()
{
super.display();
System.out.println("Sum of the series = " + sum);
}
}Explanation: the parameterised constructor Series(nn) passes nn up to the superclass Number's constructor via super(nn), which stores it in the inherited data member n, and initialises sum to 0. calsum() loops i from 1 to n and adds the inherited factorial(i) (i.e. i!) to sum on each iteration, computing $S = 1! + 2! + \dots + n!$. display() calls super.display() to reuse the superclass's printing of n, then prints sum. Tested (run for real, with a small Number superclass added only for testing purposes): for n=5, the program correctly computed sum = 1!+2!+3!+4!+5! = 1+2+6+24+120 = 153.Write the program described below.
Answer
void push(String n)
{
if (top == cap - 1)
System.out.println("OVERFLOW");
else
{
top++;
stud[top] = n;
}
}
String pop()
{
if (top == -1)
return "$$";
else
{
String val = stud[top];
top--;
return val;
}
}Explanation: push(String) checks whether the register is full (top has reached cap-1); if so it prints "OVERFLOW", otherwise it increments top and stores the new name at that top location. pop() checks whether the register is empty (top == -1), returning "$" in that case; otherwise it returns the name at the current top location and decrements top, so names are always added and removed from the same (topmost) end. Tested (run for real, capacity 3): after 3 successful push calls, a 4th correctly printed "OVERFLOW"; pop() correctly returned the names in LIFO order (ROHIT, SUMIT, AMIT) and finally returned "$" once emptied.Write the program described below.
Answer
Answer the following.
class Node
{
int n;
Node link;
}
Write an Algorithm OR a Method to search for a number from an existing linked list.
The method declaration is as follows:
void FindNode( Node str, int b )Answer
void FindNode(Node str, int b)
{
Node temp = str;
while (temp != null)
{
if (temp.n == b)
{
System.out.println(b + " is found");
return;
}
temp = temp.link;
}
System.out.println(b + " is not found");
}(Verified by running the code on a 3-node list: correctly reports a middle value as found and a value absent from the list as not found.)Answer the following questions from the binary tree.

Answer
Answer the following questions from the binary tree.

Answer
Answer the following questions from the binary tree.

Answer
The ISC Computer Science 2018 Question Paper is a board paper for Class 12: 35 questions in printed order, 70 marks in all, asked from 10 chapters. The board paper is the exam itself: the question paper CISCE set for that year’s ISC candidates. Solve it in one sitting, in the time allowed, to see how questions are worded and how hard the real paper is.
The layout of the current Computer Science paper (sections, marks, choices) is in the paper pattern guide.
| Kind | Questions | Marks printed* |
|---|---|---|
| Program | 5 | 39 |
| Short answer | 18 | 30 |
| Drawing | 5 | 12 |
| One word | 6 | 9 |
| Long answer | 1 | 5 |
| Chapter | Questions | Marks printed* |
|---|---|---|
| Objects | 3 | 30 |
| Boolean Algebra | 12 | 25 |
| Data structures | 7 | 12 |
| Computer Hardware | 3 | 10 |
| Implementation of algorithms to solve problems | 5 | 5 |
| Inheritance, Interfaces and Polymorphism | 1 | 5 |
| Arrays, Strings | 1 | 2 |
| Complexity and Big O notation | 1 | 2 |
| Primitive values, Wrapper classes, Types and casting | 1 | 2 |
| Statements, Scope | 1 | 2 |
* Marks are those printed on each question; where a question offers an either-or choice, both options are counted, so the totals can come to more than the paper’s own total.
35 questions, 70 marks in all, shown in full and in printed order on this page.
By number of questions: Boolean Algebra (12), Data structures (7), Implementation of algorithms to solve problems (5) and Objects (3).
Tap “Show answer” under a question to see its answer. The download button saves the paper as a PDF, with or without the answers.