Five numerical if-else questions.

Five numerical if-else questions.






1. **Divisibility Check:**
   Ask the user to input an integer and write a Java program to determine if it is divisible by 5. Provide appropriate messages for both cases.

2. **Leap Year Check:**
   Prompt the user to enter a year and create a Java program to check if it is a leap year or not. Display the result accordingly.

3. **Temperature Classification:**
   Take the temperature as input and write a Java program to classify it as "Hot" if it's greater than 30 degrees Celsius, "Moderate" if between 20 and 30 degrees, and "Cold" if less than 20 degrees.

4. **Grade Calculation:**
   Obtain a numeric score from the user and write a Java program to assign a letter grade based on the following scale: 
   - A: 90-100
   - B: 80-89
   - C: 70-79
   - D: 60-69
   - F: below 60

5. **Triangle Type:**
   Ask the user to input three angles (in degrees) of a triangle and create a Java program to determine whether the triangle is "Acute," "Obtuse," or "Right-angled." (Assume the sum of angles in a triangle is always 180 degrees.)


Contact us for software training, education or development










 

Post a Comment

0 Comments