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 an xml file with markup tags

Create an XML file with markup tags and some sample data to represent a list of invoices. Include the XML tags for two invoices in the list.

  Program to tests whether a word or phrase is a palindrome

The choice of page elements (e.g., test boxes, buttons, text areas) and their layout is up to you, but the overall design should be intuitive and user friendly.

  Design bank account class with data members-member functions

Design the Bank Account class with suitable data members and member functions - think of attributes or features of a bank account - think of kind of data (and actions) you require to open account.

  Report on a seminar or webinar

A report must be written regarding a seminar or webinar. Describe the key points of the seminar or webinar.

  Program to read employee information into array of objects

Consider a program that will read employee information into an array of objects, sort the array by employee identification number, write out the sorted array.

  Top-down recursive descent parser

Write a hand-coded top-down recursive descent parser.

  Create a rexx program

Create a REXX program that asks a user for four separate lines of input, and then outputs those lines all at once, one line at a time

  Write program which inputs the string from user

Write a program which inputs the string from a user. Then it will take character as input and prints string onwards from that character.

  Write program using array to show fifo queue

Write program using any language which uses the array to demonstrate simple FIFO queue with 10 job entering the queue and 5 jobs removed from the queue by the server.

  Create application to read file containing same product id

Create the application which reads the file of inventory information comprising product ID and quantity. File can contain numerous entries for same Product ID.

  Formulate integer programming model for permanent operators

Company wishes to know number of permanent and temporary operators to hire to minimize costs. Formulate an integer programming model for this problem and solve it by using the computer.

  Do not represent the date as a string show how the given

describe two different ways to represent a birthday register i.e. the names of your friends and their birth dates.

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