Write a program that asks the user to enter a year, and then displays whether that year is a leap year or not. Note that a year is a leap year if the year is a multiple of 400, or it is a multiple of 4 and not a multiple of 100.
My typed my Java Code & question is screenshot-
import java.util.Scanner;
public class SortedNames {
public static void main(String[] args) {
String name1;
String name2;
String name3;
Scanner keyboard=new Scanner(System.in);
System.out.print("Please Enter First Name: ");
name1=keyboard.nextLine();
System.out.print("Please Enter Second Name: ");
name2=keyboard.nextLine();
System.out.print("Please Enter Third Name: ");
name3=keyboard.nextLine();
if((name2.compareToIgnoreCase(name1)<0)&&(name2.compareToIgnoreCase(name3)<0))
{
System.out.println(name2);
}
if((name1.compareToIgnoreCase(name2)<0)&&(name1.compareToIgnoreCase(name3)<0))
{
System.out.println(name1);
}
if((name3.compareToIgnoreCase(name1)<0)&&(name3.compareToIgnoreCase(name2)<0))
{
System.out.println(name3);
}
}
}
![2. Write a program that asks the user to enter a year, and then displays whether that year is a leap
year or not. Note that a year is a leap year if the year is a multiple of 400, or it is a multiple of
4 and not a multiple of 100.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F11637648-8d3c-4576-b8fc-068b6de80084%2F5ea5cca5-ed2b-4e20-802d-fa5c7a1a5212%2Fsq91taq_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps with 4 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)