Storing Hours, minuites and seconds in an array?

Hi, I currently have an assignment where I have to collect the time of 3 events (swimming, biking and running) and store them and their overall total in an array. Part of the assignment requires me to convert the times to seconds and then use division and modulus to build them back up in the array. However, my codes not working, this is what I have so far:

long Bike = 0;
long Run = 0;
long Swim = 0;
long total = 0;

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);

//swimming
Serial.println("Swimming Details- ");

Serial.println(“how many hours?”);
int swim_hours;
while (!Serial.available()) {
//wait for a user to enter a value
;
}
swim_hours = Serial.parseInt();

Serial.println(“how many minuites?”);
int swim_mins;
while (!Serial.available()) {
;
}
swim_mins = Serial.parseInt();

Serial.println(“how many seconds?”);
int swim_secs;
while (!Serial.available()) {
;
}
swim_secs = Serial.parseInt();

//biking
Serial.println();
Serial.println("Biking Details- ");
Serial.println(“how many hours?”);
int bike_hours;
while (!Serial.available()) {
//wait for a user to enter a value
;
}
bike_hours = Serial.parseInt();

Serial.println(“how many minuites?”);
int bike_mins;
while (!Serial.available()) {
;
}
bike_mins = Serial.parseInt();

Serial.println(“how many seconds?”);
int bike_secs;
while (!Serial.available()) {
;
}
bike_secs = Serial.parseInt();

//running
Serial.println();
Serial.println("Running Details- ");

Serial.println(“how many hours?”);
int running_hours;
while (!Serial.available()) {
//wait for a user to enter a value
;
}
running_hours = Serial.parseInt();

Serial.println(“how many minuites?”);
int running_mins;
while (!Serial.available()) {
;
}
running_mins = Serial.parseInt();

Serial.println(“how many seconds?”);
int running_secs;
while (!Serial.available()) {
;
}
running_secs = Serial.parseInt();
Serial.println();

//converted to seconds
Swim = swim_hours * 3600 + swim_mins *60 + swim_secs;
Run = running_hours * 3600 + running_mins *60 + running_secs;
Bike = bike_hours * 3600 + bike_mins * 60 + bike_secs;
total = Run + Swim + Bike;

//array of events
String NamesArray = {"Swim Time: ", "Bike Time: ", "Run Time: ", "Total Time: "};

int SecondsArray[4];
SecondsArray[1] = Swim;
SecondsArray[2] = Bike;
SecondsArray[3] = Run;
SecondsArray[4] = total;

int i = 0;//creating variable i
for(i=0;i<4;i++){//if i is less than 4 increment i by 1
Serial.println(NamesArray + (SecondsArray / 3600) + "hr " + ((SecondsArray / 60) % 60) + "min " + (SecondsArray % 60) + “sec.”);//matching names array with data to display in array
}

}

Swim = swim_hours * 3600 + swim_mins *60 + swim_secs;

swim_hours is an int. 3600 is an int. Integer multiplication happens. That might be causing overflow.

int SecondsArray[4];
SecondsArray[1] = Swim;
SecondsArray[2] = Bike;
SecondsArray[3] = Run;
SecondsArray[4] = total;

Swim, Bike, Run, and total are longs. Why are you storing them in an int array?

However, my codes not working

I'm sure that it is working. It's just not doing what you expect. Of course, what it actually does, and how that differs from what you want, is a mystery.

Please read the sticky notes at the top of the Forum. The notes by Nick Gammon tell you the proper way to post to this Forum, which makes it easier for us to help you.