subject

In this Java programming assignment, you will practice using selection statements to determine whether a given year in the past or future qualifies as a "Leap Year". I. Design a class called LeapYear in a file called LeapYear. java. This class will hold the main method and the class method that we will write in this assignment.
II. Write an empty public static void main(String[] args) method. This method should appear inside the curly braces of the LeapYear class.
III. Write one static class method (isLeapYear). The method isLeapYear should take one integer argument and will return a boolean. The method should compare the input (a year) with the qualifications for determining whether a given year is a leap year or not, and return the appropriate true or false value on completing these checks. The rule for leap years is as follows: if the year is evenly divisible by 4, it is a leap year, except in the case where it is also evenly divisible by 100 but not evenly divisible by 400. Several example method calls appear below.
LeapYear. isLeapYear(2016) // returns true, divisible evenly by 4
LeapYear. isLeapYear(2015) // returns false, not divisible evenly by 4
LeapYear. isLeapYear(1900) // returns false,
LeapYear. isLeapYear(2000) // returns true, divisible evenly by 4 and 100, but also by 400
IV. Complete the definition for main. Your program should create a new Scanner object, prompt the user to type in a year, and then collect an integer. The main method should then call the static method isLeapYear in order to determine whether or not the year in question fits the characteristics of a leap year. From this point, the results of the method call should be used to print a statement that expresses the results. For example, if the user enters 2015 as input: "The year 2015 is not a leap year."

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
Which of these options are the correct sequence of actions for content to be copied and pasted? select content, click the copy button, click the paste button, and move the insertion point to where the content needs to be inserted. click the copy button, select the content, move the insertion point to where the content needs to be inserted, and click the paste button. select the content, click the copy button, move the insertion point to where the content needs to be inserted, and click the paste button. select the content, move the insertion point to where the content needs to be inserted, click the copy button, and click the paste button.
Answers: 3
question
Computers and Technology, 22.06.2019 22:00
Consider the following declarations (1, 2, 3, 5, 7)class bagtype{public: void set(string, double, double, double, double); void print() const; string getstyle() const; double getprice() const; void get(double, double, double, double); bagtype(); bagtype(string, double, double, double, double); private: string style: double l; double w; double h; double price; }; a.) write the definition of the number function set so that private members are set according to the parametersb.) write the definition of the member function print that prints the values of the data membersc.) write the definition of the default constructor of the class bagtype so that the private member variables are initialized to "", 0.0, 0.0, 0.0, 0.0, respectively d.) write a c++ statement that prints the value of the object newbag.e.) write a c++ statement that declares the object tempbag of type bagtype, and initialize the member variables of tempbag to "backpack", 15, 8, 20 and 49.99, respectively
Answers: 3
question
Computers and Technology, 22.06.2019 22:40
Write a program that defines symbolic names for several string literals (chars between quotes). * use each symbolic name in a variable definition. * use of symbolic to compose the assembly code instruction set can perform vara = (vara - varb) + (varc - vard); ensure that variable is in unsigned integer data type. * you should also further enhance your symbolic logic block to to perform expression by introducing addition substitution rule. vara = (vara+varb) - (varc+vard). required: debug the disassembly code and note down the address and memory information.
Answers: 3
question
Computers and Technology, 23.06.2019 11:20
Http is the protocol that governs communications between web servers and web clients (i.e. browsers). part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. some of the codes and their meanings are listed below: 200, ok (fulfilled)403, forbidden404, not found500, server errorgiven an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.
Answers: 2
You know the right answer?
In this Java programming assignment, you will practice using selection statements to determine wheth...
Questions
question
Mathematics, 08.06.2021 01:20
question
Mathematics, 08.06.2021 01:20
question
Mathematics, 08.06.2021 01:20
Questions on the website: 13722363