Alarm Clock foundation
Here is a brief description of another format for the AlarmClock that you can complete for Lesson5. This pseudocode does not require you to create an AlarmClockApp class. Everything is self contained in the AlarmClock.java file.
import statements (at least 2)
AlarmClock class declaration
Declare at least four data members, an instance of the inputBox and the three Time instances.
Main:
Make an instance of the AlarmFrame and the input box taking the alarmFrame instance as a parameter.
Make a ListBox instance and add all necessary items to create your menu.
You will need two variables for the alarm; the start time and the length of the alarm to 0.
In a do-while loop (that continues until the user selects the fourth item in the menu)
1. get the users menu choice
2. make a switch statement that switches on the user's choice. Each case statement will need to call or set the appropriate values (or methods).
Create a calender object and the instances of the Time class (taking appropriate paramenters (which parameters will need to come from the Calender class?)
Take care of the increment until... (a loop here?)
Finally consider what to do if the alarm has started yet (how long should it keep going if the alarm is already going?)
Lastly, I recommend using a for loop to print out the Message based on the current time of the day and when the alarm should go off.
Methods:
int getInt(String prompt, int min, int max)- gets an integer from the user that meets the appropriate range (different based on hours verses minutes or seconds.
increment()- if the seconds were incremented then what should be incremented? Likewise, if the minutes were incremented, then what should be incremented?
Last modified: Fri Mar 2 10:45:47 CST 2001