subject

Write a class named Month. The class should have an int field named monthNumber that holds the number of the month. For example, January would be 1, February would be 2, and so forth. In addition, provide the following methods:* A no-arg constructor that sets the monthNumber to 1.* A constructor that accepts the number of the month as an argument. It would set the monthNumber field to the value passed as the argument. If a value less that 1 or greater than 12 is passed, the constructor should set monthNumber to 1.* A constructor that accepts the name of the month, case insensitive, such as "January" or "february" as argument. It should set the monthNumber field to the correct corresponding value.* A setMonthNumber method that accepts an int argument, which is assigned to the monthNumber field. If a value less than 1 or greater than 12 is passed, the method should set monthNumber to 1.* A getMonthNumber method that returns the value in the monthNumber field.* A getMonthName method that returns the name of the month. For example, if the monthNumber field contains 1, then this method should return "January" (First letter capitalized and the rest lower-case).* A toString method that returns the same value as the getMonthName method.* An equals method that accepts a Month object as an argument. If the argument object holds the same data as the calling object, this method should return true. Otherwise, it should return false.* A greaterThan method that accepts a Month object as an argument. If the calling object's monthNumber field is greater than the argument's monthNumber field, this method should return true. Otherwise, it should return false.* A lessThan method that accepts a Month object as an argument. If the calling object's monthNumber field is less than the argument's monthNumber field, this method should return true. Otherwise, it should return false.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:30
What are the steps involved in accepting all the changes in a document? arrange these in order click edit. click accept or reject. click changes. click accept all.
Answers: 1
question
Computers and Technology, 22.06.2019 13:30
Asoftware company hired ray, a college graduate to work in their development team. ray is assigned to work in the coding phase of a project. what happens during the coding phase of a software development project? a. the customer receives a working model of the software. b. developers convert the program design into code. c. developers gather requirements directly from the stakeholders. d. testing teams check the product for quality.
Answers: 1
question
Computers and Technology, 22.06.2019 14:10
Dean wants a quick way to look up staff members by their staff id. in cell q3, nest the existing vlookup function in an iferror function. if the vlookup function returns an error result, the text “invalid staff id” should be displayed by the formula. (hint: you can test that this formula is working by changing the value in cell q2 to 0, but remember to set the value of cell q2 back to 1036 when the testing is complete.)
Answers: 3
question
Computers and Technology, 23.06.2019 04:31
Selling a product through an electronic medium is
Answers: 1
You know the right answer?
Write a class named Month. The class should have an int field named monthNumber that holds the numbe...
Questions
question
Mathematics, 25.03.2021 02:40
question
Mathematics, 25.03.2021 02:40
question
Mathematics, 25.03.2021 02:40
question
Biology, 25.03.2021 02:40
question
Mathematics, 25.03.2021 02:50
Questions on the website: 13722367