0% found this document useful (0 votes)
129 views12 pages

Haloalkane and Haloarenes

This document contains a sample question paper for Class 12 Computer Science. It has two parts - Part I with 8 multiple choice questions worth 1 mark each and Part II with 3 sections (A, B and C) containing longer questions worth between 2-5 marks each. Candidates must answer all questions in Part I and choose 6 questions from Part II with 2 from each section. The paper tests concepts related to Boolean algebra, logic gates, recursion, data structures and object-oriented programming in Java.

Uploaded by

singhanmolagra
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)
129 views12 pages

Haloalkane and Haloarenes

This document contains a sample question paper for Class 12 Computer Science. It has two parts - Part I with 8 multiple choice questions worth 1 mark each and Part II with 3 sections (A, B and C) containing longer questions worth between 2-5 marks each. Candidates must answer all questions in Part I and choose 6 questions from Part II with 2 from each section. The paper tests concepts related to Boolean algebra, logic gates, recursion, data structures and object-oriented programming in Java.

Uploaded by

singhanmolagra
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/ 12

ISC 2023 Examination

Sample Question Paper-1


COMPUTER SCIENCE
Class-12
SOLVED

Time Allowed : 3 hours Maximum Marks : 70


Candidate are allowed an additional 15 minutes 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) The law which states a + (b.c) = (a+b) . (a+c) is:[1]
(A) Associative Law (B) Distributive Law
(C) Involution Law (D) Commutative Law
(ii) The dual of (P + P’) . (Q + 0) = Q is: [1]
(A) P.P’ + Q.1 = Q (B) P.P’ + Q.0 = Q
(C) P.P + Q.1 = Q’ (D) P+P’ + Q+1 = Q
(iii) The complement of the Boolean expression (P . Q)’ + R’ is: [1]
(A) (P+Q).R (B) PQR
(C) (P’+Q’) .R’ (D) (P’+Q’).R
(iv) If ( x => ~y ) then, its inverse will be: [1]
(A) x => y (b) y => x
(C) ~y => x (d) ~x => y
(v) Transitive nature of inheritance is implemented through: [1]
(A) Single inheritance (B) Multiple inheritance
(C) Hybrid inheritance (D) Multilevel inheritance
(vi) Write the canonical sum of product form of the function y(A,B) = A + B. [1]
(vii) Name the basic gate that is equivalent to two NOR gates connected in series. [1]
(viii) State any one purpose of using the keyword super in Java programming. [1]
(ix) Define Interface with respect to data abstraction. [1]
(x) What is a linked list? [1]
Question 2
(i) Convert the following infix notation to postfix form. [2]
(P / Q – R) * (S + T)
(ii) A matrix N[11][8] is stored in the memory with each element requiring 2 bytes of storage. If the base address at
N[2][3] is 2140, find the address of N[7][5] when the matrix is stored in Row Major Wise. [2]
(iii) With reference to the code given below answer the questions that follow.
void Solve(int n)
{ int a=1,b=1;
Sample Question Papers 23

for (int i=n;i>0;i=i/10)


{ int d=i%10;
if (d%2==0)
a=a*d;
else
b=b*d;
}
System.out.println(a+” “+b);
}

(a) What will the function Solve( ) return when the value of n=3269? [2]

(b) What is the method Solve( ) computing? [1]
(iv) The following function quiz( ) is a part of some class. Assume ‘n’ is a positive integer, greater than 0. Answer the
given questions along with dry run / working.
int quiz( int n)
{
if ( n <= 1 )
return n;
else
return (--n % 2) + quiz(n/10);
}

(a) What will the function quiz( ) return when the value of n=36922? [2]

