Advertisement
advictoriam

Untitled

Nov 26th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.53 KB | None | 0 0
  1. /**
  2.    A class has a title, time and room
  3. */
  4. public class ClassSchedule
  5. {  
  6.    private String title;
  7.    private String days;
  8.    private String startTime;
  9.    private String endTime;
  10.    private String room;
  11.  
  12.    /**
  13.       Constructs a class with title, day, time and room.
  14.    */
  15.    public ClassSchedule(String classTitle, String meetingDays, String aStartTime, String aEndTime, String classRoom)
  16.    {  
  17.      title = classTitle;
  18.      days = meetingDays;
  19.      startTime = aStartTime;
  20.      endTime = aEndTime;
  21.      room = classRoom;
  22.    }
  23.  
  24.    /**
  25.       Gets the title.
  26.       @return the title
  27.    */
  28.    public String getTitle()
  29.    {  
  30.       return title;
  31.    }
  32.  
  33.    /**
  34.       Gets the time in the form "days start time-end time"
  35.       @return the time
  36.    */
  37.    public String getTime()
  38.    {  
  39.       String time = days + " " + startTime + "-" + endTime;
  40.       return time;
  41.    }
  42.  
  43.    /**
  44.       Gets the room.
  45.       @return the room
  46.    */
  47.    public String getRoom()
  48.    {  
  49.       return room;
  50.    }
  51.  
  52.    /**
  53.       Sets the days.
  54.       @param meetingDays the new meeting days
  55.    */
  56.    public void setDays(String meetingDays)
  57.    {  
  58.       days = meetingDays;
  59.    }
  60.  
  61.    /**
  62.       Sets the start time.
  63.       @param aStartTime the new start time
  64.    */
  65.    public void setStartTime(String aStartTime)
  66.    {  
  67.       startTime = aStartTime;
  68.    }
  69.  
  70.    /**
  71.       Sets the end time.
  72.       @param anEndTime the new end time
  73.    */
  74.  
  75.    public void setEndTime(String anEndTime)
  76.    {
  77.       endTime = anEndTime;
  78.    }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement