The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Hello. can i get some help on this homework? I asked you for one last week and you did great, thank you again..Â
If there is a way to do this without any arguments in main(); as we usually do our homeworks that way for now. Thank you.
CS111 HW14Soccer Scores: Array of Structs Operations (20 points for each function)Define a structure namedPlayerthat stores the following data about a soccer player.•name: a string that stores player’s name•number: an integer that stores player’s number•address: a string that stores player’s address (3rd field in the given file)•city: a string that stores player’s city•state: a string that stores player’s state•zip: an integer that stores player’s ZIP code•phone: an unsigned long int that stores player’s phone number•date: an unsigned long int that stores player’s contract date•points: an integer that stores points scored by playerNote: phone and date are large numbers and cannot be stored in a simple integer. That’s why Irecommend you to use unsigned long int. You can also define them as doubles, but then when youwant to print those values, you should set up setprecision s.t. it displays zero floating point digits.Define an array of 10 Player structures namedteam. Each element is for a different player in team.(20 pts)Call a function namedreadDatathat reads players’ info from fileteam.txtinto the array.Display a menu containing the following choices. Write a function for each choice.1.(20 pts)displayData. Display all the data stored in the array.2.(20 pts)getAverage.Calculate and display the average of points earned by the team members.3.(20 pts)getHighest.Display (print) all the info of the player who has earned the most points.4.(20 pts)getTarget.Return (by references) all the info of the player whose number isnum.Function getTarget should accept an array as its first argument and an integer as its secondargument. The second argument should be the number of target player. The function shouldreturn all the info of the first occurrence of the given number. Use references to return all theplayer’s info fields.Example: getTarget (team, 17, …) returns Mike_Lynam 65_Terramar CarlsbadÂ
CA 920347609642364 09272015 5000.Before calling the function, ask the user to enter the target player’s number. In this example, Iassume the user enters 17. Then pass the number entered by the user (which is 17 in thisexample) to the function. Then the function searches the elements of array to find an elementwith player’s number 17. The function finds out that 17 is the number of player Mike_Lynam. Thenthe function returns all the info of this player using references. After calling this function, the mainfunction prints all the values returned by the function.
Â
Attachments: