You are on page 1of 2

COMPUTER SCIENCE PROGRAM FILE SUBMISSION 1

ACADEMIC SESSION 2020-21

Q1.Write a function based menu driven program to do the following:


1. To print the first n natural numbers
2. To print the sum of first n natural numbers
3. To print the first n even numbers
4. To print the sum of first n even numbers
5. To print the first n odd numbers
6. To print the product of first n odd numbers
7. To print the table of a number entered by the user
8. To print the table of a number till another number entered by the user
9. Exit

Q2. Write a function based menu driven program to do the following:


1. To check whether a number is a palindrome or not
2. To display the reverse of a number
3. To check whether a number is an Armstrong number or not
4. To check whether a number is a prime number or not
5. To check whether a number is a Niven number or not
6. To print the factorial of a number
7. To find and display the LCM and HCF of two numbers entered by the user
8. Exit

Q3. Write a function based menu driven program to do the following:


Accept a heterogenous list(containing both integers and strings) and display
1. To print the reverse of the list
2. To separate the integers and strings into different lists and display
3. To swap the adjacent integers in the list of integers
4. To perform swapcase on each element in the list of strings
5. To capitalize the first letter of each element in the list of strings
6. To print all the even numbers from the list and display their sum
7. To print all the odd numbers from the list and display their sum
8. To find the maximum and minimum values of both the lists
9. Exit

Q4. Write a function based menu driven program to do the following:


1. To perform linear search on a list of integers entered by the user
2. To perform Bubble Sort on a list of integers entered by the user
3. To perform Insertion Sort on a list of integers entered by the user
4. Exit

Q5. Develop a program such that the following options are executed :
a. to find mean of a list
b. to find median value of a list
c. to find mode of a list of values
d. to find average age of students in a class of 20 students(allow user to enter values)
e. exit
All functions to be defined in STATS file which is to be imported in OPTIONS file.

Q6. Develop a program such that the various slicing options with strings and all other
build in functions used with strings are shown properly using various functions which
should be defined in a file STRINGS and then this file is to be imported in MENU.py where
the actual menu is shown and worked upon.

Q7. Develop a program using def( ) such that various pattern options are defined in a file
PATTERN.py , which is to be imported in PRINTING.py for execution using a menu .Give
atleast 10 different patterns .

Q8. Develop a program using def( ) such that various functions available in math library
are designed and made use of under a different name .Do this for atleast 10 functions of
math library. All these to be defined in NEWMATHs file and the menu is to be made and
used in the file USEMATHS.py.

Q9. Develop a program such that the following options are executed :
a. to find a random number between 0 and 1
b. to find a random number between the two limits entered by the user
c. to find a random integral number between 0 and 100
d. to show use of shuffle of random
e. to show use of randrange( )
f. exit
All functions to be defined in RANDOMPYTHON file which is to be imported in
USERANDOM.PY

Q10. Write an interactive program to generate a random number between 1 to 10 and


then with each number generated , associate a question of computational thinking / cyber
safety / error handling / Boolean algebra . Now when a correct answer is given , marks
should be given to the user. If the answer is incorrect , marks should not be given and a
zero is to be assigned . Finally whenever the user wishes to quit (or must be forced to quit
after 10 questions have been answered) , the final result with a proper remark should be
shown .

Note:
 Comments are required in each program.
 Write the name of the developer and the date on which you are writing the
program as a comment in the beginning of the program.
 All the programs must ask if the user wishes to continue.
 Programs must have exception handling.

You might also like