NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Class: XI Practical Questions 2017-18
Computer Science

1. The arithmetic mean of two numbers is the result of dividing their sum by two. The geometric mean of two numbers is the square root of their product. The harmonic mean of two numbers is the arithmetic mean of their reciprocals. Accept two numbers and display these three means.

2. An angle is measured in degrees and minutes. E.g. 70 degrees and 35 minutes and 50 degrees and 40 minutes, then
Sum = 70 degrees and 35 minutes + 50 degrees and 40 minutes
= 121 degrees and 15 minutes because 1 degree = 60 minutes
Accept the degree and minutes of 3 angles and find their sum. If sum is equal to 180 degrees display "Can form a triangle" otherwise display "Cannot form a triangle"

3. A book – seller sells books at the following rates.
Rs 15 per book if the order is for 20 books or less
Rs 14.50 per book if the order is between 21 and 59 books
Rs 14 per book if the order is for 60 books or above
If the customer is dealing with the book-seller for 10 years or more, then a discount of 10% is given on the total amount. Accept the details and calculate the final amount to be paid by the customer.

4. Accept a number from the user and display it with ‘st’ or ‘nd’ or ‘rd’ or ‘th’. For example if 321 is entered, then display 321st, if 43 is entered, then display 43rd and so on. (Use switch-case)

5. The volume and surface area of a hollow cylinder of height H bounded by external radius R & internal radius r is given by the formula V =  H(R2 – r2) and A = 2* (H(R + r) + (R2 – r2)). Accept both the radii and display the volume and area.

6. The production (P) of crude oil of a country in millions of barrels may be estimated by the following set of equations, where t represents the time in years.
P = 5+ 3t if t>0 and <= 3

if t >3
Display the value of P where t ranges from 1 to 10

7. In sinking a well the rate of drilling is 20 meters per hour for the first hour. For each subsequent hour depth sunk is 8% less than the previous hour. Calculate the depth reached after 10 hours.

8. The telegram charges are
Upto 5 words Rs. 2. 50
Each extra word Rs 0. 50
upto 20 words
Each word afterwards Rs. 1
Accept the no: of words and display the bill amount.

9. U.P. State Electricity Board charges its consumers according to the following table:
Units consumed Call charges
0 to 200 No charge
201 to 300 Rs. 1.80/call
301 to 450 Rs. 2.50/call
Above 450 Rs. 3.00/call
The following points have to be kept in mind while calculating the bill:
(i) Monthly rental is Rs.100. (ii) Free calls are up to 200 units consumed.
Accept units consumed by 10 people and display their individual electricity bill amount and also total bill amount collected

10. Accept a number as a parameter and then find the sum of the cubes of all natural numbers till that number

11. Evaluate and display the sum of the following series.
1 – 2 + 3 – 4 + 5 – 6 + 7 ………… –100

12. Evaluate and display the sum of the following series.
2 – 4 + 6 – 8 + 10 ……………. + 100

13. Evaluate and display the sum of the following series.

14. Evaluate and display the sum of the following series.



15. Evaluate and display the sum of the following series.



16. Accept values of n and evaluate.




17. Accept values of n and x. Evaluate




18. The following numbers are called Mersenne Numbers: 1 3 7 15 31 63. . . . . . . . (Hint: 1 = 21 – 1, 3 = 22 – 1, 7 = 23 – 1, 15 = 24 – 1 etc.)
Generate the Mersenne Numbers between 1 and N.

19. Perfect number
A number which is equal to the sum of all its factors other than itself. For e.g.:
6 = 1+2+3
28 = 1+2+4+7+14

20. Prime number
A number which has only 2 factors 1 and itself. For e.g.: 7, 11, 37

21. Palindrome number
A number when reversed results in the same number. For e.g.: 121, 7887, 90209

22. Armstrong number
A number which is equal to the sum of the cube of its digits. For e.g.:
153 = 1³ + 5³ + 3³

23. Ascending power number
An Ascending Power number is equal to the sum of its digits to ascending powers. For e.g.:
135 = 11 + 32 + 53 518 = 51 + 12 + 83 598 = 51 + 92 + 83
1306 = 11 + 32 + 03 + 64 2646798 = 21 + 62 +43 + 64 + 75 + 96 + 87

24. Automorphic number
An automorphic number's square "ends" in the same digits as number itself. For example,
52 = 25 762 = 5776 6252 = 390625

25. Buzz number
A buzz number has either 7 as one of its digits or is divisible by 7. For e.g.: 17 21 9078

26. Duck number
A duck number has at least one 0 (zero) in its digits. For example, 105 400 65034

27. Increasing / Decreasing / Bouncy number
Working from left-to-right if no digit is exceeded by the digit to its left, it is called an increasing number; for example, 134468.
Similarly if no digit is exceeded by the digit to its right, it is called a decreasing number; for example, 66420.
We shall call a positive integer that is neither increasing nor decreasing a bouncy number; for example, 155349.

28. Neon number
A neon number is equal to the sum of the digits of its square. For e.g.: 92 = 81 8+1=9

