Question: Problem Statement You are to develop a program to read Baseball player statistics from an input file. Each player should bestored in a Player object.

Problem Statement You are to develop a program to read Baseball player statistics from an input file. Each player should bestored in a Player object. This program builds on to the requirements for Program #2 and #3. Please see the earlier assignmentsfor the definition of a Player Object. This will read in the same type of player data from an input file andwrite the results to the screen

New Requirements You are to implement our collection of baseball players as a binary tree, ordered by the player's name.(Lastname first, then firstname, in the event of people with the same last name). Your Tree class must implement at least the following methods, and any supporting methods you need. Reminder: Because many tree operations are recursive using a node pointer to a root or subroot asinput, many operations have a private version that is called with the correct pointer and a publicversion presented to the user who has no concept of the internal implementation of the tree.

default constructor and destructor

insert - to add a new player to the tree

free - to clean up a tree and free all of the nodes in the tree

count - to return a count of all players in the tree

display - to display the player records, in appropriate order.

updateAvg - to update a particular player's batting average

find - find a player by name

As with the prior programs, you must write a main program to adequately test your methods. Additionally, prompt the user for the name of a player and a new batting average. Find that player inthe tree and update his average to the new value. If the player is not found in the tree, indicate that tothe user with a message. Prompt the user to perform this operation until the user is ready to quit theprogram. After the user is finished testing the search and replace for batting averages, print the contents of thetree to the screen in sorted order (ascending) and in reverse order (descending)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!