Warren Lucero wrote:I have an assignment to create an array of Ticket instances a driver named TicketDriverArray and fill in data from the keyboard. Built to handle arrays of unknown size. Cannot seem to get the totalTicketsSold and totalValueTickets to work.
OK, well those last two things don't sound like anything to do with handling an array of unknown size, so I'd forget them for now and concentrate on your problem.
In fact, unless you know that your "array of unknown size" logic is working, I'd set this program aside completely and write a simple test class called UnknownSizeArray that
1. Takes an arbitrary number of Strings (or lines) from the keyboard.
2. Adds them to a String.
3. Prints out the array afterwards.
And don't do anything else until you know that test program works. Every time, and for any number of strings you decide to input.
That allows you to deal with the "array of unknown size" logic in as simple a way as possible, and not get distracted by other stuff.
Once you have your test program working, it should be relatively simple to change your array to a Ticket and enter Ticket information. And once you have THAT working, simply copy the code back to your TicketDriverArray class.
Right now, that class has far too much stuff in it, and you can't see the wood for the trees, so isolate the problem.
If this is not what you mean by an array of an unknown size, then you will need to be clearer as to what your requirements are.
...the problem is that the method returns void. Create another two methods that return the tickets sold and the total value.
It looks like there is another assignment for this module covering unknown size handling. She did state in the homework instructions" Let’s assume that we will not have over 20 Ticket instances so make your program to handle any number of them up to 20 (you do not need to write an increaseSize() method)."
I appreciate everyone help. Sometimes I get hard headed when I stuck on an issue. With a little advice and stepping back to see the big picture helps.