29. Special number
A Special number is equal to the sum of the factorial of its digits. For e.g.:
1! + 4! + 5! = 1 + 24 + 120 = 145, so 145 is a Special number

30. Narcissitic number
A narcissistic number is equal to sum of its digits to the power of number of digits it has. For e.g.
153 = 1³ + 5³ + 3³ 8208 = 84 + 24 + 04 + 84
1741725 = 17 + 77 + 47 + 17 + 77+ 27 + 57
31. Kaprekar number
A positive whole number ‘n’ that has ‘d’ number of digits is squared and split into two pieces, a right-hand piece that has d digits and a left-hand piece that has remaining d or d–1 digits. If the sum of the two pieces is equal to the number, then n is a Karprekar number. For e.g.:
92 = 81, right-hand piece is 1 and left-hand piece is 8
Sum = 1 + 8 = 9, which is equal to the number

452 = 2025, right-hand piece is 25 and left-hand piece is 20
Sum = 25 + 20 = 45, which is equal to the number

2972 = 88209, right-hand piece is 209 and left-hand piece is 88
Sum = 209 + 88 = 297, which is equal to the number

32. Magic number
A number whose digits are summed up until the sum is a single digit, is equal to 1.For e.g.:
298 2+9+8 = 19 1+9 = 10 1+0 = 1
4888 4+8+8+8 = 28 2+8 = 10 1+0 = 1
10027 1+0+0+2+7 = 10 1+0 = 1

33. Pandigital number
A pandigital number has all the digits from 1 to n, where n is the no: of digits it has. For e.g.
25143 or 35412 or 51234 has 5 digits and has all digits from 1 to 5
213 or 312 or 123 has 3 digits and has all digits from 1 to 3

34. Ramjee / Happy number
A Ramjee number's eventual sum of the square of its digits is 1. For e.g.:
139 12+32+92= 1+9+81 = 91
92+12 = 81+1 = 82
82+22 = 64+4 =68
62+82 = 36+64 = 100
12+02+02 =1

35. Smith number
A number whose sum of digits is equal to the sum of all the digits of its prime factors. For e.g.: Example:
N = 666 Sum of all its digits = 18
Prime factors = 2, 3, 3, 37 Sum of digits of prime factors (2+3+3+3+7) = 18
N = 265 Sum of all its digits = 13
Prime factors = 5, 53 Sum of digits of prime factors (5+5+3) = 13

36. Twisted primenumber
A prime number whose digits when reversed is also a prime number is called a twisted prime
For e.g.: N: 167 reverse: 761 both are prime numbers, so 167 is a twisted prime

37. Amicable pair numbers
A pair of numbers M and N, where sum of all factors of M (other than itself) is equal to N and vice versa. For e.g.:220, 284
Factors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110 which sum up to 284
Factors of 284 are 1, 2, 4, 71, 142 which sum up to 220

38. Unique digit number
A numberin which digits are not repeated in it. For e.g.:
123 891 3901 17820

39. You’ve lost all ability to do normal math. You are unable to do even simple addition, as you always forget to 'carry'. Fortunately, your programming skills are unimpaired, and you decide to make the most of this new style of false addition by writing a program to do it for you.
For example in normal addition, 23 + 49 = 72, in false addition, any numbers that would be carried are simply dropped. So 23 + 49 = 62
Input: 499 861
Output: 250
Input: 19494 49494
Output: 58888

40. Any number greater than 2 can be represented as sum of consecutive natural numbers which add up to the number. For e.g. 27can be represented as
2 + 3 + 4 + 5 + 6 + 7
8 + 9 + 10
13 + 14
Where every row represents combination of consecutive natural numbers which add up to 27. Accept a number N and display all combinations that satisfy the above condition. For e.g.:

N = 9
Output 2 3 4
4 5

N = 21
Output 1 2 3 4 5 6
6 7 8
10 11



























41. Accept a sentence and display no: of words in it which start with capital vowel. Also change all the 3 letter words in it to ***. Display the resultant string.
Input : The dog is now Awake
Output *** *** is *** Awake
No: of words is: 1

42. Accept a sentence and a word and display no: of times the word exists in the sentence. Also display the longest and the shortest word of the sentence.

43. Accept a string from the user and display the number of times consecutive alphabets come together in the statement. E.g. In "TAB" A & B are coming together. In "DETOURS" there are 2 occurrences, 'DE' and 'RS'. (Assume that the string is in uppercase).

44. An encryption system is used to hide a message. The value of shift can be 1 to 26. For example if the shift value is 1 then A=B, B=C, Z=A etc. If its 20 then A=U, B=V, C=W as shown below:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

U V W X Y Z A B C D E F G H I J K L M N O P Q R S T


Write a program that takes the coded text, the shift value and prints the decoded original text. Test your program for the following sample data:

Coded Text: UHINBYLQCHHYL
Shift : 6
Decoded Text: ANOTHER WINNER
Coded Text : ADRS NE KTBJ
Shift : 1
Decoded Text : BEST OF LUCK
*******

     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.