• Home
  • Courses
  • School
  • Programs
  • Problems
  • Contact Us
  • My account
  • Register

Have any question?

(+91) 98222 16647
info@simplycoding.in
RegisterLogin
Simply Coding
  • Home
  • Courses
  • School
  • Programs
  • Problems
  • Contact Us
  • My account
  • Register

Sample Papers

ISC Class 12 Computer Science previous year paper (2018)

  • Categories Sample Papers

Part I (20 marks)
Answer all questions.

While answering questions in this Part, indicate briefly your working and reasoning, wherever required.

Question 1 [1 mark each]

(a) State the Commutative law and prove it with the help of a truth table.
(b) Convert the following expression into its canonical POS form:
           F (X, Y, Z) = (X+Y’). (Y’+Z)
(c) Find the dual of:
          (A’+ B). (1 +B’) = A’ + B
(d) Verify the following proposition with the help of a truth table
           (P ∧ Q) ∨ (P ∧ ∼ Q) = P
(e) If F (A, B, C) = A’ (BC’ + B’C), then find F’
Ans. 
(a) Law: Commutative Law (i) A + B = B + A (ii) A . B = B. A
           Truth Table:

ABA+BB+A
0000
0111
1011
1111

(b) F (X, Y, Z) = (X+Y’) . (Y’+Z)
                          = (X+Y’+0). (Y’+Z+0)
                          = (X+Y’+ (Z.Z’)). (Y’+Z+ (X.X’))
                          = (X+Y’+Z). (X+Y’+Z’). (X+Y’+Z). (X’+Y’+Z)
                          = (X+Y’+Z). (X+Y’+Z’). (X’+Y’+Z)
(c) Equation: (A’+ B). (1 +B’) = A’ + B
              Dual = A’. B + 0.B’ = A’. B
(d) Verify: (P∧Q)∨(P∧∼Q) = P
         
PQP∧QP∧∼Q(P∧Q)∨(P∧∼Q)
00000
01000
10011
11101

(e) F (A, B,C) = A’(BC’+B’C)
                       F’ = A’’ + (BC’ + B’C)’
                           = A+ (BC’)’. (B’C)’
                           = A + (B’ + C). (B + C’)

Question 2 [2 marks each ]

(a) What are Wrapper Classes? Give any two examples. 
(b) A matrix A[m][m] is stored in the memory with each element requiring 4 bytes of storage. If the base address at A [1][1] is 1500 and address of A [4][5] is 1608,
determine the order of matrix when it is stored in Column Major Wise.
(c) Convert the following infix notation to postfix form:
               A + (B – C * (D / E) * F)
(d) Define Big ‘O’ notation. State the two factors which determine the complexity of an algorithm.
(e) What is exceptional handling? Also, state the purpose of finally block in a try catch statement.
Ans.

(a) Wrapper Class: A class which defines a primitive data type. A Wrapper class is a class whose object wraps or contains a primitive data types. Wrapper class in java provides the mechanism to convert primitive into object and object into primitive.
             Example: Integer, Character, Double etc.
(b) Column Major Wise: P[i][j] = BA + W [ (j – lc )* rows + (i – lr]
              Putting the values: 1608 = 1500 + 4[ (4*m + 3)]
                                                 1608 = 1500 + 16m + 12
                                                 16m = 1608-1512
                                                 m = 6
(c) Infix to Postfix: A + (B – C * (D / E) * F)
                               = A + (B – C * DE/ * F)
                               = A + (B- CDE/* * F)
                               =A + (BCDE/*F*-)
                        Ans: ABCDE/*F*-+
(d) Big ‘O’ Notation: The unit of measurement of efficiency of an algorithm. A theoretical measure of the execution of an algorithm, usually the time or memory needed, given the problem size n, which is usually the number of items.
Two factors are Time and Space(memory)
(e) Exceptional Handling: The way to handle anomalous situations during run time. Finally, is a block of code which is executed with or without exceptions.

Question 3 [5 marks ]

The following is a function of some class which checks if a positive integer is a Palindrome number by returning true or false. (A number is said to be Palindrome if the reverse of the number is equal to the original number.) The function does not use modulus (%) operator to extract digit. There are some places in the code marked by?1?, ?2?, ?3?, ?4?, ?5? which may be replaced by a statement / expression so that the function works properly.

boolean PalindromeNum( int N )
{
int rev= ?1?;
int num=N;
while(num>0)
{
int f= num/ 10;
int s = ?2?;
int digit = num - ?3?;
rev= ?4? + digit;
num /= ?5?;
}
if ( rev= =N )
return true;
else
return false;
}

          (i) What isthe statement or expression at ?1?
          (ii) What isthe statement or expression at ?2?
          (iii) What isthe statement or expression at ?3?
          (iv) What isthe statement or expression at ?4?
          (v) What isthe statement or expression at ?5?

Ans. 
              (i) 0
              (ii) f*10
              (iii) s OR f*10
              (iv) rev*10
              (v) 10

PART – II (50 Marks)

Answer six questions in this part, choosing two questions from
Section A, two from Section B and two from Section C.

SECTION – A
Answer any two questions.

Question 4 

(a) Given the Boolean function F (A, B, C, D) = Ʃ (0,2,4,8,9,10,12,13).

    1. Reduce the above expression by using 4-variable Karnaugh map, showing the various groups (i.e. octal, quads and pairs).
    2. Draw the logic gate diagram for the reduced expression. Assume that the variables and their complements are available as inputs.

(b) Given the Boolean function F (A, B, C, D) = π(3,4,5,6,7,10,11,14,15).

    1. Reduce the above expression by using 4-variable Karnaugh map, showing the various groups (i.e. octal, quads and pairs).
    2. Draw the logic gate diagram for the reduced expression. Assume that the
      variables and their complements are available as inputs.

Ans.
(a) F(A, B,C,D) = ∑ ( 0, 2 , 4, 8, 9, 10, 12, 13 )

F(A, B,C,D) = ∑ ( 0, 2 , 4, 8, 9, 10, 12, 13 ) 1

There are two quads and one pair:
     Quad 1 (m0+ m4+ m12+ m8 ) = C’D‘ Quad2 ( m0+ m2+ m8+ m10 ) = B’D‘
     Quad 3 (m8+ m9 + m12 + m13) = AC’
Hence F (A, B, C, D) = C’D’ + B’D’ + AC’

F(A, B,C,D) = ∑ ( 0, 2 , 4, 8, 9, 10, 12, 13 ) 2

4(b) F(A,B,C,D) = π ( 3 , 4 , 5 , 6 , 7 , 10 , 11 , 14 , 15 )

F(A,B,C,D) = π ( 3 , 4 , 5 , 6 , 7 , 10 , 11 , 14 , 15 ) 1

There are three quads :
      Quad 1: (M4 M5 M6 M7) = A + B’ Quad 2: ( M3 M7 M11 M15) = C’ + D’
      Quad 3: (M10 M11 M14 M15) = A’ + C’
Hence F (A, B,C,D) = ( A + B’ ) . (C’ + D’). (A’ + C’)

F(A,B,C,D) = π ( 3 , 4 , 5 , 6 , 7 , 10 , 11 , 14 , 15 ) 2

Question 5

(a)A training institute intends to give scholarships to its students as per the criteria given below:
• The student has excellent academic record but is financially weak.
                                             OR
• The student does not have an excellent academic record and belongs to a backward class.
                                             OR
• The student does not have an excellent academic record and is physically impaired.
The inputs are:
     INPUTS
           A Has excellent academic record
           F Financially sound
           C Belongs to a backward class
           I Is physically impaired
  (In all the above cases 1 indicates yes and 0 indicates no).
Output : X [1 indicates yes, 0 indicates no for all cases]
Draw the truth table for the inputs and outputs given above and write the POS expression for X (A, F, C, I). [5]
(b) Using the truth table, state whether the following proposition is a tautology, contingency or a contradiction: [3]
                    ~(A ˄ B) V ( ~A => B)
(c) Simplify the following expression, using Boolean laws: [2]
                     A • (Aʹ + B) • C • (A + B)
Ans. 
(a)

AFCIX (OUTPUT)
00000
00011
00101
00111
01000
01011
01101
01111
10001
10011
10101
10111
11000
11010
11100
11110

SOP Expression: X (A ,F, C, I) = Σ (1, 2, 3, 5, 6, 7, 8, 9, 10, 11)
OR                         X = A’F’C’I + A’F’CI’ + A’F’CI + A’FC’I + A’FCI’ + A’FCI + AF’C’I’ + AF’C’I + AF’CI’ + AF’CI
(b) ∼(A∧B) ∨ (∼A=>B) is a Tautology, Contradiction or Contingency
AB∼A∼B∼(A∧B)∼A=>B∼(A∧B) ∨ (∼A=>B)
0011101
0110111
1001111
1100011

                    Hence, it is a Tautology
(c) Simplify : A.(A’+B).C.(A+B)
                      = (AA’ + AB).(AC + BC)
                      = (0 + AB).(AC + BC)
                      = ABC + ABC
                      = ABC

Question 6

(a) What is an Encoder? Draw the Encoder circuit to convert A-F hexadecimal numbers to binary. State an application of a Multiplexer. [5]
(b) Differentiate between Half Adder and Full Adder. Draw the logic circuit diagram for a Full Adder. [3]
(c) Using only NAND gates, draw the logic circuit diagram for Aʹ + B. [2]
Ans. 
(a) An Encoder is a combinational circuit which inputs 2n or fewer lines and outputs n lines.
Circuit diagram of a A – F Encoder:

Encoder

Application of a Multiplexer: 1. Used for Routing of signals
                                                   2. Data Transmission
                                                   3. Telephone Exchanges / TV etc
(b) Half Adders : It is a combinational circuit which adds two input binary bits and outputs two binary bits.
       Full Adders : It is a combinational circuit which adds three input binary bits and outputs two binary bits.
        Circuit of a Full Adder : SUM=A⊕B⊕C
                                                    CARRY = AB + BC + AC

Full Adder 2

(c) Using NAND – circuit of Aʹ + B

NAND

SECTION – B
Answer any two questions.

Question 7 [marks 10]

Design a class Perfect to check if a given number is a perfect number or not. [ A number is said to be perfect if sum of the factors of the number excluding itself is equal to the original number]
         Example : 6 = 1 + 2 + 3 (where 1, 2 and 3 are factors of 6, excluding itself)
Some of the members of the class are given below:

Class namePerfect
Data members/instance variables:
numto store the number
Methods/Member functions:
Perfect (int nn)parameterized constructor to initialize the data member num=nn
int sum_of_factors(int i)returns the sum of the factors of the number(num), excluding itself, using recursive technique
void check()checks whether the given number is perfect by invoking the function sum_of_factors() and displays the result with an appropriate message

Specify the class Perfect giving details of the constructor (), int sum_of_factors(int) and void check (). Define a main () function to create an object and call the functions accordingly to enable the task.

import java.util.*;
class Perfect
{
int num;
Perfect(int nn)
{
num=nn;
}
int sum_of_factors(int i)
{
if (i == num)
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()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter a number");
int no=sc.nextInt();
Perfect ob=new Perfect(no); // OR Perfect ob=new Perfect(6);
ob.check(); // ob.check();
}
}

Question 8 [marks 10]

Two matrices are said to be equal if they have the same dimension and their corresponding elements are equal.
For example, the two matrices A and B given below are equal:

matrices A and B

Design a class EqMat to check if two matrices are equal or not. Assume that the two
matrices have the same dimension.
Some of the members of the class are given below:

Class nameEqMat
Data members/instance variables:
a[ ][ ]to store integer elements
mto store the number of rows
nto store the number of columns
Member functions/methods:
EqMat(int mm, int nn)parameterised constructor to initialise the data members m = mm and n = nn
void readarray( )to enter elements in the array
int check(EqMat P, EqMat Q)checks if the parameterized objects P and Q are equal and returns 1 if true, otherwise returns 0
void print( )displays the array elements

Define the class EqMat giving details of the constructor( ), void readarray( ), int check(EqMat, EqMat) and void print( ). Define the main( ) function to create objects and call the functions accordingly to enable the task.

import java.util.*;
class EqMat
{
int a[][];
int m;
int n;
static Scanner sc=new Scanner(System.in);
EqMat(int mm,int nn)
{
m=mm;
n=nn;
a=new int[m][n];
}
void readarray()
{
System.out.println("enter" + (m*n) + "elements" );
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)
{
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++)
{
System.out.println();
for (int j=0;j<n;j++)
System.out.print(a[i][j]+"\t");
}
}
public static void main()
{
EqMat ob1=new EqMat(3,3);
EqMat ob2=new EqMat(3,3);
System.out.println("enter nos for the Ist Matrix");
ob1.readarray();
System.out.println("enter nos for the 2nd Matrix");
ob2.readarray();
if (ob1.check(ob1,ob2)==1)
{
System.out.println("Equal Matrix");
ob1.print();
ob2.print();
}
else
System.out.println("not equal");
}
}

Question 9 [marks 10]

A class Capital has been defined to check whether a sentence has words beginning with a capital letter or not.
Some of the members of the class are given below:

Class nameCapital
Data member/instance variable:
sentto store a sentence
freqstores the frequency of words beginning with a capital letter
Member functions/methods:
Capital( )default constructor
void input()to accept the sentence
boolean isCap(String w)checks and returns true if word begins with a capital letter, otherwise returns false
void display ()displays the sentence along with the frequency of the words beginning with a capital letter

Specify the class Capital, giving the details of the constructor( ), void input( ), boolean isCap(String) and void display( ). Define the main( ) function to create an object and call the functions accordingly to enable the task.

import java.util.*;
class Capital
{
String sent;
int freq;
Capital()
{
sent="";
freq=0;
}
void input()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the sentence");
sent=sc.nextLine();
}
boolean isCap(String w)
{
char c=w.charAt(0);
if (Character.isUpperCase(c) )
return true;
else
return false;
}
void display()
{
System.out.println("sentence="+sent);
String b=" "+sent;
char c;
for(int i=0;i<b.length();i++)
{
c=b.charAt(i);
if (c==' ')
{
if(Character.isUpperCase(b.charAt(i+1)) )
freq++;
}
}
System.out.println("Freqency of title word="+freq);
}
public static void main()
{
Capital ob=new Capital();
ob.input();
ob.display();
}
}

SECTION – C
Answer any two questions.

Question 10 [marks 5]

A super class Number is defined to calculate the factorial of a number. Define a sub class Series to find the sum of the series S = 1! + 2! + 3! + 4!+……………+n!
The details of the members of both the classes are given below:

Class nameNumber
Data member/instance variable:
nto store an integer number
Member functions/methods:
Number(int nn)parameterized constructor to initialize the data member n=nn
int factorial (int a)returns the factorial of a number (factorial of n = 1×2×3×………×n)
void display()displays the data members
Class name:Series
Data member/instance variable:
sumto store the sum of the series
Member functions/methods:
Series(…)parameterized constructor to initialize the data members of both the classes
void calsum( )calculates the sum of the given series
void display( )displays the data members of both the classes

Assume that the super class Number has been defined. Using the concept of inheritance, specify the class Series giving the details of the constructor(…),void calsum( ) and void display( ).
The super class, main function and algorithm need NOT be written.

class Series extends Number
{
long sum;
Series(int nn)
{
super(nn);
sum=0;
}
void calsum()
{
for (int i=1;i<=n;i++)
sum=sum+factorial(i);
}
void display()
{
super.display();
System.out.println("sum of the series="+sum);
}
}

Question 11 [marks 5]

Register is an entity which can hold a maximum of 100 names. The register enables the user to add and remove names from the top most end only.
Define a class Register with the following details:

Class nameQueue
Data Members / instance variables:
Que[ ]array to hold the integer elements
sizestores the size of the array
frontto point the index of the front
rearto point the index of the rear
Member functions:
Queue (int mm)constructor to initialize the data size = mm, front = 0, rear = 0
void addele(int v )to add integer from the rear if possible else display the message “Overflow”
int delele( )returns elements from front if present, otherwise displays the message “Underflow” and return -9999
void display ( )displays the array elements

(a) Specify the class Register giving details of the functions void push(String) and String pop( ). Assume that the other functions have been defined.
       The main function and algorithm need NOT be written.  [4]
(b) Name the entity used in the above data structure arrangement. [1]
Ans.

(a) 
class Register
{
void push(String n)
{
if (top<cap-1)
stud[++top]=n;
else
System.out.println("OVERFLOW");
}
String pop()
{
if (top>=0)
return stud[top--];
else
return " $";
}
}

(b) The entity used in the above data structure is Stack.

Question 12

(a) A linked list is formed from the objects of the class Node. The class structure of the Node is given below: [2]

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 )
(b) Answer the following questions from the diagram of a Binary Tree given below:

Binary Tree 2

(i) Write the inorder traversal of the above tree structure. [1]
(ii) State the height of the tree, if the root is at level 0 (zero). [1]
(iii) List the leaf nodes of the tree. [1]
Ans.
(a) ALGORITHM:
              Step 1. Start
              Step 2. Set temporary pointer to the first node
              Step 3. Repeat steps 4 and 5 until the pointer reaches null. Display number not found
              Step 4. check for number , if found display, exit
              Step 5. Move pointer to the next node
              Step 6. End algorithm

METHOD:

void FindNode(Node str, int b)
{
Node temp=str;
while(temp!=null)
{
if (temp.n == b)
{
System.out.prinln(b+” is found “);
break;
}
temp=temp.link;
}
}

(b) (i) G,E,H,C,A,B,F,D
      (ii) 3
      (iii) G,H,F

  • Share:
author avatar
Simply Coding

Previous post

XML Prolog
July 22, 2021

Next post

ICSE Class 10 COMPUTER APPLICATIONS previous year paper (2018)
July 24, 2021

You may also like

ISC Class 12 2020
ISC Class 12 Computer Science previous year paper (2020)
28 August, 2021
ISC Class 12 2017
ISC Class 12 Computer Science previous year paper (2017)
28 August, 2021

Leave A Reply Cancel reply

You must be logged in to post a comment.

Categories

  • Uncategorized
  • Programs
    • Python
    • Java
  • Problems
    • Python
    • Java
    • Web Development
      • Internet
    • Emerging Technologies
  • Notes
    • General
    • QBasic
    • MS Access
    • Web Development
      • XML
      • HTML
      • JavaScript
      • Internet
    • Database
    • Logo Programming
    • Scratch
    • Emerging Trends
      • Artificial Intelligence
      • Internet of Things
      • Cloud Computing
      • Machine Learning
    • Computer Fundamentals
      • Computer Networks
      • E-Services
      • Computer Hardware
    • Python
    • Java
  • School
    • ICSE
      • Computers Class 9
        • Java Introduction
        • Tokens & Data Types
        • Java Operators
        • Math Library
        • if & switch
        • For & While
        • Nested loops
      • Computer Class 10
        • Sample Papers
        • OOPS concepts
        • Functions in Java
        • Constructors
        • Arrays in Java
        • Strings in Java
    • SSC
      • IT Class 11
        • IT Basics
        • DBMS
        • Web Designing
        • Cyber Laws
      • IT Class 12
        • Web Designing
        • SEO
        • Advanced JavaScript
        • Emerging Tech
        • Server Side Scripting
        • E-Com & E-Gov
      • Computer Science 11
      • Computer Science 12
    • CBSE
      • Computer 9
        • Basics of IT
        • Cyber Safety
        • Scratch
        • Python
      • Computer 10
        • Sample Papers
        • Networking
        • HTML
        • Cyber Ethics
        • Scratch
        • Python
      • Computer Science 11
        • Computer Systems
        • Python 11
          • Python Basics
          • Python Tokens
          • Python Operators
          • Python if-else
          • Python loops
          • Python Strings
          • Python List
          • Python Tuple
          • Python Dictionary
          • Python Modules
        • Data Management
      • Computer Science 12
        • Sample Papers
        • Python 12
          • Python Functions
          • Python File Handling
          • Python Libraries
          • Python Recursion
          • Data Structures
        • Computer Networks
        • Data Management
    • ISC
      • Computer Science 11
        • Introduction to Java
        • Values & Data Types
        • Operators
        • if & switch
        • Iterative Statements
        • Functions
        • Arrays
        • String
        • Data Structures
        • Cyber Ethics
      • Computer Science 12
        • Sample Papers
        • Boolean Algebra
        • OOPS
        • Wrapper Classes
        • Functions
        • Arrays
        • String
Simply Coding Computer Courses for School                Privacy Policy     Terms of Use     Contact Us

© 2021 Simply Coding

Login with your site account

Lost your password?

Not a member yet? Register now

Register a new account

Are you a member? Login now