Page 1 of 1

JAVA please: The problem is called "Calendar" Ever since you learned computer science, you have become more and more con

Posted: Mon May 09, 2022 6:12 am
by answerhappygod
JAVA please:
The problem is called "Calendar"
Ever since you learned computer science, you have become more
and more concerned about your time. To combine computer
learning with more efficient time management, you've decided to
create your own calendar app. In it you will store
various events.
To store an event, you have created the following class:
You have seen that everything works according to plan, but as
you prepare every day at the same time for 2 hours for computer
science, you would like your application to support recurring
events.
A recurring event is an event that is repeated once in a fixed
number of hours.
For example, if you train daily in computer science, the event will
be repeated every 24 hours. Thus, if
you prepared on May 24, 2019 at
12:31:00, the next time the event will take place
will be on May 25, 2019 at
12:31:00.
Another example is when you are sick and you have to take your
medicine once every 8 hours. Thus, if you first took the
medicine at 7:30, the next time you take it will be at
15:30 and then at 23:30.
Now you want to implement the EventRecurrent
class, a subclass of the Event
class. This will help you to know when the next
instance of a recurring event will occur.
Request
In this issue you will need to define an
EventRecurrent class. It must be a
subclass of the Event class and contain, in
addition, the following method:
●nextEvent (String) - this method
receives a String that follows the format
yyyy-MM-dd HH: mm: ss and returns a
String in the same format that represents the next
time when the event will start. That moment can be
exactly at the time received as a parameter or immediately
after.
In addition, the class will need to implement the following
constructor:
where numberHours is the number of hours after
which the event takes place again. For example, if the
number of hours is 24, it means that the event
takes place once a day.
Specifications:
•The time difference between the date received by the
NextEvent and the result of the method will not
exceed 1,000 days.
• To solve this problem you can use any class in
java.util and java.text;
• Events can overlap;
Example:
Attention:
In this issue, we have deliberately omitted some information from
the statement to teach you how to search for information on the
Internet to solve a new problem.