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 09:50
17. implement the jvm dload instruction for the mic-2. it has a 1-byte index and pushes the local variable at this position onto the stack. then it pushes the next higher word onto the stack as well
Answers: 2
question
Computers and Technology, 23.06.2019 07:30
Which option allows you to view slides on the full computer screen?
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
What are the 12 colors of the spectrum called?
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
The footer area of a web page generally houses which website feature? terms of use web page content business name or title menu headings
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
Computers and Technology, 17.04.2020 18:55
question
Mathematics, 17.04.2020 18:55
question
English, 17.04.2020 18:56
question
Mathematics, 17.04.2020 18:56
Questions on the website: 13722363