Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
Lab7
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9731050
Lab7
Commits
d3e53022
Commit
d3e53022
authored
May 01, 2019
by
9731050
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
second
parent
0a28a80b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
3 deletions
+57
-3
Passenger.java
src/com/TicketManagement/Passenger.java
+27
-1
Seat.java
src/com/TicketManagement/Seat.java
+21
-1
Ticket.java
src/com/TicketManagement/Ticket.java
+9
-1
No files found.
src/com/TicketManagement/Passenger.java
View file @
d3e53022
package
com
.
TicketManagement
;
import
java.util.ArrayList
;
/**
* this class is our passenger's class
*
* @author Mohammad Kazemi
*/
public
class
Passenger
{
private
String
name
,
lastname
;
private
int
ID
;
private
ArrayList
<
Ticket
>
tickets
;
public
Passenger
(
String
name
,
String
lastname
,
int
ID
){
this
.
name
=
name
;
this
.
ID
=
ID
;
this
.
lastname
=
lastname
;
tickets
=
new
ArrayList
<
Ticket
>();
}
/**
* this method adds to to list of passenger ticket tickets
* @param ticket
*/
public
void
addTicket
(
Ticket
ticket
){
tickets
.
add
(
ticket
);
}
/**
*
* @return list of passenger ticket
*/
public
ArrayList
<
Ticket
>
getTickets
()
{
return
tickets
;
}
/**
*
* @return passenger id
*/
public
int
getID
()
{
return
ID
;
}
/**
*
* @return passenger name
*/
public
String
getName
()
{
return
name
;
}
/**
*
* @return passenger lastname
*/
public
String
getLastname
()
{
return
lastname
;
}
...
...
src/com/TicketManagement/Seat.java
View file @
d3e53022
package
com
.
TicketManagement
;
import
java.util.ArrayList
;
/**
* this class indicates a seat and it's features for us
*
* @author Mohammad Kazemi
*/
public
class
Seat
{
private
int
ID
;
private
String
type
;
...
...
@@ -11,18 +15,34 @@ public class Seat {
this
.
ID
=
ID
;
}
/**
*
* @return id of seat
*/
public
int
getID
()
{
return
ID
;
}
/**
*
* @return type of seat
*/
public
String
getType
()
{
return
type
;
}
/**
*this method determines that this passenger will sit on this seat
* @param passenger
*/
public
void
setUser
(
Passenger
passenger
){
user
=
passenger
;
}
/**
*
* @return a passenger sitting on the seat
*/
public
Passenger
getUser
(){
return
user
;
}
...
...
src/com/TicketManagement/Ticket.java
View file @
d3e53022
...
...
@@ -17,7 +17,7 @@ public class Ticket {
}
/**
* this method determines whether or not we
receive a ticket for
* this method determines whether or not we
want a ticket for food
* @param food
*/
public
void
food
(
boolean
food
){
this
.
food
=
food
;}
...
...
@@ -37,10 +37,18 @@ public class Ticket {
return
food
;
}
/**
*
* @return flightNumber
*/
public
int
getFlightnumber
()
{
return
flightNumber
;
}
/**
*
* @return seatNumber
*/
public
int
getSeatnumber
()
{
return
seatNumber
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment