You have been hired by Detroit Football team as an assistant of the main coach. You need to modify a program to take all the information (jersey number, name, height, accuracy and yearly salary) of each player and find the information of the best player who has best accuracy among them. You should consider the accuracy in a range [0-10]. Take all the information using a struct data type in C++. Like, struct teamDetroit { int jersey_num[10]; string name[10]; double height[10]; float accuracy[10]; int salary[10]; }; Moreover, take only 3 players information and put the player name as a single name (either first_name or last name). Sample input: Team of Detroit: Put the information of: 1 th player Enter the jersey_num: 2 Enter the name of player: Bob Enter the height of player in inch: 72 Accuracy is: 7.6 Enter the salary of player: ($)13000 Put the information of: 2 th player Enter the jersey_num: 4 Enter the name of player: John Enter the height of player in inch: 67 Accuracy is: 7.8 Enter the salary of player: ($)16000 Put the information of: 3 th player Enter the jersey_num: 6 Enter the name of player: Bill Enter the height of player in inch: 68 Accuracy is: 4.5 Enter the salary of player: ($)14000 Sample Output: The best player of this team is: Jersey Number: 4 Name: John Height is: 67 Accuracy is: 7.8 Salary of player: ($)16000
You have been hired by Detroit Football team as an assistant of the main coach. You need to modify a program to take all the information (jersey number, name, height, accuracy and yearly salary) of each player and find the information of the best player who has best accuracy among them. You should consider the accuracy in a range [0-10]. Take all the information using a struct data type in C++.
Like,
struct teamDetroit
{
int jersey_num[10];
string name[10];
double height[10];
float accuracy[10];
int salary[10];
};
Moreover, take only 3 players information and put the player name as a single name (either first_name or last name).
Sample input:
Team of Detroit:
Put the information of: 1 th player
Enter the jersey_num: 2
Enter the name of player: Bob
Enter the height of player in inch: 72
Accuracy is: 7.6
Enter the salary of player: ($)13000
Put the information of: 2 th player
Enter the jersey_num: 4
Enter the name of player: John
Enter the height of player in inch: 67
Accuracy is: 7.8
Enter the salary of player: ($)16000
Put the information of: 3 th player
Enter the jersey_num: 6
Enter the name of player: Bill
Enter the height of player in inch: 68
Accuracy is: 4.5
Enter the salary of player: ($)14000
Sample Output:
The best player of this team is:
Jersey Number: 4
Name: John
Height is: 67
Accuracy is: 7.8
Salary of player: ($)16000
Step by step
Solved in 2 steps with 1 images