Assignment: Class XI Computer Science Functions
Assignment: Class XI Computer Science Functions
Class XI
Computer Science
Functions
1. Write a program to calculate the sum of the following series
X+ X2/2! + X3/3!....Xn/n!
To Calculate the above series write at least 3 functions
(a) Function to calculate Factorial of a number
(b) Function to Calculate Power of a number
(c) Function to find Sum of the series
2. Write a program to calculate the sum of the following series
X+ X2/3! + X3/5!....Xn/(2n-1)!
To Calculate the above series write at least 3 functions
(a) Function to calculate Factorial of a number
(b) Function to Calculate Power of a number
Function to find Sum of the series
3. Write a program to calculate the sum of the following series
X- X2/3! + X3/5!-X4/7!....Xn/(2n-1)!
To Calculate the above series write at least 3 functions
(a) Function to calculate Factorial of a number
(b) Function to Calculate Power of a number
Function to find Sum of the series
4. Write a function to calculate Log of a number passed as function argument.
Note:-Do not use system defined functions for calculation
5. Write a Function to calculate the HCF of two numbers using long division
method.
6. Write a function to Calculate LCM of two numbers without calculating HCF.
7. Write a function in Python which takes a decimal number as input and
calculates the ROMAN equivalent of that number
8. Write a function in Python which takes one decimal number as input and
calculates the binary equivalent of that number
Note:- Do not use system defined functions for calculation
9. Write a function in Python which takes a decimal number as argument and
calculates the Hexadecimal equivalent of that number
Note:- Do not use system defined functions for calculation
10. Write function in Python which takes one integer as function argument and
checks whether the number is HAPPY number or not Definition: A happy
number is a number defined by the following process: Starting with any
positive integer, replace the number by the sum of the squares of its digits,
and repeat the process until the number equals 1 (where it will stay), or it
loops endlessly in a cycle which does not include 1. Example:- 1, 7, 10, 13,
19, 23, 28, 31, 32, 44, 49, 68, 70, 79, 82, 86, 91, 94, 97, 100, Take 97= 92 +
72 =130 = 12 + 32 + 02 = 10 = 12 + 02 = 1 so 97 is a happy number
11. Write a function in python which takes one integer as function argument and
checks whether the number is Armstrong number or not.
Definition: A circular prime is a prime number with the property that the
number generated at each intermediate step when cyclically permuting its
(base 10) digits will be prime. For example, 1193 is a circular prime, since
1931, 9311 and 3119 all are also prime. The first few circular primes are 2, 3,
5, 7, 11, 13, 17, 31, 37, 71, 73, 79, 97, 113, 131, 197,
14. Write a function to check whether the number taken as function argument is
Adams Number or not.