Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me solve this code, and please use functions players.txt: Christian Pulisic Chelsea F.C., Premier League. 82.0 3 79 Cristiano Ronaldo Manchester United. F.C.,

Please help me solve this code, and please use functions

image text in transcribed

image text in transcribed

players.txt:

Christian Pulisic Chelsea F.C., Premier League. 82.0 3 79 Cristiano Ronaldo Manchester United. F.C., Premier. 91.0 7 504 Mo (Mohamed) Salah Liverpool F.C., Premier League. 90.0 11 320 Lionel Messi Paris Saint-Germain, French League. 93.0 30 511

Write a C++ program (must use struct and dynamic memory allocation) that reads COUNT player records from a text file (fifadatabase.txt ). The information is used for FIFA 22 Xbox Video Game. Each record has 5 fields (pieces of information) as shown below: Player Full Name (string) Player Current Team (string) Player Rating (double) Player Jersey Number (integer) Goal Scored (int) The program is expected to print the records in the format shown below, sorted in decreasing order based on the number of goals scored by the player: Player Name : Christian Pulisic Current Team : Chelsea F.C., Premier League Current Rating : 82.0 Player Jersey : 3 Goal Scored : 79 The records are stored in the following format (5 lines for each account): The First Line is the player's full name The Second Line is current team with the league. The Third line is the player rating The Fourth line is the jersey number The Fifth line is the number of scored goals Output: Name : Lionel Messi Team : Paris Saint-Germain, French League. Rating : 93.0 Number : 30 Goals : 511 Name : Cristiano Ronaldo Team : Manchester United. F.C., Premier. Rating : 91.0 Number: 7 Goals : 504 Name : Mo (Mohamed) Salah Team : Liverpool F.C., Premier League. Rating : 90.0 Number: 11 Goals : 320 Name : Christian Pulisic Team : Chelsea F.C., Premier League. Rating : 82.0 Number: 3 Goals : 79

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

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions