COMPUTER APPLICATIONS Practical Class Xii
COMPUTER APPLICATIONS Practical Class Xii
COMPUTER APPLICATIONS Practical Class Xii
This paper consists of three problems from which candidates are required to attempt any
one problem.
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:-
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
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
Page 2 of 3
OUTPUT: NUMBER OF WORDS BEGINNING AND ENDING WITH A VOWEL= 0
LOOK BEFORE YOU LEAP
Example 4
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