• Nursing Exams
  • HESI A2 EXAMS
  • Finance and Insurance
  • NCLEX EXAM
  • Real Estate
  • Business
  • Medical Technology
  • Counseling and Social Work
  • English Language
  • Graduate and Professional School
  • CAREER EXAMS
  • Medical Professional
  • K 12 EXAMS
  • Personal Fitness
  • Public Service and Legal
  • Teaching
  • Nutrition
  • Construction and Industry
  • Test

Virginia Tech Honor Code Pledge

Test Nov 7, 2025
Loading...

Loading study material viewer...

Page 0 of 0

Document Text

import sofia.micro.*;

// Virginia Tech Honor Code Pledge:

// // As a Hokie, I will conduct myself with honor and integrity at all times.// I will not lie, cheat, or steal, nor will I accept the actions of those // who do.// -- Robert Creamer (rcreamer)

//-------------------------------------------------------------------------

/**

  • Represents a weekly appointment at a specified time,
  • including a description.
  • *

  • @author Robert Creamer (rcreamer)
  • @version (2020.11.06)
  • */ public class Appointment extends Actor { //~ Fields ................................................................/**

  • gets the hour count for appointment
  • */ private int hour; /**

  • describes what type of appointment
  • */ private String description;

// Add a field representing the hour of this appointment

// Add a field representing the description of this appointment //~ Constructor ...........................................................

// ----------------------------------------------------------

/**

  • Creates a new Appointment object.
  • *

  • @param h is to get numbers (0, 23)
  • @param des is to describe appointment types
  • * * */ public Appointment(int h, String des) { this.hour = h; this.description = des; } //~ Methods ...............................................................

// ----------------------------------------------------------

/**

  • Get the description of this appointment.
  • @return This appointment's description.
  • */ public String getDescription() { return this.description;

} This study source was downloaded by 100000820454130 from CourseHero.com on 04-02-2021 13:14:57 GMT -05:00

https://www.coursehero.com/file/81133402/Appointmentjava/

This study resource was shared via CourseHero.com

// ----------------------------------------------------------

/**

  • Get the hour of this appointment.
  • @return This appointment's hour, in military time.
  • */ public int getHour() { return this.hour; }

// ----------------------------------------------------------

/**

  • Set the description of this appointment.
  • @param des follows apoointment type description
  • */ public void setDescription(String des) { this.description = des;

}

// ----------------------------------------------------------

/**

  • Set the hour of this appointment.
  • @param hour The new hour for this appointment, in military
  • time.
  • */ public void setHour(int hour) { this.hour = hour;

}

// ----------------------------------------------------------

/**

  • Set the hour of this appointment, using a more human-friendly
  • string.
  • @param time The new hour for this appointment, using an
  • am/pm designation such as "9am" or "5pm".
  • */ public void setTime(String time) { //remove the digit part out of the time in string String digits = time.substring(0, time.length() - 2);

//covert digits part to int int h = Integer.parseInt(digits); this.hour = h;

}

// ----------------------------------------------------------

/**

  • Get a string representation of this appointment.
  • @return A human-readable representation of this appointment
  • that includes the time (in am/pm format) and the description,
  • such as "11am: CS 1114". This study source was downloaded by 100000820454130 from CourseHero.com on 04-02-2021 13:14:57 GMT -05:00

https://www.coursehero.com/file/81133402/Appointmentjava/

This study resource was shared via CourseHero.com

*/ public String toString() {

//print the appointment detials String str = "Appointment at" + this.hour + "hours for" + this.description; return str;

} } This study source was downloaded by 100000820454130 from CourseHero.com on 04-02-2021 13:14:57 GMT -05:00

https://www.coursehero.com/file/81133402/Appointmentjava/

This study resource was shared via CourseHero.com

Download Study Material

No purchase options are available for this study material at the moment.

Study Material Information

Category: Test
Description:

import sofia.micro.*; // Virginia Tech Honor Code Pledge: // // As a Hokie, I will conduct myself with honor and integrity at all times. // I will not lie, cheat, or steal, nor will I accept the ac...