Results 1 to 7 of 7
- 01-07-2008, 01:58 PM #1
Member
- Join Date
- Dec 2007
- Posts
- 13
- Rep Power
- 0
please help .................................................. ..
hi every one here
save fligth
public class Flight {
private int fligthID;
private String fligthSource;
private String fligthDestination;
private int numOfSeats;
private char[][] seatsPlane;
private int sequance;
private Reservation[] reservation;
public Flight() {
}
//setters
public void setFligthID(int fligthID){
this.fligthID = fligthID;
}
public void setFligthDestination(String fligthDestination){
this.fligthDestination = fligthDestination;
}
public void setFligthSource(String fligthSource){
this.fligthSource = fligthSource;
}
public void setnumOfSeats(int numOfSeats){
this.numOfSeats = numOfSeats;
}
public void setseatsPlane(char[][] seatsPlane){
this.seatsPlane = seatsPlane;
}
public void setsequance(int sequance){
this.sequance = sequance;
}
public void setReservation(Reservation[] reservation){
this.reservation = reservation;
}
//getters
public int getFligthID(){
return fligthID;
}
public String getFligthDestination(){
return fligthDestination;
}
public String getFligthSource(){
return fligthSource;
}
public int getNumOfSeats(){
return numOfSeats;
}
public char[][] getSeatsPlane(){
return seatsPlane;
}
public int getSequance(){
return sequance;
}
public Reservation[] getReservation(){
return reservation;
}
//toString
public String toString(){
return fligthID+" "+fligthDestination+" "+fligthSource+" "+numOfSeats+" "+seatsPlane+" "+sequance+" "+reservation;
}
//bolean
public boolean equals(Flight c){
return (fligthID==c.fligthID) && (fligthDestination==c.fligthDestination) && (fligthSource==c.fligthSource) && (numOfSeats==c.numOfSeats) && (seatsPlane==c.seatsPlane) && (sequance==c.sequance) && (reservation==c.reservation);
}
save fligth
public int saveFligth(){
}
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >> >>>>>
save passenger
public class Passenger {
private int PassengerID;
private String name;
private String mobile;
private Reservation[] reservation;
public Passenger() {
}
//getters
public int getPassengerID(){
return PassengerID;
}
public String getName(){
return name;
}
public String getMobile(){
return mobile;
}
public Reservation[] getReservation(){
return reservation;
}
//setters
public void setPasnengerID(int PassengerID){
this.PassengerID = PassengerID;
}
public void setName(String name){
this.name = name;
}
public void setMobile(String mobile){
this.mobile = mobile;
}
public void setReservation(Reservation[] reservation){
this.reservation = reservation;
}
//toString
public String toString(){
return PassengerID+" "+name+" "+mobile+" "+reservation;
}
//boolean
public boolean equals(Passenger d){
return (PassengerID==d.PassengerID)&&(name==d.name)&&(mob ile==d.mobile)&&(reservation==d.reservation);
}
}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< << <<<<<<
public class Reservation {
private int rservationNumber;
private char[] arrayOfSeats;
private Flight flight;
private Passenger passenger;
public Reservation() {
}
//setters
public void setRservationNumber(int rservationNumber){
this.rservationNumber = rservationNumber;
}
public void setArrayOfSeats(char[] arrayOfSeats){
this.arrayOfSeats = arrayOfSeats;
}
public void setFlight(Flight flight){
this.flight = flight;
}
public void setPassenger(Passenger passenger){
this.passenger = passenger;
}
//getters
public int getRservationNumber(){
return rservationNumber;
}
public char[] getArrayOfSeats(){
return arrayOfSeats;
}
public Flight getFlight(){
return flight;
}
public Passenger getPassenger(){
return passenger;
}
//toString
public String toString(){
return rservationNumber+" "+arrayOfSeats+" "+flight+" "+passenger;
}
//boolean
public boolean equals(Reservation x){
return (rservationNumber==x.rservationNumber) && (arrayOfSeats==x.arrayOfSeats) && (flight==x.flight) && (passenger==x.passenger);
}
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >
plese see the attatch and sole the
saveflight, passenger, resrevation
get flight object, passenger object and reservation object
thanks
- 01-07-2008, 02:04 PM #2
What's your question or problem?
- 01-07-2008, 02:31 PM #3
Member
- Join Date
- Dec 2007
- Posts
- 13
- Rep Power
- 0
i hava not any idea about
saveflight, passenger, resrevation
get flight object, passenger object and reservation object
see atach plesea and solve them plesea
- 01-07-2008, 03:01 PM #4
The idea of the forums is to help with problems not to do the homework or assignments for you :) Start with the easiest one - saveFlight() your assignment says save the details in a file called Flight.txt. SaveFlight will be passed a Flight object, it has getters that will enable you to retrieve the state of the object, you then store these values in a file using java.io ( or if you have seen it yet serialisation) How you store them is up to you, maybe just read each value and write it to the file in turn. You can check if it works by looking at the file. Once that work you should be well on the way to savePassenger and saveReservation as they are similar.
Shout if you get problems and post code that is causing you problems.Last edited by jelly; 01-07-2008 at 03:11 PM.
-- Hope that helps
- 01-07-2008, 03:29 PM #5
Jelly gave you some good tips to get you started, and I hope you take note of them - for your own sake. Your attachment's detailed instructions lay everything out for you. Get started - January 11th is not that far away.
Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
Want to voice your opinion on your IDE/Editor of choice? Vote now!
Got a little Capt'n in you? (drink responsibly)
- 01-07-2008, 04:55 PM #6
Member
- Join Date
- Dec 2007
- Posts
- 13
- Rep Power
- 0
no body will help me :(
the project very important for me if i will not do it i will Proceed :(
plesae help me
i will not forget that for you
this is not Humane :(
- 01-07-2008, 05:03 PM #7
We can only help you if you've helped yourself. It's your course, it's your homework. Posting a complete answer for you to turn in is what's not humane, how do you expect to develop your programming skills? by retrieving answers from others? Make a valid attempt at your work, if you get stuck - we'd be glad to help. It's not that difficult to understand, if it's important to you I suggest you do it.
Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
Want to voice your opinion on your IDE/Editor of choice? Vote now!
Got a little Capt'n in you? (drink responsibly)


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks