Winston Gutkowski wrote:
Zach Christian wrote:I have a Country class, so how would I pass my Scanner into that? Can you show me?
Sure:Hopefully you get the idea..,
Another tip: Class names should generally be singular. And if you absolutely must make it plural, then call it 'Countries'. You don't have to forget good spelling just because you're writing a program.
HIH
Winston
Carey Brown wrote:
Zach Christian wrote:
Carey Brown wrote:A simple, non-OO way, would be to create a second array to contain the medalCount.
how would I reference the 2 arrays? Say user inputs "Germany" as the country and 1,2,3 for the gold/silver/bronze medals. How would one tie Germany to the number of medals to do a comparison of the other countries?
I don't think a HashMap (per Knute) is appropriate because you'll have to output the countries in the order that they were entered in the event of a tie. An ArrayList would be a better choice.
Carey Brown wrote:A simple, non-OO way, would be to create a second array to contain the medalCount.
A more OO way would be to create a Country class with fields name and medalCount and have an array of those.
fred rosenberger wrote:What - EXACTLY - are you doing to get this error? What have you done?
Zach Christian wrote:
Keith Lynn wrote:I'm not sure which tool you're using, but do you mean in your setup where you have Value: , the Path there is defined as C:\Program Files\Java\jdk1.7.0_25\bin? If so, you have an extra /bin in your path.
Tool? I am just using the Windows System Properties > Environment Variables.
Keith Lynn wrote:I'm not sure which tool you're using, but do you mean in your setup where you have Value: , the Path there is defined as C:\Program Files\Java\jdk1.7.0_25\bin? If so, you have an extra /bin in your path.