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

ISD VB - NET Programming Questions (IF Statements)

Programs for PC's

Uploaded by

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

ISD VB - NET Programming Questions (IF Statements)

Programs for PC's

Uploaded by

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

1.

Basic If Statement

o Write a program that asks the user to enter a number. If the number is greater
than 10, display a message saying “The number is greater than 10.”

2. If-Else Statement

o Create a program that asks the user to enter their age. If the age is 18 or older,
display “You are an adult.” Otherwise, display “You are a minor.”

3. If-ElseIf-Else Statement

o Write a program that asks the user to enter a score between 0 and 100. If the
score is 90 or above, display “Grade: A”. If the score is between 80 and 89,
display “Grade: B”. If the score is between 70 and 79, display “Grade: C”.
Otherwise, display “Grade: F”.

4. Nested If Statements

o Create a program that asks the user to enter two numbers. If both numbers are
positive, display “Both numbers are positive.” If both numbers are negative,
display “Both numbers are negative.” If one number is positive and the other is
negative, display “One number is positive and the other is negative.”

5. Simple Calculator
o Write a program that asks the user to enter two numbers and an
operator (+, -, *, /). Perform the corresponding operation and display
the result. Use If statements to determine which operation to perform.
6. Temperature Check
o Create a program that asks the user to enter the current temperature. If
the temperature is below 0, display “It’s freezing!” If the temperature is
between 0 and 30, display “The weather is normal.” If the temperature
is above 30, display “It’s hot!”
7. Leap Year Checker
o Write a program that asks the user to enter a year. If the year is
divisible by 4 and not divisible by 100, or if it is divisible by 400, display
“Leap Year”. Otherwise, display “Not a Leap Year.”
8. Discount Calculator
o Create a program that asks the user to enter the total amount of a
purchase. If the amount is greater than 1000, apply a 10% discount and
display the discounted amount. Otherwise, display the total amount
without any discount.

You might also like