Professional Documents
Culture Documents
1. Write a program to accept the name and the basic pay of an employee and print the neat salary
slip for the employee. [ DA = 20% of BP, HRA = 30% of BP, TA = 10% of BP, PF = 13% of
BP, IT = 5% of BP, Gross =BP+TA+DA+HRA , Deduction = PF+IT,
Net pay = Gross – Deduction]
SALARY SLIP
NAME: xxxxxxxxx
-----------------------------------------------------------------------------------------------------------
BASIC PAY : PF:
D.A : I.T:
H.R.A :
T.A :
Gross : Deduction:
NET PAY :
-----------------------------------------------------------------------------------------------------------
3. Write a program to accept the consumer name, EB number, number of units and type of
consumption [ D – Domestic , C – commercial ] Calculate the amount to be paid based on the
following criteria.
For Domestic purpose
a. for the first 100 units - No charges
b. for units 101- 200, Rs.7 per unit
c. for units 201-300, Rs. 9.50 per unit
d. for units 301 and above Rs. 12 per unit.
For Commercial purpose
a. for the first 100 ,Rs. 10 per unit
b. for units 101- 200, Rs. 25 per unit
c. for units 201-300, Rs. 40 per unit
d. for units 301 and above Rs. 55 per unit.
Print the EB bill in the given format
ELECTRICITY BILL
CONSUMER NAME :
EB NUMBER :
TYPE OF CONSUMPTION :
NUMBER OF UNITS :
TOTAL AMOUNT :
4. Write a menu driven program to find the area of circle, rectangle, square and triangle.
5. Write a program to accept a number and reverse the number and also count the number of odd
digits and even digits of the number using while loop.
6. Accept a choice and find the sum of the following series.
1. X - X ² / 2 ! + X ³ / 3 ! - ….± X N / N !
2. 1+(1+2)+(1+2+3)+(1+2+3+4)+……….(1+2+….+N)
8. Accept a line of strings and print Number of Uppercase characters, lowercase characters,
spaces, digits and special characters.
10. Write a program to accept a word (length of the word should be at least 3) and add ‘ing’ at
the end of the given word. If the given string already ends with ‘ing’ then add ‘ly’ instead. If
the length of the given string is less than 3, leave it unchanged.
Eg: Input string: Land output: Landing
Input string: Smiling output: Smilingly
Input string: CV output: CV
11. Write a program that reads a line of strings and print all the palindrome words from the line.
Eg. S=’Ajay has a RacecAr. He is a level 1 racer.’
output :
Palindrome words: RacecAr level
12. Write a program to input a string S1. Input two substrings S2 and S3 existing in S1 and a
replacement string S4. Replace the range of strings starting from S2 till end of S3 with S4.
Eg: Given string S1= ‘Where there is a will there is a way’
Substring S2= ‘there’
Substring S3 = ‘is’
Substring S4 = ‘exists’
Output:Where exists a will there is a way
13. Write a program that takes a string with multiple words and then capitalizes the first letter
of each word and reverses all three letter words.
Eg:Given String = ‘I have a car in red colour’
New string = ‘I Have A raC In deRColour’
14. Write a program that reads a line and prints the longest word and its length and also print the
same without vowels.
Eg: Given String = ‘Python offers many methods for string manipulation’
Output 1 = Longest word: manipulation Its Length: 12
Output 2 = Longest word without vowels :mnpltn
15. Write a program to read N phone numbers with 10 digits and 2 dashes. Print all the valid
phone numbers, if they are in the format 017-555-1212
Eg: Given phone numbers
044-225-2461
12-234-1235
044-223-1234
Output:
Valid phone numbers
044-225-2461
044-223-1234