(b) State in one line what does the function quiz( ) do, apart from recursion? [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
(i) Given the Boolean function F(A,B,C,D) = ∑(0, 1, 2, 3, 4, 6, 9, 11, 13).

(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) Given the Boolean function F(A,B,C,D) = π(0, 1, 3, 5, 6, 7, 9, 11, 13, 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]
Question 4.
(i) A family intends to purchase a smart phone depending on the criteria given below: [5]

• Quad core processor with internal memory of 64 GB or more but not a resale phone
OR

• Resale phone with quad core processor but without warranty
OR

• Processor is not a quad core but with a warranty of 1 year and the internal memory is of 64 GB or more

The inputs are:
INPUTS
P Quad core processor
M Internal memory of 64 GB or more
R Resale phone
W Warranty of 1 year


(In all the above cases, 1 indicates yes and 0 indicates no.)
24 OSWAAL ISC Sample Question Papers, COMPUTER SCIENCE, Class-XII


Output: X [1 indicates purchased, 0 indicates not purchased for all cases]

Draw the truth table for the inputs and outputs given above and write the SOP expression
(ii) What is a half adder? Draw the logic circuit for the SUM and CARRY expression of a half adder using only NAND
gates. [3]
(iii) Simplify the following expression using Boolean laws: [2]
F = PQ + ( P + Q ) • ( P + PR ) + Q
Question 5.
(i) What is a decoder? How is it different from a multiplexer? Draw the logic circuit for a 2 to 4 decoder and explain its
working. [5]
(ii) Verify if the following proposition is valid: [3]
( P => Q ) Ù ( P => R ) = P => ( Q Ù R )

(iii) Write the maxterm and minterm for the function F(A, B,C,D) when, A=1, B=1, C=0 and D=1. [2]

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.
(Flow charts and Algorithms are not required.)
The programs must be written in Java.
Question 6.
Design a class Pronic to check if a given number is a pronic number or not. [A number is said to be pronic if the
product of two consecutive numbers is equal to the number] [10]
Example: 0 = 0×1
2 = 1×2
6 = 2×3
12 = 3 × 4
thus, 0, 2, 6, 12... are pronic numbers.
Some of the members of the class are given below:
Class name : Pronic
Data members/instance variables:
num : to store a positive integer number
Methods / Member functions:
Pronic( ) : default constructor to initialize the data member with legal initial
value
void acceptnum( ) : to accept a positive integer number
boolean ispronic(int v) : returns true if the number ‘num’ is a pronic number, otherwise
returns false using recursive technique
void check( ) : checks whether the given number is a pronic number by invoking
the function ispronic() and displays the result with an appropriate
message
Specify the class Pronic giving details of the constructor( ), void acceptnum( ), boolean ispronic(int) and void
check( ). Define a main( ) function to create an object and call the functions accordingly to enable the task.
Question 7.
Design a class OddEven to arrange two single dimensional arrays into one single dimensional array, such
that the odd numbers from both the arrays are at the beginning followed by the even numbers. [10]
Example: Array 1: { 2, 13, 6, 19, 26, 11, 4 }
Array 2: { 7, 22, 4, 17, 12, 45 }
Arranged Array = { 13, 19 11, 7, 17, 45, 2, 6, 26, 4, 22, 4, 12 }
Some of the members of the class are given below:
Class name : OddEven
Data members/instance variables:
a[ ] : to store integers in the array
m : integer to store the size of the array
Methods / Member functions:
Sample Question Papers 25

OddEven(int mm) : parameterised constructor to initialize the data member


m=mm
void fillarray( ) : to enter integer elements in the array
OddEven arrange(OddEven P, OddEven Q ) : stores the odd numbers from both the parameterized
object arrays followed by the even numbers from both
the arrays and returns the object with the arranged array
void display( ) : displays the elements of the arranged array
Specify the class OddEven giving details of the constructor( ), void fillarray( ), OddEven arrange(OddEven,
OddEven) and void display( ). Define a main( ) function to create objects and call the functions accordingly to
enable the task.
Question 8.
A class Encrypt has been defined to replace only the vowels in a word by the next corresponding vowel and forms
a new word. i.e. A ® E, E ® I, I ® O, O ® U and U ® A [10]
Example: Input: COMPUTER
Output: CUMPATIR
Some of the members of the class are given below:
Class name : Encrypt
Data members/instance variables:
wrd : to store a word
len : integer to store the length of the word
newwrd : to store the encrypted word
Methods / Member functions:
Encrypt( ) : default constructor to initialize data members with legal
initial values
void acceptword( ) : to accept a word in UPPER CASE
void freqvowcon( ) : finds the frequency of the vowels and consonants
in the word stored in ‘wrd’ and displays them with an
appropriate message
void nextVowel( ) : replaces only the vowels from the word stored in ‘wrd’ by
the next corresponding vowel and assigns it to ‘newwrd’,
with the remaining alphabets unchanged
void disp( ) : Displays the original word along with the encrypted
word

Specify the class Encrypt giving details of the constructor( ), void acceptword( ), void freqvowcon( ), void
nextVowel( ) and void disp( ). Define a main( ) function to create an object and call the functions accordingly to
enable the task.

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.
(Flowcharts are not required.)
Question 9.

Holder is a kind of data structure which can store elements with the restriction that an element can be added from
the rear end and removed from the front end only.

The details of the class Holder is given below:
Class name : Holder
Data members/instance variables:
Q[ ] : array to hold integers
26 OSWAAL ISC Sample Question Papers, COMPUTER SCIENCE, Class-XII

cap : maximum capacity of the holder


front : to point the index of the front end
rear : to point the index of the rear end
Methods / Member functions:
Holder(int n ) : constructor to initialize cap=n, front= 0 and rear=0
void addint( int v ) : to add integers in the holder at the rear end if possible,
otherwise display the message “ HOLDER IS FULL ”
int removeint( ) : removes and returns the integers from the front end of the
holder if any, else returns −999
void show( ) : displays the elements of the holder
(i) Specify the class Holder giving details of the functions void addint(int) and int removeint( ). Assume that the
other functions have been defined. [4]

The main( ) function and algorithm need NOT be written.
(ii) Name the entity described above and state its principle. [1]
Question 10.

A super class Bank has been defined to store the details of the customer in a bank. Define a subclass Interest to
calculate the compound interest. [5]
The details of the members of both the classes are given below:
Class name : Bank
Data members/instance variables:
name : to store the name of the customer
acc_no : integer to store the account number
principal : to store the principal amount in decimals
Methods / Member functions:
Bank( ... ) : parameterized constructor to assign values to the data members
void display( ) : to display the customer details
Class name Interest
Data members/instance variables:
rate : to store the interest rate in decimals
time : to store the time period in decimals
Methods / Member functions:
Interest( ... ) : parameterized constructor to assign values to the data members of
both the classes
double calculate( ) : to calculate and return the compound interest using the formula [
CI = P ( 1 + R/100 )N − P] where, P is the principal, R is the rate
and N is the time
void display( ) : to display the customer details along with the compound interest

Assume that the super class Bank has been defined. Using the concept of inheritance, specify the class Interest giving
the details of the constructor(...), double calculate( ) and void display( ).
The super class, main function and algorithm need NOT be written.
Question 11.
(i) A linked list is formed from the objects of the class: [2]
class Node
{
int num;
Node next;
}

Write an Algorithm OR a Method to insert a node at the beginning of an existing linked list.
The method declaration is as follows:
void InsertNode( Nodes starPtr, int n )
Sample Question Papers 27

(ii) 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) Name the children of the nodes B and G. [1]

