Question
Java: Please help with the following assignment. Thank you. SubClass Coding: Create an AlarmClock subclass of Clock with the following functionality. Only write the code
Java: Please help with the following assignment. Thank you.
SubClass Coding: Create an AlarmClock subclass of Clock with the following functionality. Only write the code that is requested. 1. Three int instance fields to represent the Alarm's time in hours, minutes, and seconds. 2. A constructor with all the parameter to create an AlarmClock instance. You really need to call the constructor in the superclass! 3. Methods: (1). set method to change the alarms hour. Ensure the hour is valid time(0-23) as above. The other set/get methods don't have tobe implements, I trust you can do that... (2). toString method that displays both the current time and alarm such as: The time is 12 hours, 23 minutes, 45 seconds. The alarm is at 6 hours, 0 minutes, 0 seconds. Use super.toString() to create the first part of the output!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started