CP Assignment
CP Assignment
13. Calculate the income tax payable by a person by entering the total taxable income as per the
below slabs:
Taxable Income range (in RS) Tax%
0 – 3,00000 0
3,00001 – 7,00000 5
7,00001- 10,00000 10
10,00001- 12,00000 15
12,00001 – 15,00000 20
Greater than 15,00000 30
14. Calculate the age of a person, given date of birth (DOB) and current date (CD). A date is
represented as three integers (say dd, mm, and yyyy). The result to be printed as YY years, MM
months, DD days. Consider a month consist of 30 days.
Example: Input DOB: 29/10/1980, CD: 27/8/2011
Output: Age: 30 years 9 Months and 28 days
15. Enter the total purchase amount for a customer and calculate the amount payable by the customer
after discount, if a shopping mall announced the following discounts on total purchase amount:
Purchase amount (RS) Discount
< 1000 -
1000-3000 5%
3001-6000 7%
6001-10000 10%
Above 10000 Rs 2000
16. Enter the previous month and current month meter reading. Calculate the electric bill amount for
any customer as per the following rules:
First 100 units : Rs 3.20 per unit.
Next 200 units : Rs 5.40 per unit.
Remaining units : Rs 6 per unit
17. Given a number between 1 to 7, print the day name (Monday- Sunday) using switch-case
statement.
18. Given a number 0-9, print the corresponding English word for the number using switch-case
statement.
19. Check whether an entered character is a vowel or not using switch-case statement.
20. Create a menu-driven program using switch–case statement that will ask the user to enter two
numbers and an operator (+, -, *, /). When the user enters a valid choice, the program prints the
result of the respective operation as per the entered choice, otherwise prints an error message.
Loops: