subject

Design and code a program including the following classes, as well as a client class to test all the methods coded: a passenger class, encapsulating a passenger. a passenger has two attributes: a name, and a class of service, which will be 1 or 2.a train class, encapsulating a train of passengers. a train of passengers has one attribute: a list of passengers, which must be represented with an arraylist. your constructor will build the list of passengers by reading data from a file called passengers. txt. you can assume that passengers. txt has the following format: instance, the file could contain: james 1ben 2suri 1sarah 1jane should include the following methods in your train class:
a method returning the percentage of passengers traveling in first class
a method taking two parameters representing the price of traveling in first and second class and returning the total revenue for the train
a method checking if a certain person is on the train; if he/she is, the method returns true; otherwise, it returns false

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:40
Amain idea is supported, explained, or expanded on with a numbers b. a concluding statement c. details d. a topic sentence. im e paragraphs reset nex next
Answers: 2
question
Computers and Technology, 22.06.2019 06:20
In what kind of attack can attackers make use of millions of computers under their control in an attack against a single server or network availability confidentiality integrity identity automated attack software? those who wrongfully disclose individually identifiable health information can be fined up to what amount per calendar year? single most expensive malicious attack hipaa what are script kiddies? advanced persistent threat security manager security engineer what level of security access should a computer user have to do their job what process describes using technology as a basis for controlling the access and usage of sensitive data? cybercriminal
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
Melissa needs to add a topic to an email that she will send to her teacher. choose the name of the field where she should type her topic.
Answers: 2
question
Computers and Technology, 22.06.2019 22:20
Avariable of the data type arrays is storing 10 quantities. what is true about these quantities? a. the quantities all have different characteristics. b. the quantities all have the same characteristics. c. five quantities have the same and five have different characteristics. d. it is necessary for all quantities to be integers. e. it is necessary for all quantities to be characters.
Answers: 2
You know the right answer?
Design and code a program including the following classes, as well as a client class to test all the...
Questions
question
Mathematics, 16.04.2021 19:30
question
Mathematics, 16.04.2021 19:30
question
Mathematics, 16.04.2021 19:30
question
Mathematics, 16.04.2021 19:30
question
Mathematics, 16.04.2021 19:30
question
Mathematics, 16.04.2021 19:30
question
Mathematics, 16.04.2021 19:30
question
Social Studies, 16.04.2021 19:30
Questions on the website: 13722363