Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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:

Passenger class, encapsulating a passenger. A passenger has two attributes: a name, and a class of service, which will be 1 or 2.

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 calledpassengers.txt (that you would create). 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 the 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.

Sorry if it is disorganized or ugly. The box where you type this in isn't the greatest. Anyways thanks in advance! J

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9887465

Have any Question?


Related Questions in Computer Engineering

Aa stock will pay dividends of 3 4 and 9 over the next

aA stock will pay dividends of $3, $4, and $9 over the next three years, and then increase dividends at a rate of 3% afterwards. Its required rate of return is 15%. What is the value of the stock? Round to the penny.

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Question what is the relation between virtual memory a

Question : What is the relation between virtual memory, a memory map, physical memory and swapping to secondary memory? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Research the group members identified in the video hackers

Research the group members identified in the video "Hackers: Operation Get Rich or Die Tryin'"-Albert Gonzalez, Stephen Watt, Damon Patrick Toey, Humza Zaman, and Christopher Scott. Pick a member of the gang and describe ...

Mccann co has identified an investment project with the

McCann Co. has identified an investment project with the following cash flows. Year Cash Flow  1     $800   2    1,090   3    1,350   4    1,475  a. If the discount rate is 7 percent, what is the present value of these c ...

Suppose that the wall street journal reports that we are

Suppose that the Wall Street Journal reports that we are headed for a recession. You are the manager of a firm that produces Starcho Lunch. Your marketing research people tell you that the demand for your product is give ...

Can someone please show me how to do this step by step

Can someone please show me how to do this step by step please. I dont understand any of it 1.) Add a new virtual disk a) Edit VMware player settings to add a new virtual hard disk. b) Start or reboot the virtual machine ...

Discuss the importance of using an access control model in

Discuss the importance of using an access control model in determining how employees in an organization should gain access to resources.

Stacksthere are two main operations associated with stacks1

Stacks There are two main operations associated with stacks; 1) putting things on the stack which is referred to as push, 2) taking things from the stack which is referred to as pop. We can create a stack using linked li ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As