A client with a completed main function is provided. The main function should not be modified. You must update the client by creating and implementing the various functions described below. readFile – Loads the parameter array with Billionaire objects. The data for each Billionaire is read from the given data file which is in CSV format (comma delimited - 1 line per record with fields separated by a comma.) The function should read each line from the file, pass the line read to the Billionaire class constructor and store the resulting object in the parameter array. The second parameter represents the maximum number of Billionaire objects that can be stored. displayAll - Displays a list of the Billionaires stored in the array. getRange – Determines the smallest wealth value and the largest wealth value within the array. These values are returned to the caller via reference parameters. getWealthiest – Returns the Billionaire within the array with the greatest wealth. getUS – Returns a count of the number of individuals in the array with United States citizenship. Hints: Start small and build on working code. Implement ONE function at a time, leaving the remaining code in the main commented out. Thoroughly test the function. Once you are satisfied with the result, move on to the next function. In the overloaded constructor of the Billionaire class, consider using a stringstream object. The third parameter of the getline function provides an option to specify a delimiter, allowing the getline function to extract one field at a time from the stringstream object. getline(iss,resultString,','); // iss is a istringstream object Only strings are read from a string stream. For integer and floating point values, the data must be converted after reading. Alternatively, the parameter string can be parsed using various methods of the string class. String class methods that you may find useful in parsing the data include find, erase, and substr. Don’t forget to include needed libraries! You may specify the std namespace either in the using clause or using scope resolution.
A client with a completed main function is provided. The main function should not be modified. You must update the client by creating and implementing the various functions described below.
- readFile – Loads the parameter array with Billionaire objects. The data for each Billionaire is read from the given data file which is in CSV format (comma delimited - 1 line per record with fields separated by a comma.) The function should read each line from the file, pass the line read to the Billionaire class constructor and store the resulting object in the parameter array. The second parameter represents the maximum number of Billionaire objects that can be stored.
- displayAll - Displays a list of the Billionaires stored in the array.
- getRange – Determines the smallest wealth value and the largest wealth value within the array. These values are returned to the caller via reference parameters.
- getWealthiest – Returns the Billionaire within the array with the greatest wealth.
- getUS – Returns a count of the number of individuals in the array with United States citizenship.
Hints: Start small and build on working code. Implement ONE function at a time, leaving the remaining code in the main commented out. Thoroughly test the function. Once you are satisfied with the result, move on to the next function.
In the overloaded constructor of the Billionaire class, consider using a stringstream object. The third parameter of the getline function provides an option to specify a delimiter, allowing the getline function to extract one field at a time from the stringstream object.
getline(iss,resultString,','); // iss is a istringstream object
Only strings are read from a string stream. For integer and floating point values, the data must be converted after reading.
Alternatively, the parameter string can be parsed using various methods of the string class. String class methods that you may find useful in parsing the data include find, erase, and substr.
Don’t forget to include needed libraries! You may specify the std namespace either in the using clause or using scope resolution.
![The Top 30 Wealthiest Technology People:
$20.5B Microsoft
$32.9B Microsoft
$81.7B Amazon.com
$42.7B Google
$22.4B Dell computers
$16.1B online games
13
Paul Allen
investments United States
Steve Ballmer
United States
2
Jeff Bezos
United States
Sergey Brin
United States
10
Michael Dell
United States
16
William Ding
China
Larry Ellison
Bill Gates
James Goodnight
Terry Gou
Dietmar Hopp
Ma Huateng
$59.3B software
$84.5B Microsoft
4
United States
United States
$ 8.9B software
$10.2B electronics
$10.2B software
$36.7B internet media
$ 9. 6B WhatsApp
$18.3B Samsung
$15.8B internet search
$37.4B e-commerce
$13.3в Facebook
$20.7B Tesla Motors
$13.5B software services
$ 9.3B eBay
30
United States
23
Taiwan
24
Germany
8
China
28
Jan Koum
United States
14
Lee Kun-Hee
South Korea
17
Robin Li
China
7
Jack Ma
China
19
Dustin Moskovitz
United States
12
Elon Musk
United States
Shiv Nadar
Pierre Omidyar
Larry Page
18
India
29
United States
$43.9B Google
$12.6B software
United States
20
Hasso Plattner
Germany
Azim Premji
Liu Qiangdong
15
$18.2B software services
India
$10.1B e-commerce
$10.0B smartphone screens
$ 9.7B Facebook
$12.4B Google
25
China
26
Zhou Qunfei
Hong Kong
27
Eduardo Saverin
Brazil
Eric Schmidt
Masayoshi Son
Zhang Zhidong
Mark Zuckerberg
22
United States
$22.4B internet and telecom
$12.5B internet media
$69.6B Facebook
11
Japan
21
China
3
United States
The wealth of the billionaires range from $8.9B to $84.5B
The wealthiest technology person is
Bill Gates
$84.5B Microsoft
United States
There are 15 US billionaires in the top 30!](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5dbc0ee3-7803-44f6-a08f-d149359e76c1%2Faf77e0ed-7650-4aef-85a6-9db06baf8bc1%2Fur9lzlh_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 6 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)