subject

Date Class Constructor – assigns fields to appropriate formal parameter – using the setters so error checking will occur. The constructor with no formal parameters should have no statements in the body of the function. Accessors – return the appropriate fields Setters setMonth – assigns the field to the formal parameter. Error checks the formal parameter to make sure it is a valid month number. If it isn’t a valid month, it sets the month to 1. setDay – assigns the field to the formal parameter. Error checks to make sure the day being passed in is a valid day for the month the object has (ex: January can only be 1-31). You do NOT have to check for leap year – just make sure February is 1-29. If the day is invalid, it sets the day to be 1 setYear – assigns the field to the formal parameter. Error checks the formal parameter to make sure it is not negative. If it is it sets the year to be 1900. toString – creates a string in the format M/D/Y and returns it. The following allows you to concatenate a string with an integer. Use this information to create and return the string in the format M/D/Y. string ans = to_string(month) + "/"; Date -day: int -month: int -year: int +Date() +Date(month:int, day:int, year:int) +getMonth(): int +getDay(): int +getYear():int +setMonth(month:int):void +setDay(day:int) :void +setYear(year:int) :void +toString():string

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:00
Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". any value that is the same as the immediately preceding value is considered a consecutive duplicate. in this example, there are three such consecutive duplicates: the 2nd and 3rd 5s and the second 6. note that the last 3 is not a consecutive duplicate because it was preceded by a 7. write some code that uses a loop to read such a sequence of non-negative integers , terminated by a negative number. when the code finishes executing, the number of consecutive duplicates encountered is printed. in this case, 3 would be printed. assume the availability of a variable, stdin, that references a scanner object associated with standard input. that is, stdin = new scanner(system.in); is given.
Answers: 1
question
Computers and Technology, 22.06.2019 19:20
Write a program that reads a file consisting of students’ test scores in the range 0–200. it should then determine the number of students having scores in each of the following ranges: 0–24, 25–49, 50–74, 75–99, 100–124, 125–149, 150–174, and 175–200. output the score ranges and the number of students. (run your program with the following input data: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157, 189.)
Answers: 3
question
Computers and Technology, 22.06.2019 20:00
What side length would you specify if you were required to create a regular hexagonal plate that was composed of 33 cm(squared) of sheet metal? dimension the side length to 0.1 cm
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
What is the term for water wave that is created by an underwater earthquake
Answers: 1
You know the right answer?
Date Class Constructor – assigns fields to appropriate formal parameter – using the setters so error...
Questions
question
Mathematics, 24.01.2020 10:31
question
Computers and Technology, 24.01.2020 10:31
Questions on the website: 13722359