I need to store 25 different arrays with position one being the name of the person and the rest of the indexs as a int to do math operations. I have a String arrray[25][53]. How do I make array[0-25][1-52] an integer? I assuming with .parseInt but Im not really sure how they work considering I am still learning java.
String[][] volunteerNamesAndHours = new String [25][53];
int ID = 0;
int week;
do{
volunteerNamesAndHours[ID][NAME] = input.next();
for(week = 1; week < 53; week++){
volunteerNamesAndHours[ID][week] = Integer.parseInt(null, ID);
EDIT: I would use OOP or a map but considering we havent got that far in the course I don't want to over step my boundaries and making my professors mad. I know it is not the most intuitive but this what I ended up coming up with any body see a problem?
public static String[][] getvolunteerChart(Scanner input){
String[][] volunteerNamesAndHours = new String [25][53];
int ID = 0;
int week;
do{
volunteerNamesAndHours[ID][NAME] = input.next();
for(week = 1; week < 53; week++){
volunteerNamesAndHours[ID][week] = Integer.toString(input.nextInt());
}
ID++;
}
while(ID <= 24);
return volunteerNamesAndHours;
}