sysc 2004 assignment 1.txt

sysc 2004 assignment 1.txt - The alarm time(represented by...

Info icon This preview shows pages 1–2. Sign up to view the full content.

/** * The alarm time (represented by 12 hour clock display) * and whether or not it is set. * * @author Lynn Marshall * @version Sample Solution Part 2 */ public class Alarm { private ClockDisplay12 alarmTime; private boolean set; /** * Constructor for objects of class Alarm. The alarm * time is set to midnight and the alarm is not set. */ public Alarm() { alarmTime = new ClockDisplay12(); set = false; } /** * Constructor for objects of class Alarm, where the time * and alarm status is provided. If any value is invalid * it is changed to a valid value: hours to 12, minutes to 0, * amPm to "a.m.". * * @param hours The alarm time hours (1-12) * @param minutes The alarm time minutes (0-59) * @param amPm "a.m." or "p.m." * @param set Whether the alarm is set or not (boolean) */ public Alarm(int hours, int minutes, String amPm, boolean set) { alarmTime = new ClockDisplay12(hours, minutes, amPm); this.set = set; } /** * Sets the alarm time.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Image of page 2
This is the end of the preview. Sign up to access the rest of the document.
  • Spring '11
  • Assignment 1

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern