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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents