HOLIDAY ASSIGNMENT CLASS 11 COMPUTER SCIENCE 1. WAP

HOLIDAY ASSIGNMENT CLASS 11 COMPUTER SCIENCE 1. WAP to check whether a number is an Armstrong or not . ( A number is said to be an Armstrong if the sum of the cubes of the digits is equal to the original number) 3 3 3 for ex 153 = 1 +5 +3
2. WAP to check whether a number is a special number or not . ( A number is said to be special if the sum of the factorial of the digits is equal to the original number) for ex 145 = 1!+4!+5! 3.
WAP to check whether a number is an Automorphic number or not . ( A number is said to be an Automorphic number if it is present in the last digit(digits) of its square . for ex 25 4. A lucky number is a number whose digits when added continuously , till a single digit is obtained is equal to 1 . WAP to enter a no and check whether it is a lucky number or not . eg 4627 = 4+6+2+7 = 19 = 1 +9 = 10 = 1 + 0 = 1 .So 4627 is a lucky number . 5 . WAP to enter two numbers and display their HCF and LCM . 6 WAP to enter a number and find sum of the digits of the number . Display the number of digits in the odd position . 7 WAP to print all square numbers between a range of given numbers. Sample Input: 5 – 300 Sample Output 9,16,25,……………………………. 8 WAP to enter 2 numbers and check whether they are twin prime or not 9 WAP to arrange the digits of a number in descending order. 10 WAP to display all prime palindromes between two limits 11 WAP to enter a number and check whether it is a prime perfect number or not A number is said to be prime perfect if all its factors are prime including 1 and excluding the number itself . Also the sum of the factors along with 1 should be equal to the original number . eg :6 = 1+2+3 12 WAP to display all prime Fibonacci numbers between two limits 13 WAP to display all Pythagorean triplets from 10 to 1000 14 Write programs to print the following patterns 1. 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 2. 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 4 4 4 4 3 3 3 2 2 1 3. 1 3 3 3 5 5 5 5 5 7 7 7 7 7 7 7 5 5 5 5 5 3 3 3 1 4. 1 2 3 4 5 6 7 8 9 1 2 3 4 6 7 8 9 1 2 3 7 8 9 1 2 8 9 1 9 1 2 8 9 1 2 3 7 8 9 1 2 3 4 6 7 8 9 1 2 3 4 5 6 7 8 9 15 WAP to enter a date and calculate the day number of that date ( ie the no of days elapsed from the beginning of the year till that date . ) for ex: input date is 3‐4‐2014 Day number = 31 +28+31+4 =9 16 The pension rules of a certain country states that a man receives Rs 50/week if he is over 65 years of age and an extra Rs 20 if he over 70 years .A woman receives Rs 45 / week if she is over 60 years of age and extra Rs 25 if she is over 65 . WAP to enter whether a person is a male or female and the age of the person . Calculate the weekly pension of the person . 17 WAP to enter a word and arrange its letters in alphabetical order . 18 WAP to sum the series 1+3+6+10+15+……………………………..till n terms when n is entered by the user. 19 WAP to enter two angles in degree and minute. Add the two angles and print the result . 20 WAP to enter the birth date of a person . Check for the validity of the date entered. If the date entered is valid , then add n days to the birth date .Print the new date . Assume all the dates are in the current year . 21 A university has the following rules for a student to qualify for a degree with A as the main subject and B as the subsidiary subject .  He should get > = 55 in A and > = 45 in B  If he gets <= 55 in A , he should get >= 55 in B. However he should get at least 45 in A  If he gets < 45 in B and 56 or more in A he is allowed to reappear in an examination in B in order to qualify .  In all other cases he is declared to have failed . Write a program to input marks for A and B and print whether the student has passed , failed or is allowed to reappear in B 22 WAP to implement the following operations  Input any 3 digit no j such that the absolute value of the difference between the first and the last digit exceeds 1  Form a new no k by reversing the digits in j  Compute the absolute difference d between j and k  Form a new no m by reversing the digits d  Add m and d and check if the result = 1089 . If the result is not equal to 1089 print “ERROR IN IMPLEMENTING ABOVE OPERATIONS “ and stop , else print ‘” SUM EQUALS 1089 “ AND STOP .