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
Show 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
;
package
com
.
TicketManagement
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
/**
* this class is our passenger's class
*
* @author Mohammad Kazemi
*/
public
class
Passenger
{
public
class
Passenger
{
private
String
name
,
lastname
;
private
String
name
,
lastname
;
private
int
ID
;
private
int
ID
;
private
ArrayList
<
Ticket
>
tickets
;
private
ArrayList
<
Ticket
>
tickets
;
public
Passenger
(
String
name
,
String
lastname
,
int
ID
){
public
Passenger
(
String
name
,
String
lastname
,
int
ID
){
this
.
name
=
name
;
this
.
name
=
name
;
this
.
ID
=
ID
;
this
.
ID
=
ID
;
this
.
lastname
=
lastname
;
this
.
lastname
=
lastname
;
tickets
=
new
ArrayList
<
Ticket
>();
tickets
=
new
ArrayList
<
Ticket
>();
}
}
/**
* this method adds to to list of passenger ticket tickets
* @param ticket
*/
public
void
addTicket
(
Ticket
ticket
){
public
void
addTicket
(
Ticket
ticket
){
tickets
.
add
(
ticket
);
tickets
.
add
(
ticket
);
}
}
/**
*
* @return list of passenger ticket
*/
public
ArrayList
<
Ticket
>
getTickets
()
{
public
ArrayList
<
Ticket
>
getTickets
()
{
return
tickets
;
return
tickets
;
}
}
/**
*
* @return passenger id
*/
public
int
getID
()
{
public
int
getID
()
{
return
ID
;
return
ID
;
}
}
/**
*
* @return passenger name
*/
public
String
getName
()
{
public
String
getName
()
{
return
name
;
return
name
;
}
}
/**
*
* @return passenger lastname
*/
public
String
getLastname
()
{
public
String
getLastname
()
{
return
lastname
;
return
lastname
;
}
}
...
...
src/com/TicketManagement/Seat.java
View file @
d3e53022
package
com
.
TicketManagement
;
package
com
.
TicketManagement
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
/**
* this class indicates a seat and it's features for us
*
* @author Mohammad Kazemi
*/
public
class
Seat
{
public
class
Seat
{
private
int
ID
;
private
int
ID
;
private
String
type
;
private
String
type
;
...
@@ -11,18 +15,34 @@ public class Seat {
...
@@ -11,18 +15,34 @@ public class Seat {
this
.
ID
=
ID
;
this
.
ID
=
ID
;
}
}
/**
*
* @return id of seat
*/
public
int
getID
()
{
public
int
getID
()
{
return
ID
;
return
ID
;
}
}
/**
*
* @return type of seat
*/
public
String
getType
()
{
public
String
getType
()
{
return
type
;
return
type
;
}
}
/**
*this method determines that this passenger will sit on this seat
* @param passenger
*/
public
void
setUser
(
Passenger
passenger
){
public
void
setUser
(
Passenger
passenger
){
user
=
passenger
;
user
=
passenger
;
}
}
/**
*
* @return a passenger sitting on the seat
*/
public
Passenger
getUser
(){
public
Passenger
getUser
(){
return
user
;
return
user
;
}
}
...
...
src/com/TicketManagement/Ticket.java
View file @
d3e53022
...
@@ -17,7 +17,7 @@ public class Ticket {
...
@@ -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
* @param food
*/
*/
public
void
food
(
boolean
food
){
this
.
food
=
food
;}
public
void
food
(
boolean
food
){
this
.
food
=
food
;}
...
@@ -37,10 +37,18 @@ public class Ticket {
...
@@ -37,10 +37,18 @@ public class Ticket {
return
food
;
return
food
;
}
}
/**
*
* @return flightNumber
*/
public
int
getFlightnumber
()
{
public
int
getFlightnumber
()
{
return
flightNumber
;
return
flightNumber
;
}
}
/**
*
* @return seatNumber
*/
public
int
getSeatnumber
()
{
public
int
getSeatnumber
()
{
return
seatNumber
;
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