Andrew S
Stunt Coordinator
- Joined
- Sep 30, 2001
- Messages
- 214
If this is in the wrong forum I apologize, but I've seen other homework-related threads in here.
My program has to do with sports stats. The user will enter a game's results in the format:
team1,team2,score1,score2,
E.g.
blue,red,11,16,
I need to write a function that reads this input and returns the values for team1, team2, score1, score2 as four strings.
I know how to separate each part of the string, I just can't for the life of me figure out how to send and modify/return strings within a function. I could do it outside the function, but this will be repeated for 28 games and the use of a function is part of the assignment.
If anyone can point me towards an example on the internet or could help me out here, it would be greatly appreciated.
Thanks,
Andrew
My program has to do with sports stats. The user will enter a game's results in the format:
team1,team2,score1,score2,
E.g.
blue,red,11,16,
I need to write a function that reads this input and returns the values for team1, team2, score1, score2 as four strings.
I know how to separate each part of the string, I just can't for the life of me figure out how to send and modify/return strings within a function. I could do it outside the function, but this will be repeated for 28 games and the use of a function is part of the assignment.
If anyone can point me towards an example on the internet or could help me out here, it would be greatly appreciated.
Thanks,
Andrew