Programming Sheet1
Programming Sheet1
2)The Water Department has decided the rate policy based on water consumption as follows:
6;Write a menu driven program to accept a number and check and display whether it is
1:A prime number(A number divisible by 1 and itself and not by any other number)
2:Automorphic number(A number which contain number in the last digit of its square)
7)Write a program to generate a triangle or an inverted triangle till n term based upon their user choice
Of triangle to be displayed input 1 for a triangle 2 for the inverted triangle
8:Write a menu driven class to accept a number from user and check whether it is palindrome or perfect number.
1:Palindrome number(A number is a palindrome number when which is read in reverse order is same as
The right order)
2:perfect number(A number is called perfect number if it is equal to the sum of its factors other than the number
itself)6=1+2+3
9:Using switch statement,write a menu driven program for the following
I) I
IC
ICS
ICSE
II)ICSE
ICS
IC
I
10:An electronic shop has announced the following seasonal discounts on the purchase of certain items
Purchase amount Discount on laptop Discount on pC
0-25000 0.0% 5.0%
25001-57000 5.0% 7.5%
57001-100000 7.5% 10.0%
More than 100000 10.0% 15.0%
Write a program based on the above criteria to input name ,address amount of purchase and the type of purchase(
L for laptop and D for desktop) by a customer. Compute and print the net amount to be paid by a customer along
with his name and address.
Hint discount=(discount/100)*purchase amount
Net amount=amount of purchase-discount.