Project 19 20 cOsiTUcr0I
Project 19 20 cOsiTUcr0I
Project 19 20 cOsiTUcr0I
5. Given below is a hypothetical table showing rates of income tax for male citizens below the age of 65 yrs:
Does not exceed Rs. 1,60,000 - nil
Is > Rs. 1,60,000 & <=Rs. 5,00,000 – (TI- 1,60,000)*10%
Is >Rs.5,00,000 & <=Rs. 8,00,000 - [(TI-5,00,000)*20%]+34,000
Is >Rs. 8,00,000 – [(TI-8,00,000)*30%]+94,000
Write a program to input the age, gender (male or female) and taxable income(TI) of a person.
If the age is more than 65 yrs or the gender is female, display “wrong category”.
If the age is less than or equal to 65 yrs and the gender is male, compute and display the income tax payable
as per the table given above.
11. WAP to accept the String and print all capital letters followed by small letter and followed by digits.
If Input : MuMbAi-53
Output : MMAubi53
12. Write a program to accept a string from user and create a new word formed out of the first letter of each
word and convert the new word into Uppercase.
Example: Input : Mangoes are delivered after Midday
Output : MADAM
18. Write a menu driven program to do following task as per user choice:
1. Check for Amicable number (Note: Amicable number are pair of numbers such that one is the sum of
proper factors of the other. For example : 220 and 284 , since
sum of factors of 220 = 1+2+4+5+10+11+20+22+44+55+110=284
sum of factors of 284=1+2+7+71+142=220)
2. Check for Twisted Prime number (Note: A prime number is said to be ‘Twisted Prime’, if the new number
obtained after reversing the digits is also a prime number. Example: 167)
19. Write a program to accept the number. Display the accepted number after removing all zeros (0) from the
number. Example: Input 40809 Output 489
20. An emirp number is a number which is prime backwards and forwards.
Example: 13 and 31 are both prime numbers. Thus, 13 is an emirp number. Design a class Emirp to check
if a given number is Emirp number or not.
21. Write menu driven program to print the following patterns using iteration(loop) statements :
1. 2.
22. Write a program to accept a number. Count and print the frequency of each digit present in that number.
The output should be given as:
Sample Input: 44514621
Sample Output: =====================
Digit Frequency
=====================
1 2
2 1
4 3
5 1
6 1
23. Using switch write a menu driven program for the following task:
1. Automorphic number: An automorphic number is the number which is contained in the last digit(s)
of its square. Example: 25 is an automorphic number as its square is 625 and 25 is present as the last
two digits.
2. To find the smallest digit of an integer that is that.
Sample input: 6524
Sample output: Smallest digit is 2
For an incorrect an appropriate error message should be displayed.
24. Write a program to accept the names of 10 countries in a single dimension string array and their famous
place in another single dimension array. Search for a name of a country input by the user in the list. If
found, display “search successful” and print the name of the country along with famous place, or else
display the message” search unsuccessful, no such country in the list”.
25. Write a program to accept the year of graduation from school as an integer value from the user. Using the
Binary Search technique on the sorted array of integers given below, output the message “Record exists”
if the value input is located in the array. If not, output the message “Record does not exist”.
{1982, 1987, 1993, 1996, 1999, 2003, 2006, 2007, 2009, 2010}
26. Define a class and accept 10 students’ names in a single dimensional array. Sort these names in
alphabetical order using the Bubble Sort technique only.
27. Write a program to accept 35 integers from the keyboard. Perform selection sort on the integers and then
print them in descending order.
*************************