Question
I have tried this but do not know how to make it work please help c++ language. the shares.txt file is : Adam Williams Silver
I have tried this but do not know how to make it work please help c++ language.
the shares.txt file is :
Adam Williams
Silver
45
Andreas Bostater
Bronze
89
Andrew Rine
Silver
89
Andrew King
Gold
78
Andrew Burrow
Gold
18
Benjamin Paulus
Bronze
89
Brandon Rubey
Silver
98
Brittani Grunden
Silver
99
Charles Yang
Silver
75
Christian Dickey
Bronze
62
Corbin Bruns
Silver
78
Cory Boyce
Gold
97
David August
Silver
102
Emily Auler
Bronze
55
Heather Ramos
Gold
85
Houston Cole
Bronze
76
Isaiah Xie
Silver
73
Jun Fylaktou
Gold
75
Justin Welsh
Bronze
58
Laura Nissen
Bronze
69
Levon Rodriguez
Gold
87
Melissa Spencer
Silver
54
Michael Bylon
Gold
27
Rachel Higgins
Silver
84
Terrence Sprauer
Bronze
78
Terry Curley
Gold
63
Matt Johnson
Gold
52
Mandatory Instructions 1. Copy data file shares.txt from the class library. $ cp lib/shares.txt That is a space and then a period 2. Define ADT Shareholder using a struct that will hold shareholder name, type of shares, and the number of shares. Also deelare an array of Shareholder strucs) called ClientList. Although there are 50 elements in any of your functions. in the array, the array will not be entirely filled. Do not empty/unfilled array structures Your mission, should you decide to accept it, is to write the functions for which prototypes have been provided below. Declare any variables you will need, however, there is a constraint you must follow: you are only allowed to use one loop per function The fillArray function that will read data file, shares.txt, and populate your array of struct(s). Sample data for a shareholder is shown below (name, type of shares, and number of shares held). You will need to utilize both getline) and infile >to read the mixed data types. Remember to add infile.igone) before next getline after infile >>statement. a) Matt Jhns on b) Write a function that will print all of the clients that fit a particular share category. Additionally print the shareholder with most shares for that category Keep calling this function from main0 as long as user does not enter Done. You must validate user input and only accept Gold, Silver, Bronze, or Done (case exactly as shown) e) Create a function that will display summary breakdown of the assets for each share type. You are only allowed to use one loop. Call this function once, after the user entered Done a. Gold Shares are valued at 9.95 per share b. Silver Shares are valued at 5.75 per share c. Bronze Shares are valued at 2.23 per share CS2020, Instructor: CarlsonStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started