Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please add comments. CSC 201 Computer Science I Abstract Class Lalb Create an abstract class Appointment that represents an event on a calendar. The Appointment

Please add comments.

image text in transcribed

image text in transcribed

CSC 201 Computer Science I Abstract Class Lalb Create an abstract class "Appointment" that represents an event on a calendar. The Appointment" class will have four instance variables: An instance variable called "year" which will be of type int An instance variable called "month" which will be of type int An instance variable called "day" which will be of type int An instance variable called "description" which will be of type String . . * . The "Appointment class must also implement the following methods: A getter and setter for cach of the four instance variables An abstract method named occursOn which returns a boolean and takes three parameters of type int: aYear, aMonth, aDay Overrides the toString method from the Object superclass which returns the String . . Appointment aDescription On Date: 1/1/1969" where, "aDescription" is the value stored in the description instance variable and 1/1/1969" are the values stored in the month, day, and year instance variables respectively Overrides the equals method from the Object superclass which takes a single parameter of type "Object" and returns true if the given objects is an "Appointment" object and it's year, month, and day instance variables are equal to the current objects instance variables. If the given parameter is null, equals should return false. . Create a class "Onetime" which subclasses the "Appointment" class. The "Onetime" class will define no new instance variables. Write a parameterized constructor which takes three parameters of type int: aYear aMonth, aDay. The parameterized constructor sets the "year", "month", and "day" instance variables defined in the "Appointment" class to the values passed as parameters. The parameterized constructor should set the "description" instance variable to an empty String. ("") The "Onetime" class must also implement the following methods: . It must implement the abstract method "occursOn" defined in the "Appointment" class "occuresOn" should return true if the given parameters match the year, month, and day instance variables for the object. Otherwise it should return false Create a class "Yearly" which subclasses the "Appointment" class. The Yearly" class will define no new instance variables. Write a parameterized constructor which takes two parameters of type int: aMonth and aDay. The parameterized constructor sets the "month" and "day" instance variables defined in the "Appointment" class to the values passed as parameters. The parameterized constructor should set the "description" instance variable to an empty String. (") The "Ycarly" class must also implement the following methods: . It must implement the abstract method '"occursOn" defined in the "Appointment" class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Discuss global compensation practices.

Answered: 1 week ago