(c) State the root of the right sub tree. [1]

SOLUTIONS
Sample Question Paper-1
COMPUTER SCIENCE

PART-I their dynamic size and ease of insertion and


deletion properties.
Answer. 1.
Answer 2.
(i) Option (b) is correct.
(i) Infix notation is
Explanation: Distributive Law states that the
multiplication of two variables and adding ((P/Q – R) * (S + T))
the result with a variable will result in the Element Stack Status
same value as multiplication of addition of
the variable with individual variables. For ( (
example: A + BC = (A + B) (A + C) ( ((
(ii) Option (a) is correct.
P (( P
Explanation: Duality Theorem states that the
dual of the Boolean function is obtained by / ((/ P
interchanging the logical AND operator with Q ((/ PQ
logical OR operator and zeros with ones. – ((– PQ/
(iii) Option (b) is correct.
R ((– PQ/R
Explanation: The complement of the product of
variables is equal to the sum of their individual ) ( PQ/R–
complements. Thus, the complement of the * (* PQ/R–
sum of variables is equal to the product of
( (*( PQ/R–
their individual complements.
S (*( PQ/R–S
(iv) Option (d) is correct.
Explanation: The inverse statement assumes + (*(+ PQ/R–S
the opposite of each of the original statements. T (*(+ PQ/R–ST
(v) Option (d) is correct. ) (* PQ/R–S+
Explanation: Transitive nature of inheritance is ) PQ/R–ST+ *
implemented through multilevel inheritance.
(vi) A + B = A.1 + B.1 Postfix form is PQ/R – ST + *
= A(B + B’) + B(A + A’) (ii) Given B = 2140
= AB + AB’ + BA + BA’ W = 2 bytes
= AB + AB’ + A’B i = 7, j = 5, Lr = 2, Lc = 3, Ur = 11, Uc = 8
= AB + AB’ + A’B n = Uc – Lc + 1 = 8 – 3 +1 = 6
(vii) OR gate N [i][j] = B + W [n (i – Lr) + (j – Lc)]
(viii) super is used to refer immediate parent class N[7][5] = 2140 + 2 [6 (7 – 2) + (5 – 3)]
instance variable. We can use super keyword = 2140 + 2 [6 (5) + 2]
to access the data member or field of parent = 2140 + 2 [30 + 2]
class.
= 2140 + 2 (32)
(ix) An interface in Java is a blueprint of a class.
= 2140 + 64
It has static constants and abstract methods.
The interface in Java is a mechanism to N[7][5] = 2204
achieve abstraction. There can be only abstract (iii) (a) Solve (3269)
methods in the Java interface, not method a = 1, b = 1
body. It is used to achieve abstraction and Iteration 1 : for (i = 3269 : i > 0 : i = i/10) True
multiple inheritance in Java. d=9
(x) A linked list is a data structure made of a chain if (9%2 == 0) False
of node objects. Each node contains a value
and a pointer to the next node in the chain. else
Linked lists are preferred over arrays due to b = 1*9 = 9
Solutions 29

Iteration 2 : for (i = 326 ; i > 0 ; i = i/10) True PART-II


d =6 Answer 3.
if (6%2 ==0) True (i) Given F(A,B,C,D) = ∑(0, 1, 2, 3, 4, 6, 9, 11, 13).
a = 1*6 = 6 (a)
Iteration 3 : for (i = 32 ; i > 0 ; i = i/10) True
d =6
if (2%2 ==0) True
a = 6*2 = 12
Iteration 4 : for (i = 3 ; i > 0 ; i = i/10) True
d=3
if (3%2 ==0) False
else
b = 9*3 = 27
Iteration 5 : for (i = 0) False
Output It produce output as 12 27
(b) Find and display the product of odd and
even digits from a number separately. There are 2 quad and 1 pair
12 27 Quad 2 (m0 + mu + m2 + m6) = A’D’
(iv) (a) Quad 3 (m1 + m3 + m9 + m11) = B’D
Iteration 1 : quiz (36922) Pair (m9 + m18) = AC’D
if (36922 <= 1) False So, F(A, B, C, D) = A’D’ + B’D + AC’D
else (b) Logic diagram
1 + quiz (3692)
Iteration 2 : quiz (3692)
if (3692 <= 1) False
else
1 + quiz (369)
Iteration 3 : quiz (369)
if (369 <= 1) False
else
0 + quiz (36)
Iteration 4 : quiz (36)
if (36 <= 1) False (ii) Given F(A,B,C,D) = p(0, 1, 3, 5, 6, 7, 9, 11, 13,
else 14, 15).
1+ quiz (3) (a)
Iteration 5 : quiz (3)
if (3 <= 1) False
else
0 + quiz (0)
Iteration 6 : quiz (0)
if (0 <= 1) True
return 0
Function will return 5
(b) Find number of even digits in a number.


There are 1 octet 1 quad and 1 pair
30 OSWAAL ISC Sample Question Papers, COMPUTER SCIENCE, Class-XII

(b) = PQ + PQ + P + Q
= PQ + P + Q
= P(Q + 1) + Q
F=P+Q
Answer 5.
(i) A decoder is a combinational circuit that
converts binary information from ’n’ input
lines to a maximum of 2n unique output lines.
This decoder is called n-to-m line decoder,
where m [2n. Here, the decoder has n inputs
Answer 4.
and m output lines and is also referred as n ×
(i) m decoder.
Inputs Output Difference between multiplexer and decoders
are as follows:
P M R W X
Multiplexer Decoders
0 0 0 0 0
(i) A digital A decoder is a
0 0 0 1 0
multiplexer is a combinational
0 0 1 0 0 combinational circuit that coverts
0 0 1 1 0 circuit that binary information
selects binary from ‘n’ input lines
0 1 0 0 0 information from to a maximum of
0 1 0 1 1 one of many 2n unique output
0 1 1 0 0 input lines and lines
directs it to a
0 1 1 1 1 single output
1 0 0 0 0 line.
1 0 0 1 0 (ii) It is called as data This decoder is
selector, since called n-to-m line
1 0 1 0 1
it selects one of decoder where m
1 0 1 1 0 many inputs. £ 2n
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 0

X (P, M, R, W) = P’MR’W + P’MRW + PM’RW’ +


PMR’W’ + PMR’W + PMRW’
(ii) Half adder is a combinational logic circuit with
two inputs and two outputs. The half adder
circuit is designed to add two single bit binary
number A and B. It is the basic building block
for an addition of two single bit numbers. This
circuit has two outputs carry and sum.

Here, A and B are two input variables and F0,


F1, F2 and F3 are outputs.
The truth table for 2 to 4 decoder is:
Truth Table of 2 × 4 Decoder
A B F0 F1 F2 F3
0 0 1 0 0 0
(iii) F = PQ + (P + Q) . (P + PR) + Q
0 1 0 1 0 0
= PQ + (P + Q) . P (1 + R) + Q
= PQ + (P + Q) . P + Q [By Property 1] 1 0 0 0 1 0
= PQ + PP + PQ + Q 1 1 0 0 0 1
= PQ + P + PQ + Q
From the given truth table,
Solutions 31
(i) When both inputs are equal to 0, then F0 (iii) When input A = 1 and B = 1, then F2 produces
produces 1 as output. 1 as output.
(ii) When input A = 0 and B = 1, then F1 produces (iv) When both inputs A and B are equal to 1, then
1 as output. F3 produces 1 as output.
(ii)
P Q R P=> Q P=> R (P =>Q)^(P=>R) Q^R P => (Q^R)
0 0 0 1 1 1 0 1
0 0 1 1 1 1 0 1
0 1 0 1 1 1 0 1
0 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0
1 0 1 0 1 0 0 0
1 1 0 1 0 0 0 0
1 1 1 1 1 1 1 1

Values for column (P =>Q) ^ (P=>R) and column P => (Q^R) are same. Hence Proved

(iii) The maxterm corresponding to the given value public static void main (String args[])
of the variables will be = A’+B’+C+D’ {
The minterm corresponding to the given valued Pronic p=new Prnoic();
of the variables will be = ABC’D
p.acceptnum( );
Answer 6.
p.check();
import java. util.*;
Answer 7.
public class Pronic
{ import java.util.*;
int num; class OddEven{
int a[];
Pronic( )
int m;
{
num = 0;} public OddEven(int mm){
void acceptnum ( ) m=mm;
{ a=new int[m];
Scanner x = new Scanner (System. }
in); public void fillarray(){
S y s t e m . o u t . p r i n t I n ( “ E n t e r Scanner sc=new Scanner(System.in);
number.”); System.out.println(“Enter numbers
num = x.nextInt (); into array...”);
} for(int i=0;i<m;i++)
boolean ispronic(int v) {
a[i]=sc.nextInt();
{
}
for (int i = 0;i <= (int) }
(sqrt(v));i++) public OddEven arrange(OddEven P,
if (v ==i * (i + 1)) OddEven Q){
return true; int k=0;
return false; OddEven obj=new OddEven(P.m+Q.m);
} for(int i=0;i<P.m;i++){
void check() if(P.a[i]%2!=0)
{ obj.a[k++]=P.a[i];
}
boolean f = ispronic(num);
for(int i=0;i<Q.m;i++){
if (f==true) if(Q.a[i]%2!=0)
S y s t e m . o u t . obj.a[k++]=Q.a[i];
println(“Pronic”); }
else for(int i=0;i<P.m;i++){
System.out.println(“not if(P.a[i]%2==0)
Pronic); obj.a[k++]=P.a[i];
}
{
for(int i=0;i<Q.m;i++){
32 OSWAAL ISC Sample Question Papers, COMPUTER SCIENCE, Class-XII

if(Q.a[i]%2==0) c=nextVowel.charAt(index);
obj.a[k++]=Q.a[i]; }
} newwrd+=c;
return obj; }
} }
public void display(){ public void disp(){
for(int i=0;i<m;i++){ System.out.println(“Original Word
System.out.print(a[i]+”\t”); “+wrd);
} System.out.println(“Encrypted Word
} “+newwrd);
public void main(){ }
OddEven ob1=new OddEven(7); public void main(){
OddEven ob2=new OddEven(6); Encrypt obj=new Encrypt();
ob1.fillarray(); obj.acceptword();
ob2.fillarray(); obj.freqvowcon();
OddEven ob3=arrange(ob1,ob2); obj.nextVowel();
ob3.display(); obj.disp();
} }
} }
Answer 8. Answer 9.
import java.util.*; void addint(int v)
class Encrypt{ {
String wrd; if(rear == size)
int len; {
String newwrd; System.out.println(“HOLDER IS
public Encrypt(){ FULL”);
wrd=””; }
len=0; else
newwrd=””; {
} Q[rear++] = v;
public void acceptword(){ }
Scanner sc=new Scanner(System.in); int removeint( )
System.out.println(“Enter a word {
“); if(font==size)
wrd=sc.nextLine().toUpperCase(); {
len=wrd.length(); System.out.println(“Underflow“);
} return–999;
public void freqvowcon(){ }
String vowel=”AEIOU”; else if (front== rear)
int c1=0,c2=0; {
d = Q [front];
for(int i=0;i<len;i++){ front = 0;
char c=wrd.charAt(i); rear = 0;
if(vowel.indexOf(c)>=0) return d;
c1++; }
else else
c2++; return Q [front++];
} }
System.out.println(“Number of vowel (ii) Above class describe the use of Queue.
“+c1);
Answer 10.
System.out.println(“Number of
consonants “+c2); import java.util.Scanner;
} public class Interest extends Bank
public void nextVowel(){ {
String vowel=”AEIOU”; static Scanner sc = new
String nextVowel=”EIOUA”; Scanner(System.in);
for(int i=0;i<len;i++){ double rate, time;
char c=wrd.charAt(i); Interest(String n, String a,
int index=vowel.indexOf(c); double pp)
if(index>=0){ {
Solutions 33

super(n, a, pp); Answer 11.


rate = 0.0; (i)
time = 0.0; void InsertNode (Node starPtr, int n)
} {
double calculate() Node p = starPtr
{ Node n1 = new Node ();
double CI; n1.num = n;
Cl = if (starPtr == null)
principal*Math. {
pow((1+rate/100.0),
starPtr=n1:
time;
}
CI = principal*(1+rate/100) –
principal; else
} {
public void display( ) n1.next=starPtr;
{ starPtr=n1;
super.display( ); }
System.out.println(“Rate; “+rate); }
System.out.println(“Time:” +time); (ii) (a) Inorder traversal
System.out.println(“Compound DBAFEGH
Interest:” +CI); (b) Children of node B are D
} Children of node G are E and H
} (c) Root of the right sub tree is F



You might also like