This is for an assignment, I'm not asking for answer answers/code to help me out but a point in the right direction would help me greatly.
I have approximately 250 lines of data (olypics data) that I want to load into a constructor and then make an array of said object.
The data about olympic games is just a basic 5 column setup of:
Year, Nation, Gold, Silver, Bronze
1992,Unified_Team,45,38,29
1992,United_States,37,34,37
1992,Germany,33,21,28
1992,China,16,22,16
1992,Cuba,14,6,11 <<--output from excel into csv format
and I want to load said data into my constructor
public POlympics(int year, String nation, int gold, int silver, int bronze)
{
this.year = year;
this.nation = nation;
this.gold = gold;
this.silver = silver;
this.bronze = bronze;
}
My problem is, the data if output in csv format...must be loaded as strings into the array (whereas I want the year,gold,silver,bronze as integers for basic calculations in other methods).
What are some simpler ways to load my data into the constructor + array? (without having to make them all strings, then convert them all to ints or floats, and lose marks for it). Alternatives to CSV format which mean I won't have to mess about with Integer.parseInt etc
Cheers :)