Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

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

Step: 3

blur-text-image

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

List the primary steps for developing a state machine diagram.

Answered: 1 week ago

Question

2. What are the pros and cons of readability indexes?

Answered: 1 week ago

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago