Professional Documents
Culture Documents
Fall 2021-2022
Muhammad Farrukh
Lab Guidelines
1. You are allowed to perform/submit the lab only during the lab timings
2. Make sure you do not leave the lab without submitting your work on LMS
3. Copying/sharing code is strictly prohibited. Using any unfair means will lead to immediate
disqualification
4. Put all cpp files into a folder YourRollNo_Lab4_TAname and submit it on LMS
(Assignments>Lab4)
5. Lab ends at 8:50 pm and the submission tab closes at the same time
Task1 Total
20
Task2 Total
30
Task3 Total
30
Write a program that asks the age of a person and categorizes him/her according to the
following:
Children: Less than 13
Teens: Less than 20 and more than 12
Adults: Less than 51 more than 19
Seniors: More than 50
Sample Output:
__________________________________________________________________
Write a program that asks the user to enter lengths of the three sides of a triangle in
any order and then prints Pythagorean if the three sides form a right triangle and print
Not Pythagorean otherwise. For the sake of simplicity, assume that the user will enter
integer lengths.
Restrictions:
You are not allowed to use logical operators(&&, ||)
Sample Output:
_____________________________________________________________
Write a program that asks the user to input the total number of electricity units
consumed and calculates the total electricity bill according to the given conditions:
For the first 50 units Rs. 0.50/unit
For the next 100 units Rs. 0.75/unit
For the next 100 units Rs. 1.20/unit
For units above 250 Rs. 1.50/unit
Also, an additional surcharge of 20% will be added if the total amount is greater than
Rs.500/-.
Sample Output: