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
What does the clone tile command do?
Angelina_Jolie [31]
It allows you to create tiled copies of an object while tweaking the variables
5 0
3 years ago
Read 2 more answers
Fourth-generation languages are commonly used to access ____
Nesterboy [21]
Databases use fourth-generation languages in order to access its contents. These fourth-generation programming languages are widely used in database managing. It was designed to have a more specific use in contrast to the commonly used 3G languages at that time. 
6 0
3 years ago
24) The process of ensuring the accuracy of data and their conversion from raw form into classified forms appropriate for analys
WINSTONCH [101]
C) data preparation.
 Is the process of ensuring the accuracy of data and their conversion from raw form into classified forms appropriate for analysus
8 0
3 years ago
In which technique does a group rate or rank a set of information, compile the results and repeat until everyone is satisfied wi
garik1379 [7]
The correct option is DELPHI. Delphi technique is a structured and systematic method used in forecasting. The method often involve sending several rounds of questionnaires to experts. The anonymous responses are then gathered together and shared with the concerned group after each round of answers are received. 
5 0
3 years ago
Select the true statement from those listed below. Java applets may be contained in files with the .class extension Java applets
tiny-mole [99]

Answer:

The correct option of the following question is the Java applets may be contained in the files with .class extension.

Explanation:

JAVA is the Programming Language that can used to create the complete applications which may be run on the single computer or can be distributed among the servers and the clients in the network.

An applet is Internet-based programs that are written in the Java programming language, which is the programming language for Web and it can be downloaded by any of the computers. An applet is also run in the HTML. It is usually embedded in the HTML page on the Website and it can be executed from the browser.

5 0
3 years ago
Other questions:
  • Ayuda no encuentro el concepto de estas tres preguntas: ¿para qué sirve la administración en la ofimatica o informática? ¿Que so
    13·1 answer
  • Write a Bash script that takes the name of a file or directory as an argument, 1. reports if it is a directory or a file, and if
    14·1 answer
  • What scientific principle would a plumber need to know when designing and installing plumbing a new construction
    13·1 answer
  • An automated search feature used by search engines to find results that match your search terms is called a spider or _______. A
    15·2 answers
  • PLSSS HELPP IM DESPERATE!!!
    11·1 answer
  • I need them on this question
    5·1 answer
  • Write a function called word_count that takes a string and returns a dictionary that maps every case-insensitive word in the str
    6·1 answer
  • It is a part of webpage that contains the logo ang branding of the web page​
    15·1 answer
  • The operation of an enable input on a multiplexer chip is.
    14·1 answer
  • Which of the following is a part of a DML statement? a. CREATE b. ALTER c. DROP d. SELECT. SE_LECT
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!