Question: CODING USING DR RACKET. Myles is obsessed with the Buffalo Beauts. He keeps data of all the players on the team in a text file.
CODING USING DR RACKET.
Myles is obsessed with the Buffalo Beauts. He keeps data of all the players on the team in a text file. Information on each player is stored as different lines in his text file. Each line is a string formatted as:
1. The jersey number of the player which is either a single or double digit number.
2. The position they play of either "forward", "defenseman", and "goalie".
3. The average annual salary of the player as a number in brackets.
4. Each of the 3 pieces of data is separated by a comma (",") and nothing else.
As an example, the player Lisa Chesson has the jersey number 30, plays goalie, and has an average annual salary of $634000. Information on this player is stored as the string
"30,goalie,(634000)"
Myles has asked Katie to write a program to read in each line to do some team analysis. Since no contract was established, Katie just assumed her program would read in lines where a space would separate pieces of data instead of commas and no data would be in brackets. As an example, Katie's program would accept the string
"30 goalie 634000"
Write a function data-change that consumes a string that is a line from Myles' text file and produces a string that can be used as input in Katie's program.
CODING USING DR RACKET.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
