Computers and Technology

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

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 14:30, HarryPotter10
Open this link after reading about ana's situation. complete each sentence using the drop-downs. ana would need a minimum of ato work as a translator. according to job outlook information, the number of jobs for translators willin the future.
Answers: 3
image
Computers and Technology, 23.06.2019 17:00, evanwall91
What does the faves button do? a. users mark a web page as a favorite b. leads other readers to favor a specific page c. readers sort and align their favicons, or favorite icons d. leads users to a message board where they can post questions
Answers: 1
image
Computers and Technology, 23.06.2019 23:30, econsta3
Perform an online search about the booting process of a computer and list all the steps
Answers: 2
image
Computers and Technology, 24.06.2019 01:30, Cinders13
How can you make your column headings stand out?
Answers: 1
Do you know the correct answer?
Date Class Constructor – assigns fields to appropriate formal parameter – using the setters so error...

Questions in other subjects:

Konu
Mathematics, 24.11.2020 04:00
Konu
Physics, 24.11.2020 04:00