Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
IntegratedTravelSystem/TravProf.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
176 lines (155 sloc)
5 KB
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
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; | |
} | |
} |