Professional Documents
Culture Documents
Decision Construct Prgs
Decision Construct Prgs
1) Write a program to accept the number of days the bike is taken on rent,
based on the table given below.
DAYS AMOUNT per day
1- 4 40
5 – 12 55
>=13 65
Rent = Number of Days * Amount per day
2) Write a program to accept the price of the electronic item and calculates the
discount, along with the total amount payable, on the price, based on the table
given below.
PRICE DISCOUNT
< = 10000 15%
10001 – 25000 25%
> = 25001 35%
Discount = Price * Discount %
Total Amount = Price – Discount
4) Write a program which calculates the plane fares of an Employee with the following.
Class Name : EmpDet
Accept the values for the above variables and calculate fare according the table given below.
Salary Fare
sal >= 10000 and <=20000 3500 + 2% of Salary.
sal > 20000 and <=35000 4000 + 2.5% of Salary
sal > 35000 and <=45000 5000 + 4% of Salary.
5) Write a program to calculate the formulae based on the following expressions.
4x + y if x > 0
4x + y if x < 0 , where x and y are accepted from user.
6) Write a program to accept a number and check if is an Even positive or Even negative or
Odd positive or Odd negative number.
Ex : Sample Input : 4 - Even Positive Numbee
-6 – Even Negative Number
-27 - Odd Negative Number
100 - Even Positve number
7) Write program to accept a number and check if it is a Buzz number or not.
A Buzz number is a number which is divisible by 7 OR the last digit of the number is 7
Example : 17 is a Buzz Number (Last digit of the number is 7)
21 is a Buzz Number (It is divisible by 7)
8) Write a program to accept the year and check if it forms a Leap Year
A year is said to be a leap year if it DIVISIBLE BY 4 AND IS NOT DIVISIBLE BY
100 OR IS DIVISIBLE BY 400.
9) Write a program to find the roots of a Quadratic Equation
10) Write a program to calculate Simple Interest according to table given below.