TASK- Programming Fundamentals(Lab)
TASK- Programming Fundamentals(Lab)
Question:1 Write a program that checks if a person is eligible to vote based on their age. The legal voting
age is 18 years and above. The program should take the user's age as input and display whether they are
eligible to vote or not.
Question:2 Write a program that checks if a given temperature in Celsius is above freezing point (0 degrees
Celsius). The program should prompt the user to enter the temperature and display a message indicating
whether it is above freezing or not.
Question:3 Write a program that checks if a given number is positive. If the number is positive, the program
should also print its square. The program should prompt the user to enter the number.
Question:4 Write a program that checks if a given number is within a specific range (e.g., between 1 and
100, inclusive). The program should prompt the user to enter a number and display a message indicating
whether the number is in the specified range.
Question:1 Write a program to classify a person's age into categories (child, teenager, adult, senior) using
nested if statements.
Question:2 Write a program that determines whether the weather is hot, warm, cool, or cold based on the
temperature using nested if statements.
Question:1 Write a program that simulates a simple voting system, allowing users to vote for a candidate
based on their ID.
Question:2 Create a program that calculates BMI based on user input and displays the health category.
Question:3 Write a program that simulates an alarm system based on the time of day.