Page 453 - Computer Science Class 11 With Functions
P. 453

Unsolved


              1.   Write a program to accept temperature in Fahrenheit and print the temperature in Celsius. Note: Formula for
                 conversion
                 C = (F - 32) * 5 / 9
              2.   Write a program  to accept marks in three subjects and display the percentage of marks. Assume the maximum
                 marks in each subject is 40.
              3.  Write a program to accept a number and print its square and cube.

              4.   Write  a  program  that  accepts  the  radius,  r,  height,  h  and  slant  height,  sh  of  a  cone,  and  calculates  its
                 volume and surface area. Save the file as cone.py. Also, execute the program and write the output in the
                 space provided.
                 The volume of a cone = (1 / 3) πr h cubic units
                                              2
                 Surface area = π * r (r + L)
              5.  Write a program to display the area and perimeter of a rectangle. Use user-defined functions for each.
              6.   Write a function txtDigit() that accepts a numeric digit as an argument and returns the digit in words.
                 Thereafter invoke the function and display the output.

                 For example, for the input 5, it should display: five
              7.   Write a program that reads a character as a user input, checks whether it is an alphabet, digit or a special character,
                 and displays output such as the following:
                 & is a special character.
                 7 is a digit.
              8.   Write a program to develop a calculator. It accepts two numbers and a character operator (+, -, *, /) and displays the
                 sum, difference, product, quotient, and remainder, respectively. An appropriate message should be displayed if any
                 other character operator is passed as an operator. (Note: Make separate user defined functions for each operator)
              9.  Write a program to accept a number and compute its factorial.

             10.  Write a program to print the factors of a given number.
             11.  Develop a user defined functions that takes a number as an argument and returns its reverse.
             12.  Write programs in Python to print the following patterns:

                                                         Python Patterns

























             13.   Write a function that accepts two strings as arguments and checks whether the second string is a substring


                                                                                                      Practical  451
   448   449   450   451   452   453   454   455   456   457   458