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 07:30
An endless cycle of creation and response on the internet is called
Answers: 1
question
Computers and Technology, 23.06.2019 07:50
Apython programming question: assume s is a string of lower case characters. write a program that prints the number of times the string 'bob' occurs in s. for example, if s = 'azcbobobegghakl', then your program should print number of times bob occurs is: 2
Answers: 3
question
Computers and Technology, 24.06.2019 01:00
Answer these and get 40 points and brainliest
Answers: 1
question
Computers and Technology, 24.06.2019 12:00
Match the function to its purpose. fast worth 50pts.
Answers: 1
You know the right answer?
Date Class Constructor – assigns fields to appropriate formal parameter – using the setters so error...
Questions
question
Business, 17.09.2019 02:30
question
Mathematics, 17.09.2019 02:30
question
Mathematics, 17.09.2019 02:30
question
Health, 17.09.2019 02:30
Questions on the website: 13722367