1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Romashka-Z-Leto [24]
3 years ago
6

Design and implement an application that reads an integer value representing a year from the user. The purpose of the program is

to determine if the year is a leap year (and therefore has 29 days in February) in the Gregorian calendar. A year is a leap year if it is divisible by 4, unless it is also divisible by 100 but not 400. For example, the year 2003 is not a leap year, but 2004 is. The year 1900 is not a leap year because it is divisible by 100, but the year 2000 is a leap year because even though it is divisible by 100, it is also divisible by 400. Produce an error message for any input value less than 1582 (the year the Gregorian calendar was adopted).
Computers and Technology
1 answer:
olga55 [171]3 years ago
4 0

Answer :

Written in java

import java.util.Scanner;

public class Main{

   public static void main(String[] args) {

       int year;

       Scanner scanner = new Scanner(System.in);

       System.out.print("Please enter a year\n\n");

       year = scanner.nextInt();

       while (year < 1582) {

           System.out.print("\nPlease enter a different year above 1582\n");

           year = scanner.nextInt();

       }

       if (year % 4 == 0) {

           if(year % 100 ==0 && year % 400 != 0){

                   System.out.println(year + " is not a leap year\n\n");

           }else {

               System.out.println(year + " is a leap year\n");

           }

       } else {

           System.out.println(year + " is not a leap year\n\n");

       }

   }

}

You might be interested in
_____ are the supertiny on-off switches in a chip that work collectively to calculate or store things in memory. Transistors Mul
Pepsi [2]

Answer:

Transistors

Explanation:

4 0
3 years ago
Sub to the channel plz plz
Hunter-Best [27]

Answer:

um

Explanation:

6 0
2 years ago
Read 2 more answers
What stylistic device does Reverend Jesse Jackson use in the following statement: "We must relate instead of debate; we must ins
vivado [14]

Answer:

Parallelism

Explanation:

Parallelism:- It is a linguistic device.It is basically the use of components that are similar in their meaning ,sound or construction.So in the statement by Reverend Jesse Jackson .The statement uses words that sound similar and the statements have similar construction.

So we conclude that the answer is parallelism.

8 0
3 years ago
How does theatre compare with movies or television? What makes it similar to movies and television? What makes it different?
givi [52]

Answer:

you cant mess up in theatre but you can redo scences in movies, thay both have acting in them

Explanation:

im a theatre person

3 0
4 years ago
Which keyboard feature is a form feed character?
Sever21 [200]

Answer:

B

Explanation:

The form feed character code is defined as 12 (0xC inbhexademical), and may be represented as control+L or^L. In a related use, control+L can be used to clear the screen in Unix shells such as bash. In the C programming language ( and other languages derived from C ), the form feed character is represented as '\f'.

5 0
3 years ago
Other questions:
  • Chris needs to modify the default bullets that are used in a nonnumbered list in word. Which method should he use?
    9·2 answers
  • Is it necessary that every autonomous system use the same intra-AS routing algorithm? Why or why not?
    10·1 answer
  • Which shortcut key aligns text to the center of the paige
    5·1 answer
  • Greg works outside. He is often found cutting grass and making the local park grounds look nice for guests.
    10·1 answer
  • Durante 10s, la velocidad de rotación y el momento de giro de las ruedas de un coche eléctrico son 100 rpm y 1405,92 Nm, respect
    13·1 answer
  • Write a program that accepts the lengths of three sides of a triangle as an input from the user: A, B, C
    13·1 answer
  • 7.5 Code practice Plz answer ASAP
    15·1 answer
  • The main part of your program has the following line of code.
    7·1 answer
  • Some programmers include scroll bars, title bars, buttons, and menus in a program simply by adding them to a layout through a pr
    10·1 answer
  • Select the correct answer..
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!