int Swimhours;
int Swimminutes;
int Swimseconds;
int Bikehours;
int Bikeminutes;
int Bikeseconds;
int Runhours;
int Runminutes;
int Runseconds;
int STs;
int BTs;
int RTs;
int Th;
int Tm;
int Ts;
int Overallseconds[3] = { STs, BTs, RTs};
int Totaltime[3] ={Th, Tm, Ts};
The code block above is in the setup() function so these variables will only be available in that function but you actually never use them
Later in the code you declare several variable with the same names so at the best it is confusing.
Much of your code is outside of a function, which is not allowed.
Some of your code lines are not terminated with semicolons.
When I found these problems I stopped looking.
Here is the code Auto Formatted in the IDE and in code tags. The problems noted above become apparent when the code is formatted
void setup()
{
// put your setup code here, to run once:
Serial.begin(9600);
int Swimhours;
int Swimminutes;
int Swimseconds;
int Bikehours;
int Bikeminutes;
int Bikeseconds;
int Runhours;
int Runminutes;
int Runseconds;
int STs;
int BTs;
int RTs;
int Th;
int Tm;
int Ts;
int Overallseconds[3] = { STs, BTs, RTs};
int Totaltime[3] = {Th, Tm, Ts};
}
int Overallseconds[3] = int { ST, BT, RT}; // ST = SwimTime, BT = BikeTime, RT = RunTime
int Swimhours;
Serial.println("enter swim time in hours"); //<<<<< NOT IN A FUNCTION
while (!Serial.available()) //wait for a the user to enter a value
{
}
Swimhours = Serial.parseInt();
Serial.println(Swimhours);
int Swimminutes ;
Serial.println("enter swim time in minutes");
while (!Serial.available()) //wait for a the user to enter a value
{
}
Swimminutes = Serial.parseInt();
Serial.println(Swimminutes);
int Swimseconds ;
Serial.println("enter swim time in seconds");
while (!Serial.available()) //wait for a the user to enter a value
{
}
Swimseconds = Serial.parseInt();
Serial.println(Swimseconds);
Serial.print("Swim Time:");
Serial.print(Swimhours);
Serial.print("hrs");
Serial.print(Swimminutes);
Serial.print("mins");
Serial.print(Swimseconds);
Serial.println("Secs");
STs = (Swimhours / 1) * (60 / 1) * (60 / 1) + Swimminutes * 60 + Swimseconds;
// Assign overall Swimseconds to ST
int Bikehours ;
Serial.println("enter bike time in hours");
while (!Serial.available()) //wait for a the user to enter a value
{
}
Bikehours = Serial.parseInt();
Serial.println(Bikehours);
int Bikeminutes ;
Serial.println("enter bike time in minutes");
while (!Serial.available()) //wait for a the user to enter a value
{
}
Bikeminutes = Serial.parseInt();
Serial.println(Bikeminutes);
int Bikeseconds ;
Serial.println("enter bike time in seconds");
while (!Serial.available()) //wait for a the user to enter a value
{
}
Bikeseconds = Serial.parseInt();
Serial.println(Bikeseconds);
Serial.print("Bike Time:");
Serial.print(Bikehours);
Serial.print("hrs");
Serial.print(Bikeminutes);
Serial.print("mins");
Serial.print(Bikeseconds);
Serial.println("secs");
BTs = (Bikehours / 1) * (60 / 1) * (60 / 1) + Bikeminutes * 60 + Bikeseconds;
int Runhours ;
Serial.println("enter run time in hours");
while (!Serial.available()) //wait for a the user to enter a value
{
}
Runhours = Serial.parseInt();
Serial.println(Runhours);
int Runminutes ;
Serial.println("enter enter run time in minutes");
while (!Serial.available()) //wait for a the user to enter a value // code noting hours minutes and seconds in swim bike and run events
{
}
Runminutes = Serial.parseInt();
Serial.println(Runminutes);
int Runseconds ;
Serial.println("enter run time in seconds");
while (!Serial.available()) //wait for a the user to enter a value
{
}
Runseconds = Serial.parseInt();
Serial.println(Runseconds);
Serial.print("Run Time:");
Serial.print(Runhours);
Serial.print("hrs");
Serial.print(Runminutes);
Serial.print("mins");
Serial.print(Runseconds);
Serial.println("secs");
RTs = (Runhours / 1) * (60 / 1) * (60 / 1) + Runminutes * 60 + Runseconds;
}
int Totaltime[6] = {Th, Tm, Ts}; // Th = Totalhours , Tm = Totalminutes, Ts = Totalseconds
Th = Swimhours + Bikehours + Runminutes //<<<<MISSING SEMICOLON. Th DECLARED ONLY IN setup()
Tm = Swimminutes + Bikeminutes + Runminutes
Ts = Swimtimes + Biketimes + Runtimes
Totalhours = Th
Totalminutes = Tm
Totalseconds = Ts
Serial.print("Total time:");
Serial.print(Totalhours);
Serial.print("hrs");
Serial.print(Totalminutes);
Serial.print("mins");
Serial.print(Totalseconds);
Serial.print("secs");
//Start of Functions
;
}
void printing(int Swimhours, int Swimminutes, int Swimseconds, int Bikehours, int Bikeminutes, int Bikeseconds, int Runhours, int Runminutes, int Runseconds, int Totalhours, int Totalminutes, int Totalseconds)
{
Serial.print("Total time:");
Serial.print(Totalhours);
Serial.print("hrs");
Serial.print(Totalminutes);
Serial.print("mins");
Serial.print(Totalseconds);
Serial.print("secs");
}