Page 526 - computer science (868) class 11
P. 526
void printarray( ) : Prints the array
void check( ) : checks whether the array is a Lower Triangle matrix or not. The result should be displayed with an
appropriate message.
Specify the class lowertriangle giving the details of the constructor( ), void input( ), void printarray() and void
check( ). Define the main( ) function to create an object and call the functions accordingly to enable the task.
Enter the size of the matrix: 4
The Matrix is:
5 0 0 0
3 1 0 0
4 9 4 0
6 8 7 2
The Matrix is Lower Triangular
Question 8:
Input a word in uppercase and check for the position of the first occurring vowel and perform the following
operations. [10]
(i) Words that begin with a vowel are concatenated with “AY”.
For example, AMERICA becomes AMERICAAY.
(ii) Words that contain a vowel in-between should have the first part from the position of the vowel till the end,
followed by the part of the string from the beginning till the position of the vowel and concatenated by “AC”.
For example, PRINT becomes INTPRAC.
(iii) Words that do not contain a vowel are concatenated with “AN”.
For example, SKY becomes SKYAN.
Design a class Rearrange using the description of the data members and member functions given below.
Class name: word_change
Data Members/instance variables:
wrd: to store a word
wrd_re: to store the rearranged word
len: to store the length of the word
Member functions:
word_change( ): constructor to initialise the instance variables
void accept ( ): accepts the word and convert to capital letters
void change( ): converts the word into its changed form and stores in wrd_re
void show( ): displays the original and the changed word
Specify the class Rearrange giving the details of the constructor( ), void accept( ), void change( ) and void show( ).
Define a main( ) function to create an object and call the function accordingly to enable the task.
524524 Touchpad Computer Science-XI

