0% found this document useful (0 votes)
6 views

Quiz

Uploaded by

fatimakaleem456
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Quiz

Uploaded by

fatimakaleem456
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Quiz # 1

Question 1: Age Group Classification

Write a program that asks the user for their age and then classifies them into different age groups based
on the input.

 If the age is less than 13, print "Child".

 If the age is between 13 and 19, print "Teenager".

 If the age is between 20 and 59, print "Adult".

 If the age is 60 or above, print "Senior".

Question 2: Grade Classification Based on Marks

Create a program that accepts a student's marks and assigns a grade based on the marks.

 If marks are 90 or above, print "A".

 If marks are 80 or above but less than 90, print "B".

 If marks are 70 or above but less than 80, print "C".

 If marks are 60 or above but less than 70, print "D".

 Otherwise, print "F".

Question 3: Temperature Checker

Design a program that accepts a temperature and displays a message based on its value.

 If the temperature is above 30, print "It's hot!"

 If the temperature is between 15 and 30, print "It's warm."

 If the temperature is between 0 and 15, print "It's cold."

 If the temperature is below 0, print "It's freezing!"

Question 4: Number Classification

Write a program that accepts a number from the user and classifies it.

 If the number is positive and even, print "Positive Even".

 If the number is positive and odd, print "Positive Odd".

 If the number is negative and even, print "Negative Even".

 If the number is negative and odd, print "Negative Odd".

 If the number is zero, print "Zero".

You might also like