Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that stores the following data about a soccer player in a structure: Players Name Players Number Points Scored by a Player Your

Write a program that stores the following data about a soccer player in a structure:

Players Name

Players Number

Points Scored by a Player

Your program should keep an array of 3 of these structures. Each array element stores data for a different player on the team. The data will be read from a file into an array of structs and then output. The program should then calculate and display the total points earned by the team. Finally, output the name of the player who has earned the most points and his points. Please follow the directions listed below regarding the functions you need.

Your program should have the following functions:

  1. getData will read the data from inFile.txt and store the data in the array of structs.

inFile.txt will look like this:

JohnSmith

123 3

PaulJones

111 7

EdSmall

-90 7

Joe_hmoe

333 5

TomJones

444 -9

  1. printData will output the data to file outFile.txt in a table using the following format

Name Number Points

XXXXX XXX XX

  1. calcTeamPoints will calculate and output to the file the total team points
  2. findHigh will determine and output to the file the name of the player with the highest points and the highest points. The signature for this function must look like:

void showHighest(Player *p, int size)

Input Validation Do not accept negative values for players numbers or points scored. This data will not be added to the array. Invalid messages need to be output to the file with the name of the player and the invalid data (number or points).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

Distinguish between filtering and interpreting. (Objective 2)

Answered: 1 week ago