SYSC 2004 Lecture 4: Seat
Document Summary
* seat models a seat in a car in a passenger train. * @version 1. 1 september 27, 2017 public class seat private int number; // the seat"s number private boolean booked; // has this seat been reserved? private double price; // the cost of a ticket for this seat, in dollars. * constructs a new seat with the specified seat number and. * @param seatno the number of the seat. * @param cost the cost of a ticket for this seat, in dollars. public seat(int seatno, double cost) booked = false; number = seatno; price = cost; * returns the cost of purchasing a ticket for this seat. * @return cost of purchasing a ticket for this seat, in dollars. public double price() return price; * @return the number of this seat. public int number() return number; * returns true if someone has purchased a ticket.