0% found this document useful (0 votes)
73 views8 pages

Computer Mock 2024

The document outlines a mock examination for Computer Science Paper 1 for the ASISC TN & PY Region in 2024, consisting of a total of 70 marks and a duration of three hours. It includes multiple-choice questions, coding exercises, and theoretical questions across various topics in computer science, divided into two parts with specific sections for answering. Candidates are required to complete all questions in Part I and select six questions from Part II, ensuring a mix from different sections.

Uploaded by

agrawalvaradraj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views8 pages

Computer Mock 2024

The document outlines a mock examination for Computer Science Paper 1 for the ASISC TN & PY Region in 2024, consisting of a total of 70 marks and a duration of three hours. It includes multiple-choice questions, coding exercises, and theoretical questions across various topics in computer science, divided into two parts with specific sections for answering. Candidates are required to complete all questions in Part I and select six questions from Part II, ensuring a mix from different sections.

Uploaded by

agrawalvaradraj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

ASISC TN & PY Region Mock Examination 2024

COMPUTER SCIENCE PAPER 1


(THEORY)
Maximum Marks: 70
Time Allowed: Three Hours
(Candidates are allowed additional 15 minutes for only reading the paper.
They must NOT start writing during this time.)

Answer all questions in Part I (compulsory) and six questions from Part-II,
choosing two questions from Section-A, two from Section-B and
two from Section-C.
All working, including rough work, should be done on the same sheet as the
The intended marks for questions or parts of questions are given in brackets[].

PART I – 20 MARKS
Answer all questions.
While answering questions in this Part, indicate briefly your working and reasoning,
wherever required.
Question 1
(i) If x=A’BC+AB’C+ABC+A’B’C, then find the value of x, when A=1, B=0 and C=1 [1]
(a) 2
(b) 0
(c) 1
(d) A.B.C
(ii) Assertion: De Morgan’s Law states that (A+B)’ = A’.B’ and (A.B)’=A’+B’
Reason : De Morgan’s theorem explains that the complement of sum of the variables is
same as the product of the complements of the variables and vice versa.

Which one of the following options is correct? [1]

(a) Both Assertion and Reason are true, and Reason is the correct explanation for Assertion.
(b) Both Assertion and Reason are true, but Reason is not the correct explanation for
Assertion.
(c) Assertion is true and Reason is false.
(d) Assertion is false and Reason is true

(iii) The dual of (X+Z’).(Y.0)+Z+1 is [1]


(a) (X’+Z).(Y’.0)+Z’+1
(b) (X.Z’)+(Y+0).Z.1
(c) (X.Z’)+(Y+1).Z.0
(d) (X+Z’)+(Y+0)+Z.1

1
(iv) What will be the output of the following code? [1]
“was it a car or a cat I saw?”.substring(9,12);
(a) was
(b) car
(c) cat
(d) saw

(v) The cardinal form of the expression F(x,y,z) = x’y’z’ + x’y’z + xyz’ is [1]
(a) ∑(0,1,6)
(b) Π(0,1,6)
(c) ∑(0,2,6)
(d) Π(0,1,6)

(vi) Assertion: “this” keyword in Java refers to the current instance of a class. [1]
Reason : It is used to access static members of the class.

Which one of the following options is correct?

(a) Both Assertion and Reason are true, and Reason is the correct explanation for Assertion.
(b) Both Assertion and Reason are true, but Reason is not the correct explanation for
Assertion.
(c) Assertion is true and Reason is false.
(d) Assertion is false and Reason is true

(vii) Name the search logic which at each stage, compares the sought key value with the key value
of the middle element of the array. [1]
(viii) State the different applications of Stack. [1]
(ix) Write any two characteristics of Binary tree. [1]
(x) List any two cases to analyze algorithm complexities. [1]
Question 2
(i) Convert the following infix notation to prefix form. [2]
X+(Y–Z)+((W+E)*F)/J

(ii) Each element of an array P[-12….10, 12…40] requires one byte of storage. If the array is
stored in column major order with the beginning location 1500, determine the location of
P[10][13]. [2]

(iii)With reference to the code given below, answer the questions that follow along with dry
run/working.
boolean num(int x)
{
int a=1;
for(int c=x; c>0;c/=10)
a*=10;
return((x*x%a)==x);
}
(a) What will the function num() return when the value of x = 25? [2]
(b) What is the method num() performing? [1]

