Important Notice:

Course Content
Conditional Statements/Selection Statement
0/3
Conditional and Iterative Statements Lab Assignment
About Lesson

if-else statement Assignment


Question 1:- wap to check the entered number is even or odd.


Question 2:- wap to check the entered number is positive or negative.


Question 3:-wap to enter any age and check entered age is eligible for voting or not.


Question 4:-wap to enter any age and check entered age is eligible for driving a car or not.


Question 5:-wap to check whether a number is divisible by 5 or not.


Question 6:- wap to check divisibility of a number.


Question 7:- wap to display menu to calculate addition or subtraction.


Question 8:- wap to display menu to calculate area of square or rectangle.


Question 9:- wap to calculate total price after the discount. If rate greater than is 15000 then discount is 12% of rate.


Question 10:- wap to find greatest number of three number using if else and (&&) operator.


Question 11:- A company decided to give bonus to all its employee on holy. 8% bonus on salary is given to the male and 15% bonus on salary to the female worker. Wap to enter salary and gender of the employee if the salary of the employee is less than 10000 the employee gets an extra 5% bonus on salary. Calculate the bonus that has to be given to the employee and display the salary that the employee will get.


Question 12:- wap to calculate electricity bill (accept number of unit from user) a/c to following criteria.

          Unit                                         Price

          First 100 unit                           no charge

          Next100 unit                            Rs 5 per unit

          After 200 unit                          Rs 10 per unit


Question 13:- wap to check whether the last digit of a number (enter by user) is divisible by 5 or not.


Question 14:- wap to accept percentage from the user and display the grade according to following criteria.

          Marks                                     Grade

          >90                                          A

          >80 and <=90                          B

          >=60 and <=80                        C

          Below 60                                 D


Question 15:- wap to accept the cost price of a bike and display the road tax to be paid a/c to following criteria.

          Cost price (in Rs)                             Tax

          >100000                                           15%

          >50000 and <=100000                      10%

          <=50000                                           5%


   Question 16:- wap to check whether an year is leap year or not


Question 17:- wap to check whether a given number is a three digit number or not


 

error: Content is protected !!