Question
In this question, you are expected to demonstrate the ability to Create an Object-Oriented system that gives a good representation of the real problem. Emphasis
In this question, you are expected to demonstrate the ability to Create an Object-Oriented system that gives a good representation of the real problem. Emphasis should be placed on Modelling the Code Structure to reflect the operation of the real problem, but do not neglect the correctness/completeness of both syntax and semantics.
Create a new class in java named Clock. Class Clock has the following private attributes:
* Hour (integer 1..12)
* Minutes (integer 0..59)
* Seconds (integer 0..59)
* isAM (boolean):
Class Clock supports the following public extractor/accessor methods:
* getHours()
* getMinutes()
* getSeconds()
* getIsAM()
Class Clock may be constructed in any of the following ways:
* no parameters (sets clock to midnight)
* hour and isAM specified (sets minutes and seconds to zero)
* all attributes specified
Class Clock also supports a setTime () method that sets all four attributes from argument values
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