Design and code a program including the given classes

Assignment Help Programming Languages
Reference no: EM131274269

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: ... For instance, the file could contain: James 1 Ben 2 Suri 1 Sarah 1 Jane 2 ... You should include the following methods in your Train class: a. a method returning the percentage of passengers traveling in first class b. a method taking two parameters representing the price of traveling in first and second class and returning the total revenue for the train c. a method checking if a certain person is on the train; if he/she is, the method returns true; otherwise, it returns false Turn in the Passenger class, the Train class, the TrainClient class, and the output. Clamp all into a folder in proper order: project assignment, source and output. Make sure each class has the proper documentation at the top and a documentation.

Reference no: EM131274269

Questions Cloud

Ensure that systems and processes : You have been asked develop strategies to ensure that systems and processes and used to monitor operational progress and to identify ways in which planning and operations could be improved.
What is the product of the numbers : Three distinct prime numbers, less than 10 are taken and all the numbers that can be formed by arranging all the digits are taken. Now, difference between the largest and the smallest number formed is equal to 495. It is also given that sum of the di..
Program that plays a commercial video continuously : Determine the type of loop that you would use in your program in order to make the video play continuously. Provide a rationale for your chosen type of loop.
Prepare a draft annotated bibliography : Prepare a draft annotated bibliography. Select a topic, preferably one of your topic interest areas you may pursue for your dissertation. Select 10 articles for the bibliography. The bibliography must have 10 entries critically analyzed, to includ..
Design and code a program including the given classes : 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.
Write a progra whether a number is prime : Write a progra whether a number isPrime(int number) method for testing whether a number is prime. Use this method to find the number of prime numbers less than 10000.
Interface for interaction with the operating system : As explained in the textbook, UNIX / Linux initially only provided a command line interface for interaction with the operating system (OS). The introduction of a Graphical User Interface (GUI) to UNIX / Linux OS makes it easier to administer a Lin..
Design a program that asks the user to enter the amount : Design a program that asks the user to enter the amount that he or she has budgeted for a month. Use labels to list expediencies and text boxes to hold the expense (such as housing, entertainment, fuel, power, misc, etc).
Rewrite the given topic in the english language : HMGT 310 - Rewrite the given topic-A growing pol of patients is unable to read and write in the English language. Language is a barrier to effective care delivery as well as patient compliance.

Reviews

Write a Review

Programming Languages Questions & Answers

  Create inheritance hierarchy containing base class

Create an inheritance hierarchy containing base class Account and derived classes SavingsAccount and CheckingAccount that inherit from class Account.

  Create a script file that generates a row vector

Create a script file that generates a row vector of 10 random numbers from 5 to 15 - Call your function using your array of random numbers and the scalar value of 22.

  Benefits of validating the forms

When you are collecting data, you need to consider what data to collect, why you are collecting the data. What are other benefits of validating your forms? How are forms validated? What are some form validation best practices?

  Define console programming and gui programming

Define Console Programming and GUI Programming

  Create uml collaboration diagrams by using microsoft visio

Create UML collaboration diagrams by using Microsoft Visio or another drawing tool capable of preparing properly formatted UML collaboration diagrams.

  Compare the points by y major order

Compare the Points by y major order, that is, points with similar y-coordinate values should come before those with higher y coordinate values. Break ties by comparing x-coordinate values.

  Template that computes and displays the absolute value

Create a program that uses this function template, passing in two arguments of type int, float, and double variable.

  Develop a unit converter to convert both force

Decided on a topic requiring a computer application that includes Excel programming features. Begin the layout and basic structure of the project in class today by laying out tables, equations, user input and output. Try to complete the brainstorm..

  Create program to calculate and display number of miles

Create a program to calculate and displays the number of miles per hour over the speed limit that a speeding driver was doing. The program should ask for the speed limit and the drivers speed.

  Program to create professor rating class

Write down program to create Professor Rating class comprising of professor ID and three ratings. Three ratings are utilized to estimate easiness.

  Prepare a php form which allows input for an individual and

create a php form that allows input for an individual and displays the information on a subsequent page upon

  Create useful and well-designed programs

Create useful and well-designed programs that use subroutines, functions, menus, dialog boxes, and other related form objects to solve practical business problems.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd