advictoriam

Untitled

Nov 26th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.07 KB | None | 0 0
  1. /**
  2.    A computer 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 computer class with title, days, time and room
  14.    */
  15.    public ClassSchedule(String classTitle, String meetingDays, String aStartTime, String anEndTime, String classRoom)
  16.    {  
  17.      title = classTitle;
  18.      days = meetingDays;
  19.      startTime = aStartTime;
  20.      endTime = anEndTime;
  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.       // your work here
  40.       String time = String.format("%s %s-%s", days, startTime, endTime);
  41.       return time;
  42.    }
  43.    
  44.    /**
  45.       Gets the room
  46.       @return the room
  47.    */
  48.    public String getRoom()
  49.    {  
  50.       return room;
  51.    }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment