PROGRAMMING PROBLEMS
1. Calculate Area of a Rectangle
Formula: Area = length × width
2. Calculate Area of a Triangle
Formula: Area = (base × height) ÷ 2
3. Calculate Surface Area of a Cylinder
Formula: Surface Area = 2 × π × radius × (radius + height)
4. Check if a Number is Even or Odd (%-modulos which computes for the remainder)
5. Check Voting Eligibility
6. Check if a Year is a Leap Year
7. BMI Classification
Problem: Compute BMI and give a health category.
Condition:
if bmi < 18.5: Underweight
elif bmi < 24.9: Normal
elif bmi < 29.9: Overweight
else: Obese
8. Phonetic Alphabet Converter
9. Grade Classification
If (grade >=75) passado else bagsak
Input your grade: 75
The passed!
Input your grade: 74
The fail!
10. Determine the Largest of three Numbers
Input: 3 numbers
Input first number: 45
Input second number: 23
Input third number: 54
The largest number is: 54
11. Login System
Problem: Ask for username and password and check if correct.
Enter username: admin
Enter password: administrator
Username and Password Correct! Login Successful!
Enter username: admin
Enter password: Administrator
Username or Password is Incorrect! Login Failed!
12. Discount Calculator
Problem: Apply discount if purchase amount is above ₱1,000.
Enter total amount of purchase: 375
Amount to pay: 375
Enter total amount of purchase: 1200
Amount to pay: 1244
13. Calculator – Perform basic math operations.
Enter first number: 10
Enter second number: 15
Enter operation: +
The sum of the numbers is 25
Enter first number: 10
Enter second number: 15
Enter operation: *
The product of the numbers is 150
14. Unit Converter – Convert weights, lengths, currencies.
1kilo = 2.2 pounds, 1m = 39.27 meter, 1d = 55p
Choose which unit to convert
[1] Weight (kilogram to pounds)
[2] Length (meter to inches)
[3] Currency (dollar to peso)
Type in number of your choice: 1
Enter weight in kilogram: 100
Equivalent in pounds is 220
Choose which unit to convert
[1] Weight (kilogram to pounds)
[2] Length (meter to inches)
[3] Currency (dollar to peso)
Type in number of your choice: 2
Enter length in meter: 5
Equivalent in inches is 196.35
Choose which unit to convert
[1] Weight (kilogram to pounds)
[2] Length (meter to inches)
[3] Currency (dollar to peso)
Type in number of your choice: 3
Enter length in meter: 15
Equivalent in inches is 825
15. Grade Calculator – Input scores and calculate final grades.
Input grade in first quarter: 92
Input grade in second quarter: 89
Input grade in third quarter: 90
Input grade in fourth quarter: 91
Your final grade is: 90.5
16. Electric Bill Calculator
Problem: Compute bill with different rates per usage bracket.
if kWh <= 100: rate = 5.00
elif kWh <= 200: rate = 6.00
else: rate = 7.00
17. Student Honors System
Problem: Award “With Honors,” “High Honors,” or “Highest Honors.”