2
(iv) The following function is a part of some class. It sorts the array A[ ] in ascending order
using insertion sort technique. There are some places in the code marked by ?1?, ?2? and
?3? which must be replaced by expressions / statements so that the program works correctly.

void insertsort(int A[ ])
{
int m=?1?;
int b,i,t;
for(i=1;i<m;i++)
{
t=A[i];
b=i-1;
while(?2? && t <A[b])
{
A[b+1]=A[b];
?3?
}
A[b]=t;

}
}
(a) What is the expression or statement at ?1? [1]
(b) What is the expression or statement at ?2? [1]
(c) What is the expression or statement at ?3? [1]

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 3

In Tanayaka Higher Secondary School, the School Board decided that a student should be given a
homework if any of the following conditions are true;

• The student was absent for two tests and got less than 60% marks in test average.
OR
• The student was absent for two tests and did not come to school in proper uniform.
OR
• The student got less than 60% marks in test average and did not take part in nature quiz.
The inputs are:

INPUTS
B The student was absent for 2 tests
M The student got less than 60% marks in test average
Q The student did not take part in nature quiz
U The student did not come to school in proper uniform
(In all the above cases, 1 indicates yes and 0 indicates no.)
Output: H – the student will be given homework [1 indicates yes and 0 indicates no in all cases]

3
(a) Draw the truth table for the inputs and outputs given above and write the SOP expression for
H(B, M, Q, U) [5]

(b) Reduce the above expression H (B, M, Q, U) by using 4-variable Karnaugh map, showing the
various groups (i.e. octal, quads and pairs).Draw the logic gate diagram for the reduced
expression. Assume that the variables and their complements are available as inputs. [5]

Question 4

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


(a) Reduce the above expression by using 4-variable Karnaugh map, showing the various
groups (i.e. octal, quads and pairs). [4]

(b) Draw the logic gate diagram for the reduced expression. Assume that the variables and
their complements are available as inputs. [1]

(ii) From the logic circuit diagram given below, name the outputs (1), (2), (3) and (4) and
finally derive the Boolean expression (Output) and simplify it. Identify the propositional
connective which is equivalent to the simplified Boolean expression. [4]

(iii) Construct a logic circuit using NAND gates only for the expression M.(N+O) [1]

Question 5

(i) How is a Half Adder different from a Full Adder? Draw the truth table, logic diagram and
derive the sum and carry expression for Full Adder. [5]

(ii) Verify if the following proposition is valid by using truth table. [2]
(P→Q).(P→R)=P→(Q.R)

(iii) How is Decoder different from Multiplexer? Also mention the applications of
Multiplexer. [3]

4
SECTION – B
Answer any two questions.

Each program should be written in such a way that it clearly depicts the logic of the problem.
This can be achieved by using mnemonic names and comments in the program.
(Flowcharts and Algorithms are not required.)
The programs must be written in Java.

Question 6 [10]

A happy number is a number in which the eventual sum of the square of the digits of the number is
equal to 1.
For Example: 28
28=22+82=4+64=68
68=62+82=36+64=100
100=12+02+02=1 +0+0=1
Hence, 28 is a happy number.

Example:12
12 =12+22=1+4=5
Hence, 12 is not a happy number.

Design a class Happy to check if a given number is a happy number. Some of the member of the
class are given below:

Classname : Happy
Data members/ instance variables:
n : stores the number
Member functions/ Methods :
Happy( ) : constructor to assign 0 to n
void getnum(int nn) : to assign the parameter value to the number n=nn
int sum_sq_digits(int x) : returns the sum of the square of the digit of the number
x using recursive technique
void ishappy() : checks if the given number is a happy number by
calling the function sum_sq_digits (int) and displays an
appropriate message

Specify the class Happy giving details of the constructor( ). void getnum(int) , int
sum_sq_digits(int) and void ishappy() . Also define a main() function to create an object and
call the methods to check for happy number.

5
Question 7 [10]

A class Sum_RowCol is declared as follows:

Class name : Sum_RowCol


