Computers and Technology
Computers and Technology, 12.12.2019 02:31, jacks0292

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"; }}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:00, michelle7511
Which database model is best used for data warehouse and data mining
Answers: 3
image
Computers and Technology, 23.06.2019 11:30, leapfroggiez
Auser is given read permission to a file stored on an ntfs-formatted volume. the file is then copied to a folder on the same ntfs-formatted volume where the user has been given full control permission for that folder. when the user logs on to the computer holding the file and accesses its new location via a drive letter, what is the user's effective permission to the file? a. read b. full control c. no access d. modify e. none of the above
Answers: 1
image
Computers and Technology, 23.06.2019 12:00, daelinrobinson
If you're using an existing powerpoint presentation that will receive new slides based on a word outline, select the a. slide that will appear after the new slides. b. first slide in the presentation. c. slide that will appear before the new slides. d. last slide in the presentation.
Answers: 2
image
Computers and Technology, 23.06.2019 14:30, bernicewhite156
Select the correct answer. what does it indicate when a website displays https instead of http? a. the website is secure. b. there is no secure sockets layer. c. the secure sockets layer is hidden. d. the website is not secure.
Answers: 1
Do you know the correct answer?
For this project you will be writing up a simple clock program to keep track of time. simpleclock. j...

Questions in other subjects:

Konu
Mathematics, 09.09.2021 05:40
Konu
Mathematics, 09.09.2021 05:40