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.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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!
Transcribed Image Text: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!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 6 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY