Python :
Conditional Statement Test 5
Q1. Accept the following from the user and
calculate the percentage
of class attended:
a. Total number of
working days
b. Total number of
absent
If the percentage is less than 75, than student will not be able to
sit in exam.
Q2. Accept the marks from the user and display the
grade according to
the following criteria:
a. Below 25 - D
b. 25 to 45 - C
c. 45 to 50 - B
d. 50 to 60 – B+
e. 60 to 80 - A
f. Above 80 – A+
Q3. A company decided to give bonus to employee
according to following
criteria:
Year of Service Bonus
More than 10 years 10%
>=6 and <=10 8%
Less than 6 years 5%
Ask user for their salary and year of service and print the net bonus
amount.
Q4. Accept the marked price from the user and
calculate the Net amount as(Marked Price –
Discount) to pay according to following
criteria:
Marked Price |
Discount |
>10000 |
20% |
>7000 and
<=1000 |
15% |
<=7000 |
10% |
Q5. Write a program to accept percentage and
display the Category
according to the
following category :
Per |
Category |
< 40 |
Failed |
>=40 &
<55 |
Fair |
>=55 &
<65 |
Good |
>=65 |
Excellent |
Q6. Accept three sides of a triangle and check
whether it is an equilateral, isosceles or
scalene triangle.
Note :
An equilateral triangle is a triangle in which all three sides are
equal.
A scalene triangle is a triangle that has three unequal sides.
An isosceles triangle is a triangle with (at least) two equal sides.
Q7. Write a program to accept two numbers and
mathematical operators and perform operation
accordingly.
Like:
Enter First Number: 7
Enter Second Number : 9
Enter operator : +
Your Answer is : 16
Q8. Accept the age, sex (‘M’, ‘F’), number of days
and display the
wages accordingly
Age |
Sex |
Wage/day |
>=18 and <30 |
M |
700 |
F |
750 |
|
>=30 and <=40 |
M |
800 |
F |
850 |
If age does not fall in any range then display the following message:
“Enter appropriate age”
No comments:
Post a Comment