Question Is C 12
Question Is C 12
Given are two strings, input string and a mask string that remove all the characters of the [10]
mask string from the original string.
Example: INPUT: ORIGINALSTRING: communication
MASK STRING: mont
OUTPUT: cuicai
void display( ) : to display the original string and the newly formed
string nstr
Specify the class StringOp giving details of the constructor( ), void accept( ),
void form() and void display( ). Define a main( ) function to create an object and call all
the functions accordingly to enable the task.
Question 7 [10]
A class Mixarray contains an array of integer elements along with its capacity (More than or
equal to 3). Using the following description, form a new array of integers which will contain
only the first 3 elements of the two different arrays one after another.
Member functions/methods:
Mixarray mix(Mixarray P, Mixarray Q) : returns the resultant array having the first 3
elements of the array of objects P and Q
Specify the class Mixarraygiving details of the constructor(int), void input( ), Mixarray
mix(Mixarray,Mixarray) and void display( ). Define a main( ) function to create objects
and call all the functions accordingly to enable the task.
Question 8 [10]
A class LCM has been defined to find the Lowest Common Multiple of two
integers.
Some of the data members and member functions are given below:
Class name : LCM
Question 9
Recycle is an entity which can hold at the most 100 integers. The chain enables the user to
add and remove integers from both the ends i.e. front and rear.
Define a class ReCycle with the following details:
Class name : ReCycle
(i) A linked list is formed from the objects of the class Node. The class structure of the [2]
Node is given below:
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 )
(ii) Answer the following questions from the diagram of a Binary Tree given below:
B F
D C G
E H
(a) Name the root of the left sub tree and its siblings. [1]
(b) State the size and depth of the right sub tree. [1]
(c) Write the in-order traversal of the above tree structure. [1]