Reference no: EM132178398
I WANT THE PROGRAM IN C++ AND WHICH IS EXACTLY IN "TONY GADDIS" TEXTBOOK. PLEASE PLEASE SOLVE IT CORRECTLY.
Lab Purpose
Defining structures, arrays of structures, manipulating structures.
Always bring to class
1. Gaddis' book, How-to handouts from Canvas and your class notes.
2. This assignment sheet & the grade sheet for this lab already printed out.
3. USB Flash drive(s) or other storage media. Mandatory Instructions
1. Copy data file lab3.txt from the class library. $ cp lib/lab3.txt . ? That is a space and period
2. Declare a struct called Shareholder that will hold shareholder name, type of shares, and the number of shares. Also declare an array of Shareholder structs called ClientList. Although there are 50 elements in the array, the array will not be entirely filled. You will need to use a variable called numclients to process the data.
Your mission, should you decide to accept it, is to write the functions for which prototypes have been provided below:
a) The fillArray function that will read data file, lab3.txt and populate your array of structs. Sample data for a shareholder is shown below (name, type of shares, and number of shares). Matt Johnson
Gold
52
b) Write a function that will print all of the clients that fit a particular share category. Additionally print the top shareholder for that category. Declare any variables you will need, however, there is a constraint you must follow: you are only allowed to use one loop per function.
Keep calling this function from main() as long as user does not enter Done. You must validate user input and only accept Gold, Silver, Bronze, or Done (exactly as shown).
c) Create a function that will display a 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.65 per share
b. Silver Shares are valued at 4.75 per share
c. Bronze Shares are valued at 1.85 per share Run the program and test with each share types: Gold, Silver, and Bronze