// staff // // Author : K.J. Chan // Date : Novermber 2008 // Language : Java // Description: the staff class that extends person class staff extends person { // Declarations ////////////////////////////////////////// private String user ; // username private String room ; // room number private int phone ; // phone number // Constructors ////////////////////////////////////////// public staff( String first_name, String surname, char sex, dob DOB, String user, String room, int phone ) { super( first_name, surname, sex, DOB ) ; this.user = user ; this.room = room ; this.phone = phone ; } // Return Methods ////////////////////////////////////////// public String get_user() { return user ; } public String get_room() { return room ; } public int get_phone() { return phone ; } // Other Methods ////////////////////////////////////////// public String toString() { System.out.printf( "STAFF toString\n" ) ; System.out.printf( "Firstname - %s\n", first_name ) ; System.out.printf( "Surname - %s\n", surname ) ; System.out.printf( "Sex - %c\n", sex ) ; System.out.printf( "Day/Month/Year - %02d/%02d/%02d\n", DOB.get_day(),DOB.get_month(),DOB.get_year() ) ; System.out.printf( "username - %s\n", user ) ; System.out.printf( "Room - %s\n", room ) ; System.out.printf( "Phone - %d\n", phone ) ; return "\n\nEND OF STAFF\n\n" ; } }