Sie sind auf Seite 1von 3

LITTLE STAR HIGH SCHOOL

Selection Test: 2018-2019


FM: 30 Time: 3 Hours
Class: XII Sub: Computer Science (Practical)
The Total Time to be spent on the Planning Session and the Examination Session is three
hours.
Planning Session: 90 minutes
Examination Session: 90 minutes
Note: Candidates are to be permitted to proceed to the Examination Session only after 90
minutes of the Planning Session are over.

This paper consists of three problems from which candidates are required to attempt any
one problem.

Candidates are 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 should be
logically and syntactically correct. [5]
3. Document the program using mnemonic names / comments, identifying and clearly describe
the choice of datatypes and meaning of variables. [2]
4. Code / Type the program on the computer and get a printout (hard copy). Typically, this
should be a program that compiles and run correctly. [2]
5. Test run the program on the computer using the given sample data and get a print out of the
output in the format specified in the problem. [5]
6. Viva-Voce on the Selected problem. [3]

In addition to the above, the practical file of the candidate containing the practical work
related to programming assignments done during the year is to be evaluated as follows:-

Programming assignments done throughout the year. [10]

Solve any one of the following Problems


Question 1

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 that 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 digits 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 the frequency, in the format specified below.
Test your program with the sample data and some random data:

Page 1 of 3
Example 1:

INPUT:
m = 10
n = 100
OUTPUT:
THE COMPOSITE MAGIC INTEGERS ARE:
10, 28, 46, 55, 64, 82, 91, 100
FREQUENCY OF COMPOSITE MAGIC INTEGERS IS: 8

Example 2:

INPUT:
m = 1200
n = 1300
OUTPUT:
THE COMPOSITE MAGIC INTEGERS ARE:
1207, 1216, 1225, 1234, 1243, 1252, 1261, 1270, 1288
FREQUENCY OF COMPOSITE MAGIC INTEGERS IS: 9

Example 3:

INPUT:
m = 120
n = 99
OUTPUT:
INVALID INPUT

Question 2

Write a program to accept a sentence which may be terminated by either ’.’, ‘?’ or ’!’ only. The words
may be separated by more than one blank space and are in UPPER CASE.
Perform the following tasks:
(a) Find the number of words beginning and ending with a vowel.
(b) Place the words which begin and end with a vowel at the beginning, followed by the remaining
words as they occur in the sentence.

Test your program with the sample data and some random data:
Example 1

INPUT: ANAMIKA AND SUSAN ARE NEVER GOING TO QUARREL ANYMORE.


OUTPUT: NUMBER OF WORDS BEGINNING AND ENDING WITH A VOWEL= 3
ANAMIKA ARE ANYMORE AND SUSAN NEVER GOING TO QUARREL

Example 2

INPUT: YOU MUST AIM TO BE A BETTER PERSON TOMORROW THAN YOU ARE TODAY.
OUTPUT: NUMBER OF WORDS BEGINNING AND ENDING WITH A VOWEL= 2
A ARE YOU MUST AIM TO BE BETTER PERSON TOMORROW THAN YOU TODAY

Example 3

INPUT: LOOK BEFORE YOU LEAP.

Page 2 of 3
OUTPUT: NUMBER OF WORDS BEGINNING AND ENDING WITH A VOWEL= 0
LOOK BEFORE YOU LEAP

Example 4

INPUT: HOW ARE YOU@


OUTPUT: INVALID INPUT

Question 3

Write a program to input a natural number less than 1000 and display it in words.

Test your program for the given sample data and some random data.

Sample Data:

Input: 29
Output: TWENTY NINE

Input: 17001
Output: OUT OF RANGE

Input: 119
Output: ONE HUNDRED AND NINETEEN

Input: 500
Output: FIVE HUNDRED

_______________________________________ X _________________________________________

Page 3 of 3

Das könnte Ihnen auch gefallen