Question: i need with how the code will look In the AlarmClockController class, find the following line: // TODO: add a data member Replace that line
In the AlarmClockController class, find the following line: // TODO: add a data member Replace that line with a statement that declares an Alarmclock instance variable named theclock. Don't forget to make it private. 1 of 7 Now, find the following line in the constructor for AlarmclockController: // TODO: initialize the data member Replace that line with a statement that initializes the data member: a instantiate an AlarmClock object using the no-parameter constructor b. assign that object to the this.theclock data member Write a getter for the theClock data member. We can use Eclipse to help us write this method: a. Right-click your code. From the shortcut menu choose Source > Generate Getters and Setters b. In the resulting dialog, expand the item next to theClock, select getTheClock(), and click Generate. This will give you some code, but we'll need to modify it a little to make it fit with the style that we teach here. c. Add an appropriate method specification: * Gets the AlarmClock object * @precondition none * @postcondition none * @return the AlarmClock object d. Change the code in the return statement so that it says
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
