Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

image text in transcribed

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: Carlson

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_2

Step: 3

blur-text-image_3

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

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

Question What is a Roth 403 (b) plan?

Answered: 1 week ago