The total time to be spent on the Planning and the Examination Session is Three hours.
After completing the Planning Session, the candidate may begin with the Examination Session. A maximum of 90 minutes is permitted to begin the Examination Session.
However, if candidates finish earlier, they are to be permitted to begin the Examination Session.
—————————————————————————————————-————

The total time to be spent on the Planning and the Examination Session is Three hours.
After completing the Planning Session, the candidate may begin with the Examination Session.
A maximum of 90 minutes is permitted to begin the Examination Session.
However, if candidates finish earlier, they are to be permitted to begin the Examination Session.
——————————————————————————————————-————

As it is a practical examination the candidate is expected to do the following:
1. Write an algorithm for the selected problem. [3]
(Algorithm should be expressed clearly using any standard scheme such as pseudo code or in steps which are simple
enough to be obviously computable.)
2. Write a program in JAVA language. The program should follow the algorithm and [5]
should be logically and syntactically correct.
3. Document the program using mnemonic names / comments, identifying and clearly [2]
describing the choice of data types and meaning of variables.
4. Code / Type the program on the computer and get a printout (hard copy). Typically, [2]
this should be a program that compiles and runs correctly.
5. Test run the program on the computer using the given sample data and get a printout [5]
of the output in the format specified in the problem.
6. Viva-Voce on the Selected Problem. [3]

Question 1

A palindrome is a word that may be read the same way in either direction. Accept a sentence in UPPER CASE which is terminated by either “.”, “?”, or “!”. Each word of the sentence is separated by a single blank space.
Perform the following taks:
(a) display the count of palindromic words in the sentence.
(b) Display the palindromic words in the sentence.

Example of palindromic words:
MADAM, ARORA, NOON
Test your program with the sample data and some random data:

Example 1
INPUT : MOM AND DAD ARE COMING AT NOON
OUTPUT : MOM DAD NOON
NUMBER OF PALINDROMIC WORDS : 3
Example 2
INPUT : HOW ARE YOU?
OUTPUT : NO PALINDROMIC WORDS

Question 2
Write a program to declare a square matrix A[][] of order (M X M) where ‘M’ is the number of rows and the number of columns such that M must be greater than 2 and less than 20. Allow the user to input integers into this matrix. Display appropriate error message for an invalid input. Perform the following tasks:
(a) Display the input matrix.
(b) Create a mirror image of the inputted matrix.
(c) Display the mirror image matrix.

Test your program for the following data and some random data:

Example 1
INPUT : M = 3

4 16 12
8 2 14
6 1 3
OUTPUT :

 ORIGINAL MATRIX

4 16 12
8 2 14
6 1 3

MIRROR IMAGE MATRIX

12 16 4
14 2 8
3 1 6
Example 2
INPUT : M = 22

OUTPUT : SIZE OUT OF RANGE

Question 3
A composite Magic number is a positive integer which is composite as well as a magic number. Composite number: A composite number is a number which has more than two factors. For example: 10 Factors are: 1,2,5,10 Magic number: A Magic number is a number in which the eventual sum of the digitd is equal to 1. For example: 28 = 2+8=10= 1+0=1 Accept two positive integers m and n, where m is less than n as user input. Display the number of composite magic integers that are in the range between m and n (both inclusive) and output them along with frequency, in the format specified below:

Example:
Input: m=10
n=100
OUTPUT:
The composite magic numbers are 10,28,46,55,64,82,91,100
Frequency of composite magic numbers: 8

Input: m=120
n=90
OUTPUT:
Invalid input

LEAVE A REPLY

Please enter your comment!
Please enter your name here