SittingCar
o1.train.SittingCar
class SittingCar(val
numberOfRows
: Int, val seatsPerRow
: Int) extends TrainCar
The class SittingCar
represents passenger cars with seats in a train ticket reservation system. Each sitting car has rows of seats, which are numbered starting from one upwards. Each row has a number of seats, identified by letters starting from 'a'.
When created, all the seats in a sitting car are unreserved. This changes as reservations are made.
In this simple implementation, no data is stored about who has reserved which seat.
Parameters
- numberOfRows
-
the number of seat rows in the car
- seatsPerRow
-
the number of seats in each row
Attributes
- Supertypes
Members list
Inherited
Not inherited +1
- Not inherited
- TrainCar