This assignment is similar to #2 except
Input:
Team same as Programming Assignment #2 although there may be different data.
Command This is different from the previous assignment. The file contains text in the form of commands:
GAME RESULT szTeamId1 szTeamId2 iScore1 iScore2
This should use processGame to process this
GAME FIX szTeamId1 szTeamId2 iOldScoreTeam1 iOldScoreTeam2 iNewScore1 iNewScore2
if the winner changes:
- decrement the old winner's iWin the old loser's iLoss
- increment the new winner's iWin the new loser's iLoss
Otherwise, don't change the wins and losses.
This functionality should be placed in the processGameFix function.
If a team doesn't exist, show a warning.
TEAM PAID szTeamId dAmount
Add the amount to this team's dPaidAmount. If the team doesn't exist,
show a warning.
TEAM SHOW szTeamId
Show all the team information for this one team. If the team doesn't exist,
show a warning.
Larry provided:
cs1713p3_h.txt - include file for program #3; please rename it to cs1713p3.h
cs1713p3Driver_c.txt - driver C file which will invoke some of your functions; please rename to cs1713p3Driver.c
p3abc123_c.txt - skeletal code which you must modify; please rename to p3abc123.c using your abc123 ID.
p3Command.txt - command input file
p3Team.txt - team data input file
Driver program (cs1713p3Driver.c):
You will be provided with a driver program, cs1713p3Driver.c, which
1. invokes the driver's processCommandSwitches
2. invokes your getTeams (in p3abc123.c) to read the original team information.
3. invokes printTeams (in p3abc123.c) to print the original team information
4. invokes your sortTeams (in p3abc123.c) to sort the original team information
5. invokes printTeams to print the sorted team information
6. invokes a driver-provided processCommands which
o reads input lines from the command file until eof:
7. invokes printTeams to print the resulting team information
Your p3abc123.c code:
#include < stdio.h>
#include < string.h>
#include "cs1713p3.h"
Sample Output (partial):
Initial Teams
Id Team Name Wins Loss Fee Amt Paid Amt
Contact Name Phone Email
UTSA01 Armadillos 8 0 150.00 80.00
Jean E Us (210)555-1111 utsa@xyz.com
COM001 Comm Eagles 7 1 150.00 75.00
Mae King (210)555-2222 maeking@xyz.com
SOUTH1 Slam Dunk 5 3 120.00 75.00
Jerry Tall (210)555-3333 slamdunk@gmail.com
ALHGHT Cake Eaters 4 4 175.00 100.00
E Z Street (210)555-6666 sliverspoon@xyz.com
UNKN01 Org New Blk 1 7 150.00 50.00
Bob Wire (210)555-1234 bobwire@xyz.com
NEWB01 River Rats 0 8 120.00 75.00
Rock D Boat (210)555-4444 riverrat@xyz.com
UNKN02 Hackers 3 5 150.00 75.00
Tom E Gunn (210)555-5555 cyber@gmail.com
Sorted Teams
Id Team Name Wins Loss Fee Amt Paid Amt
Contact Name Phone Email
ALHGHT Cake Eaters 4 4 175.00 100.00
E Z Street (210)555-6666 sliverspoon@xyz.com
COM001 Comm Eagles 7 1 150.00 75.00
Mae King (210)555-2222 maeking@xyz.com
NEWB01 River Rats 0 8 120.00 75.00
Rock D Boat (210)555-4444 riverrat@xyz.com
SOUTH1 Slam Dunk 5 3 120.00 75.00
Jerry Tall (210)555-3333 slamdunk@gmail.com
UNKN01 Org New Blk 1 7 150.00 50.00
Bob Wire (210)555-1234 bobwire@xyz.com
UNKN02 Hackers 3 5 150.00 75.00
Tom E Gunn (210)555-5555 cyber@gmail.com
UTSA01 Armadillos 8 0 150.00 80.00
Jean E Us (210)555-1111 utsa@xyz.com
GAME RESULT UTSA01 NEWB01 55 12
GAME RESULT COMM01 SOUTH1 17 15
*** team (COMM01) not found
GAME RESULT SOUTH1 ALHGHT 66 3
GAME RESULT UTSA01 SOUTH1 44 45
GAME RESULT UNKN01 UNKN02 33 39
GAME RESULT COM001 UNKN02 43 37
GAME RESULT ALHGHT UNKN02 20 20
*** game was a tie
GAME RESULT NEWB01 NEWB01 30 20
*** same team
TEAM SHOW UTSA01
UTSA01 Armadillos 9 1 150.00 80.00
Jean E Us (210)555-1111 utsa@xyz.com
TEAM PAID UTSA01 50.00
TEAM SHOW UTSA01
UTSA01 Armadillos 9 1 150.00 130.00
Jean E Us (210)555-1111 utsa@xyz.com
TEAM SHOW UNKN01
UNKN01 Org New Blk 1 8 150.00 50.00
Bob Wire (210)555-1234 bobwire@xyz.com
TEAM PAID UNKN01 30.00
TEAM PAID UNKN01 30.00
TEAM SHOW UNKN01
UNKN01 Org New Blk 1 8 150.00 110.00
Bob Wire (210)555-1234 bobwire@xyz.com
TEAM PAID YYYY01 50.00
*** team (YYYY01) not found
TEAM SHOW YYYY01
*** team (YYYY01) not found
TEAM SHOW NEWB01
NEWB01 River Rats 0 9 120.00 75.00
Rock D Boat (210)555-4444 riverrat@xyz.com
GAME FIX UTSA01 NEWB01 55 12 55 2
TEAM SHOW UTSA01
UTSA01 Armadillos 9 1 150.00 130.00
Jean E Us (210)555-1111 utsa@xyz.com
TEAM SHOW NEWB01
NEWB01 River Rats 0 9 120.00 75.00
Rock D Boat (210)555-4444 riverrat@xyz.com