Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Each part is unrelated Part 1 Write a class (and a client class to test it) that

ID: 3533592 • Letter: E

Question


Each part is unrelated

Part 1

            Write a class (and a client class to test it) that encapsulates the evolution of the sales tax rates in the 50 U.S states over the last 10 years. Your only instance variable should be a two-dimensional array of values representing the sales tax rates. Dimension 1 represents the state and dimension2 represents the year. Your constructor can simply be a default constructor, randomly generating the sales tax rates, which should be between 0 and 0.06. You should include the following methods:

a.       A method returning the index of the state that has the biggest average tax rate over the years.

b.      A method returning an array of indexes of the states that have had at least one year with a tax rate less than 0.001

c.       A method returning the highest sales tax rate over the years for a given state (which will be a parameter)

Part 2

1.      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 date from a file called passengers.txt (that you would create). You can assume that passengers.txt has the following format:

<name1>         <class1>

<name2>         <class2>

Explanation / Answer

http://forums.devshed.com/java-help-9/mutli-dimensional-arrays-934070.html

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote