Professional Documents
Culture Documents
27. W.A.P accept two numbers and find Max & Min out of 2.
28. W.A.P accept two numbers and find Max & Min out of 3.
29.W.A.P to check if the number is Odd or even.
30. W.A.P to accept N and Check if it is positive/negative or zero.
31. W.A.P to accept N and Check if it is 1 digited/ 2 digited/ 3 digited or greater.
32. W.A.P to accept N and Check if it is divisible by 5 and 7 or not.
33. W.A.P to accept N and Check if it is palindrome number or not (121, 343, etc).
34. W.A.P to accept N and Check if it is Armstrong number or not (153).
35. W.A.P to accept N number find the sum and check whether it greater than 1000 or not.
36. A function f is defined as follows:
f(x) = ax3 - bx2 + cx - d if x > k,
= 0 if x = k &
= -ax3 + bx2 - cx + d if x < k
Write a program that reads a, b, c, d, k and x and prints the value of f(x).
Percentage Grade
80 to 100 Honours
60 to 79 First Class
50 to 59 Second Class
40 to 49 Third Class
0 to 39 Fail
38. An electric power distribution company charges its domestic consumers as follows:
Write a program that read customer number & power consumed and prints the amount
to be paid by the customer. Note that output should be well formatted.
39. A manufacturing company classified its executives into four levels for the benefit of
certain perks. The levels and corresponding perks are shown below:
Perks
Levels
Conveyance Entertainment
Allowance Allowance
1 2000 600
2 700 400
3 400 200
4 150 100
An executive’s gross salary includes basic pay, house rent allowance at 25% of basic pay
and other perks. Income tax in withheld from the salary on a percentage basis as
follows:
Write a program that will read an executive’s job number, level number and basic pay
and then compute the net salary after withholding Income tax.
40. The commission a life-insurance saleswomen earns on insurance polices sold is as follows:
41. A library pays overtime to its staff as per the following schedule:
If the basic salary of a worker is less than Rs. 2,500/- per month, her overtime allowance
is Rs. 10/- per hour for the first 10 hours and Rs. 7.50 per hour for hours in excess of 10,
up to a maximum of Rs. 750/-per month. If the basic salary is in excess of Rs. 2,500/- per
month but less than 3,500/- per month, the overtime allowance is Rs. 15/- per hour for
the first 10 hours, and Rs. 10 per hour for hours in excess of 10, up to a maximum of Rs.
1250/- per month. If the basic salary is in excess of Rs. 3,500/- per month, the overtime
allowance is Rs. 20/- per hour for the first 10 hours and Rs. 15 per hour for hours in
excess of 10, up to a maximum of Rs. 1500/- per month.
Write a program to read a worker’s basic salary and overtime hours and to compute and print
the gross salary.
42. The offshore gas company bills its customers according to the following rate schedule :
Write a program that reads customer number, previous meter reading and new meter reading.
Then program should print the following information in appropriate format:
Customer number, Previous meter reading, New meter reading, Gas used, Total Bill.
43. Write a program that read a number between 1 to 7 (including both) and then print
corresponding day name from the week. For example,