subject

For this project you will be writing up a simple clock program to keep track of time. simpleclock. java - contains your implementation of the simpleclock class. you will need to provide the code for a constructor as well as the mutator methods set and tick and the accessor method tostring. look at the comments for each method to see how they should be implemented - the trickiest method is probably tick, which requires that you deal with the changing of minutes, hours and am/pm in order to get it to work correctly./*** simpleclock. java** a class that implements a simple clock.** @author enter your name here* @version enter the date here**/public class simpleclock {/* private member variables */private int hours; private int minutes; private int seconds; private boolean morning; /* constructor *//*** the constructor should set the intial value of the clock to 12: 00: 00am.*/public simpleclock() {// todo - complete this constructor}/* instance methods *//*** sets the time showing on the clock.** @param hh* - the hours to display* @param mm* - the minutes to display* @param ss* - the seconds to display* @param morning* - true for am, false for pm*/public void set(int hh, int mm, int ss, boolean morning) {// todo - complete this procedure}/*** advances the clock by 1 second. make sure when implementing this method* that the seconds "roll over" correctly - 11: 59: 59am should become* 12: 00: 00pm for example.*/public void tick() {// todo - complete this procedure}/*** returns a string containing the current time formatted as a digital clock* format. for example, midnight should return the string "12: 00: 00am" while* one in the morning would return the string "1: 00: 00am" and one in the* afternoon the string "1: 00: 00pm".** @return - the current time formatted in am/pm format*/@overridepublic string tostring() {// todo - complete this function// todo - the following line is only here to allow this program to// compile. replace it and remove this comment when you complete// this method. return "not implemented"; }}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:00
Your company has 1,500 desktop computers running windows 7. you want to upgrade them to windows 10. which type of microsoft license would be best suited in this situation?
Answers: 3
question
Computers and Technology, 23.06.2019 02:00
As with any small island country, cuba has fewer natural resources than countries such as brazil. this affects their economy in that cuba a) exports only manufactured products. b) exports more products than it imports.. c) must import more products than it exports. d) has imposed trade barriers against the united states.
Answers: 3
question
Computers and Technology, 23.06.2019 13:30
What is the primary difference between the header section of a document and the body? a. the body is displayed on the webpage and the header is not. b. the header is displayed on the webpage and the body is not. c. the tag for the body is self-closing, but the tags for the headers must be closed. d. the tag for the header is self closing, but the tag for the body must be closed.
Answers: 3
question
Computers and Technology, 24.06.2019 03:00
What is one potential problem associated with an organization purchasing new technology early in its lifecycle
Answers: 1
You know the right answer?
For this project you will be writing up a simple clock program to keep track of time. simpleclock. j...
Questions
question
Mathematics, 26.06.2019 15:30
question
History, 26.06.2019 15:30
question
Business, 26.06.2019 15:30
Questions on the website: 13722363