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 23:30
Which of the following is not a symptom of chronic fatigue syndrome
Answers: 2
question
Computers and Technology, 23.06.2019 04:20
Which network media uses different regions of the electromagnetic spectrum to transmit signals through air? uses different regions of the electromagnetic spectrum to transmit signals through air.
Answers: 2
question
Computers and Technology, 23.06.2019 08:00
Which argument is not a valid filter? does not equal this quarter filter by cell color all of these are valid filter arguments.
Answers: 2
question
Computers and Technology, 23.06.2019 16:00
Write a grading program for a class with the following grading policies: a. there are two quizzes, each graded on the basis of 10 points. b. there is one midterm exam and one final exam, each graded on the basis of 100 points. c. the final exam counts for 50% of the grade, the midterm counts for 25%, and the two quizzes together count for a total of 25%. (do not forget to normalize the quiz scores. they should be converted to a percentage before they are averaged in.) any grade of 90 or more is an a, any grade of 80 or more (but less than 90) is a b, any grade of 70 or more (but less than 80) is a c, any grade of 60 or more (but less than 70) is a d, and any grade below 60 is an f. the program will read in the student’s scores and output the student’s record, which consists of two quiz and two exam scores as well as the student’s average numeric score for the entire course and final letter grade. define and use a structure for the student reco
Answers: 2
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
Social Studies, 05.12.2020 16:50
question
History, 05.12.2020 16:50
question
Social Studies, 05.12.2020 16:50
question
Business, 05.12.2020 16:50
Questions on the website: 13722363