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 12:00
The following function returns a string of length n whose characters are all 'x'. give the order of growth (as a function of n) of the running time. recall that concatenating two strings in java takes time proportional to the sum of their lengths. public static string f(int n) { if (n == 0) return ""; if (n == 1) return "x"; return f(n/2) + f(n - n/2); } options: a) constant b) logarithmic c) linear d) linearithmic e)quadratic f)cubic g) exponential
Answers: 2
question
Computers and Technology, 23.06.2019 06:10
The head restraint should be adjusted so that it reaches a.the top of your ears b.the base of your skull c.the top of the head
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
Ais a built in formula in spread spread a is any math process such as addition or subtraction. options are function and operation
Answers: 1
question
Computers and Technology, 25.06.2019 00:40
Roger ginde is developing a program in supply chain management certification for managers. ginde has listed a number of activities that must be completed before a training program of this nature could be conducted. the activities, immediate predecessors, and times appear in the accompanying table: activity immediate predecessor(s) time (days) a -βˆ’ 44b -βˆ’ 55 c -βˆ’ 11 d b 1010 e a, d 55 f c 55 g e, f 1010 calculate the slack time. show the details.
Answers: 2
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, 27.02.2020 01:18
question
Mathematics, 27.02.2020 01:18
question
Mathematics, 27.02.2020 01:18
Questions on the website: 13722360