Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
11 views

TASK- Programming Fundamentals(Lab)

Programming practice

Uploaded by

malaikatariq37
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

TASK- Programming Fundamentals(Lab)

Programming practice

Uploaded by

malaikatariq37
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Rawalpindi Women University, Rawalpindi

Department of Computer Science


(FALL 2024 Semester)

Course: Programming Fundamentals(Lab) Group Task: 3 members per group


Task:01 (If Statement, If Else If Statement)

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.

Task:02 (Nested If Statement)

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.

Task:03 (Switch Statement)

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.

You might also like