Data members/ Instance Variables:
mat[20 ][20 ] : double dimensional integer array
m : to store the number of rows
n : to store the number of columns
Member Functions/Methods :
Sum_RowCol) : Default constructor
void row_col(int mx, int nx) : To assign mx to m and nx to n
void readrow_col( ) : To read matrix mat[ ][ ] of m x n
void display_mat( ) : To print the matrix of m x n order row wise.
void sum_mat( ) : To store sum of all the rows and columns in
their respective rows and columns in their
respective rows and columns in the matrix
mat[ ][ ] and print the newly created matrix.

Sample Input Sample Output


10 15 16 18 10 15 16 18 59
15 14 12 11 15 14 12 11 52
11 12 16 17 11 12 16 17 56
12 10 14 16 12 10 14 16 52
48 51 58 62

Specify the class Sum_RowCol giving details of the constructor, the functions void
row_col(int mx, int nx), void readrow_col( ) , void display_mat( ) and void sum_mat( ).
Define the main() function to create an object and call the functions accordingly to enable the
task.

Question 8 [10]

A class Text has been defined to display the sentence in reverse order word wise, For example
Input: God is great
Output: doG si taerg
Class name : Text
Data members/ Instance Variables:
str : to store the original string
nstr : to store the new string
Member Functions/Methods :
Text(… ) : Parameterized constructor to initialize
the data member
String reverse(String) : reverse the sentence word wise.
void display( ) : display the original and new strings

Specify the class Text, giving details of the constructor(…),String reverse (String) and
void display(). Define the main() function to create an object and call the functions
accordingly to enable the task.

6
SECTION – C
Answer any two questions.
Each program should be written in such a way that it clearly depicts the logic of the problem
stepwise.
This can be achieved by using comments in the program and mnemonic names or pseudo codes
for algorithms. The programs must be written in Java and the algorithms must be written in
general/ standard form, wherever required / specified.
(Flow charts are not required.)
Question 9 [5]

A Travel Agency manager decided to implement some auto upgrading applications. The details of
the classes Travel and Journey are given below:

Class name : Travel


Data members/Instance Variables:
Name : string to store name of the passenger
Age : integer to store age of a passenger
Phone : long to store phone number
Member Functions/Methods :
Travel(…) : Parameterized constructor to assign data
Members
void fnOutput() : to display the data members

Class name : Journey


Data members/Instance Variables:
fromcity : string to store name of the “fromcity”
tocity : string to store name of the “tocity”
fare : double to store fare of travel
Member Functions/Methods :
Journey(…) : Parameterized constructor to assign data
Members for both the classes
double fnDiscount( ) : to calculate and return a discount of 40% on
fare of travel if the age of the passenger is <12
years and a discount of 60% if the age >=60
years.
void fnOutput() : to display all the data members. Also display
the amount that a passenger should pay
considering if he is eligible for any discount or
not by calling the function fnDiscount().

Assume that the super class Travel has been defined. Using the concept of inheritance, specify the
class Journey giving the details of the constructor(...), double fnDiscount( ) and void fnOutput( ).
Main method need not be written.

7
Question 10 [5]

In a computer game, a vertical column and a pile of rings are displayed. The objective of the game is
to pile up rings on the column till it is full. It can hold 10 rings at the most. Once the column is full,
the rings have to be removed from the top, till the column is empty and the game is over. Define the
class GameRing with the following details:

Class name : GameRing


Data members/Instance Varibles:
R[] : integer array to hold rings
Max : integer to hold maximum capacity of the R
array
uppr : integer to point the uppermost element
Member Functions/Methods :
GameRing(int m) : constructor to initialize the data members
void jump_in( int) : adds a ring to the top of the column, if possible,
otherwise, displays a message “Column full.
Start removing rings”.
void jump_out( ) : removes the ring from the top, if column is not
empty, otherwise, outputs a message,
“Congratulations. The game is over”.

Specify the class GameRing giving the details of the constructor() and functions void jump_in(int),
void jump_out(). Also define the main() functions to create an object and call methods accordingly to
enable the task.
Question 11

(i) What is the worst case complexity for the following code segment? [1]
for(i=0;i<A;i++)
{
Statements
}
for(j=0;j<B;j++)
{
for(k=0;k<C;k++)
{
Statements
}
}
(ii) How would the complexity change if all the three loops went to N instead
of A, B & C? [1]
(iii) Answer the following questions from the diagram of a Binary Tree given below:

(a) Write the In-order traversal of the above tree structure. [1]
(b) Write the successor of the node F [1]
(c) Write the internal nodes of a tree [1]

You might also like