Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Java Classes
TravProfInterface
- Loading branch information
0 parents
commit 19ae8b4
Showing
4 changed files
with
1,652 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import java.io.Serializable; | ||
|
||
public class MedCond implements Serializable | ||
{ | ||
// Variables | ||
String algType; | ||
String mdPhone; | ||
String mdContact; | ||
String illType; | ||
|
||
|
||
//Constructor | ||
public MedCond(String mdContact, String mdPhone, String algType, String illType) | ||
{ | ||
this.mdContact=mdContact; //medical contact | ||
this.mdPhone=mdPhone; //Medical Phone # | ||
this.algType=algType; // Allergy Type | ||
this.illType=illType; // Illness type | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return mdContact + "\t" + mdPhone + "\t" + algType + "\t" + illType; | ||
} | ||
|
||
//Get Methods | ||
public String getIllType() | ||
{ | ||
return illType; | ||
} | ||
public String getMdPhone() | ||
{ | ||
return mdPhone; | ||
} | ||
public String getMdContact() | ||
{ | ||
return mdContact; | ||
} | ||
public String getAlgType() | ||
{ | ||
return algType; | ||
} | ||
|
||
|
||
//Update Methods | ||
public void updateIllType(String name) | ||
{ | ||
this.illType=name; | ||
} | ||
public void updateMdPhone(String name) | ||
{ | ||
this.mdPhone=name; | ||
} | ||
public void updateMdContact(String name) | ||
{ | ||
this.mdContact=name; | ||
} | ||
public void updateAlgType(String name) | ||
{ | ||
this.algType=name; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
public class TravProf { | ||
private String travAgentID = "a", | ||
firstName = "a", | ||
lastName = "a", | ||
address = "a", | ||
phone = "a", | ||
travelType = "a", | ||
paymentType = "a"; | ||
private float tripCost = 0.0f; | ||
private MedCond medcond; | ||
//TravProf | ||
/* old solution | ||
class TravProf { | ||
private String travAgentID; //ID number of employee that created the profile. | ||
private String firstName; //Traveler’s first name | ||
private String lastName; //Traveler’s last name | ||
private String address; //Traveler’s home address | ||
private String phone; //Traveler’s home phone number | ||
private float tripCost; //Total cost of the trip | ||
private String travelType; //Type of travel, must be either "Pleasure" or "Business" | ||
private String paymentType; //Method of payment, must be either “Credit”, “Check”, “Debit”, or “Invoice” | ||
public MedCond medCondInfo; | ||
public TravProf(String travAgentID, String firstName, String lastName, String address, String phone, float tripCost, String travelType, String paymentType, MedCond medCondInfo){ | ||
this.travAgentID = travAgentID; | ||
this.firstName = firstName; | ||
this.lastName = lastName; | ||
this.address = address; | ||
this.phone = phone; | ||
this.tripCost = tripCost; | ||
this.travelType = travelType; | ||
this.paymentType = paymentType; | ||
this.medCondInfo = medCondInfo; | ||
} | ||
@Override | ||
public String toString() { | ||
return travAgentID + "\t" + firstName + "\t" + lastName + "\t" + address + "\t" +phone + "\t" +tripCost + "\t" +travelType + "\t" +paymentType + "\t" +medCondInfo.toString(); | ||
} | ||
public String getTravAgentID(){ | ||
return travAgentID; | ||
} | ||
public String getFirstName(){ | ||
return firstName; | ||
} | ||
public String getLastName(){ | ||
return lastName; | ||
} | ||
public String getAddress(){ | ||
return address; | ||
} | ||
public String getPhone(){ | ||
return phone; | ||
} | ||
public float getTripCost(){ | ||
return tripCost; | ||
} | ||
public String getTravelType(){ | ||
return travelType; | ||
} | ||
public String getPaymentType(){ | ||
return paymentType; | ||
} | ||
public MedCond getMedCondInfo(){ | ||
return medCondInfo; | ||
} | ||
public void updateFirstName(String firstName) { | ||
this.firstName = firstName; | ||
} | ||
public void updateLastName(String lastName) { | ||
this.lastName = lastName; | ||
} | ||
public void updateAddress(String address) { | ||
this.address = address; | ||
} | ||
public void updatePhone(String phone) { | ||
this.phone = phone; | ||
} | ||
public void updateTripCost(float tripCost) { | ||
this.tripCost = tripCost; | ||
} | ||
public void updateTravelType(String travelType) { | ||
this.travelType = travelType; | ||
} | ||
public void updatePaymentType(String paymentType) { | ||
this.paymentType = paymentType; | ||
} | ||
public void updateMedCondInfo(MedCond medCondInfo) { | ||
this.medCondInfo = medCondInfo; | ||
} | ||
} */ | ||
public TravProf(String newtravAgentID, String newfirstName, String newlastName, String newaddress, String newphone, | ||
String newtravelType, String newpaymentType, float newtripCost, MedCond newmedCondInfo){ | ||
travAgentID = newtravAgentID; | ||
firstName = newfirstName; | ||
lastName = newlastName; | ||
address = newaddress; | ||
phone = newphone; | ||
travelType = newtravelType; | ||
paymentType = newpaymentType; | ||
tripCost = newtripCost; | ||
medcond = newmedCondInfo; | ||
} | ||
|
||
//implementing the get functions of the class | ||
public String gettravAgentID(){ | ||
return travAgentID; | ||
} | ||
public String getFirstName(){ | ||
return firstName; | ||
} | ||
public String getLastName(){ | ||
return lastName; | ||
} | ||
public String getAddress(){ | ||
return address; | ||
} | ||
public String getPhone(){ | ||
return phone; | ||
} | ||
public float getTripCost(){ | ||
return tripCost; | ||
} | ||
public String getTravelType(){ | ||
return travelType; | ||
} | ||
public String getPaymentType(){ | ||
return paymentType; | ||
} | ||
public MedCond getMedCondInfo(){ | ||
return medcond; | ||
} | ||
//implement the update functions of the class | ||
public void updateFirstName(String name){ | ||
firstName = name; | ||
} | ||
public void updateLastName(String name){ | ||
lastName = name; | ||
} | ||
public void updateAddress(String addy){ | ||
address = addy; | ||
} | ||
public void updatePhone(String Phone){ | ||
phone = Phone; | ||
} | ||
public void updateTripCost(String cost){ | ||
tripCost = Float.parseFloat(cost); | ||
} | ||
public void updateTravelType(String travtype){ | ||
travelType = travtype; | ||
} | ||
public void updatePaymentType(String paytype){ | ||
paymentType = paytype; | ||
} | ||
public void updateMedCondInfo(MedCond cond){ | ||
medcond = cond; | ||
} | ||
} |
Oops, something went wrong.