This program reads team data to show current rankings. This introduces the use of formatted I/O in C. Command Line Arguments:

p1 -t teamFileName

Input:

Stream input file which contains many teams. There are two different kinds of lines of data for each team:

- Team Identification Information:

o One line per team (separated by spaces)

szTeamId iWins iLosses dFeeAmount dPaidAmount
6s d d lf lf

- Team Contact Information:

o One line per team (separated by commas)

szTeamNm szEmail szPhone szContactName
12s 30s 13s 20s

o Although szTeamNm is a maximum of 12 characters, it may contain spaces; therefore, you cannot simply use %13s. For szFullName, you will have to use a bracket format code using %[^,]. The next two values are also terminated by commas.

o For szContactName, it contains spaces and is terminated by a new line character. You will have to use a bracket format code using %[^n]

Files provided on Blackboard:

cs1713p1_h.txt - include file which you must rename to cs1713p1.h

p1abc123_c.txt - program file which you must rename to p1abc123.c (using your abc123 id) and modify with your changes. It will be easier for the grader if your file names that you submit to BlackBoard include your abc123 id.

p1Team.txt - this data file is used by your program for the output that you will upload into BlackBoard Multiple additional data files to check your error handling, but you don't need to turn in the output for these:

p1TeamBad1.txt
p1TeamBad2.txt

Process:

While not at EOF, read a data line containing a team's identification information. For each of those teams:

  • Read a data line containing the contact information.
  • Print all the team information.

When printing the Team information, use this style (printing two lines per team):

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

Error Processing:

  • Please include the errors you detect in stderr. For this program, the data input errors should cause your program to terminate.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.