Write a program that declares a struct to store the data of a football player (player’s name, player’s position, number of touchdowns, number of catches, number of passing yards, number of receiving yards, and the number of rushing yards). Declare an array of 10 components to store the data of 10 football players. Your program must contain a function to input data and a function to output data. Add functions to search the array to find the index of a specific player, and up-date the data of a player. (You may assume that the input data is stored in a file.) Before the program terminates, give the user the option to save data in a file. Your program should be menu driven, giving the user various choices. An example of the program is shown below: Select one of the following options: 1: To print a player's data 2: To print the entire data 3: To update a player's touch downs 4: To update a player's number of catches 5: To update a player's passing yards 6: To update a player's receiving yards 7: To update a player's rushing yards 99: To quit the program Example: 1 Enter player's name: Bill Name: BillPosition: Quarter_Back; Touch Downs: 70; Number of Catche s: 0; Passing Yards: 8754; Receiving Yards: 0; Rushing Yards: 573 Select one of the following options: 1: To print a player's data 2: To print the entire data 3: To update a player's touch downs 4: To update a player's number of catches 5: To update a player's passing yards 6: To update a player's receiving yards 7: To update a player's rushing yards 99: To quit the program  Would you like to save data: (y,Y/n,N)

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 8PP: (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays...
icon
Related questions
Question

C++

Write a program that declares a struct to store the data of a football player (player’s name, player’s position, number of touchdowns, number of catches, number of passing yards, number of receiving yards, and the number of rushing yards).

Declare an array of 10 components to store the data of 10 football players.

Your program must contain a function to input data and a function to output data. Add functions to search the array to find the index of a specific player, and up-date the data of a player. (You may assume that the input data is stored in a file.) Before the program terminates, give the user the option to save data in a file. Your program should be menu driven, giving the user various choices.

An example of the program is shown below:

Select one of the following options:

1: To print a player's data

2: To print the entire data

3: To update a player's touch downs

4: To update a player's number of catches

5: To update a player's passing yards

6: To update a player's receiving yards

7: To update a player's rushing yards

99: To quit the program

Example:

1 Enter player's name: Bill Name: BillPosition: Quarter_Back; Touch Downs: 70; Number of Catche s: 0; Passing Yards: 8754; Receiving Yards: 0; Rushing Yards: 573

Select one of the following options:

1: To print a player's data

2: To print the entire data

3: To update a player's touch downs

4: To update a player's number of catches

5: To update a player's passing yards

6: To update a player's receiving yards

7: To update a player's rushing yards

99: To quit the program 

Would you like to save data: (y,Y/n,N)

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning