Can you please help me write the code using the instruction below because my code won't run, it just crashed and I dont know why. Please help, i will give you a good rating! Thanks. Here is the main intruction ( I also attached the example output too): 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. Here is the incomplete main code: /** Client application that reads wealth data from a file, creates * a Billionaire object for each person listed, * and adds the object to an array. * The array of Billionaire objects is displayed, particular statistics * are calculated and displayed. * * @author Prof Gregory * @author YOUR NAME */ #include #include #include #include #include #include "Billionaire.h" using namespace std; // You may comment out this line and use std:: instead // Any prototypes? void readFile (string FILENAME, Billionaire*, const int count); void displayAll(Billionaire[], const int count); void getRange(Billionaire[], const int count, float&, float&); Billionaire getWealthiest(Billionaire[], const int count); int getUs (Billionaire[], const int count); int main() { const string FILENAME = "WealthyTechies.csv"; const int COUNT = 30; Billionaire billionaire[COUNT]; // Load billionaire array with Billionaire objects read from data file readFile(FILENAME,billionaire,COUNT); // Display the array of Billionaire objects displayAll(billionaire,COUNT); cout << endl; // Determine the range of wealth values and display float low; float high; getRange(billionaire,COUNT,low,high); cout << "The wealth of the billionaires range from $" << low << " B to $" << high << " B" << endl; // Determine the wealthiest Billionaire and display Billionaire richPerson = getWealthiest(billionaire,COUNT); cout << "The wealthiest technology person is " << endl; richPerson.printBillionaire(); // Determine how many are from the US and display int usTotal = getUs(billionaire, COUNT); cout << "There are " << usTotal << " US billionaires in the top 30!"; return 0; }

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

Can you please help me write the code using the instruction below because my code won't run, it just crashed and I dont know why. Please help, i will give you a good rating! Thanks.

Here is the main intruction ( I also attached the example output too):

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.

Here is the incomplete main code:

/** Client application that reads wealth data from a file, creates
* a Billionaire object for each person listed,
* and adds the object to an array.
* The array of Billionaire objects is displayed, particular statistics
* are calculated and displayed.
*
* @author Prof Gregory
* @author YOUR NAME
*/
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <sstream>
#include "Billionaire.h"

using namespace std; // You may comment out this line and use std:: instead

// Any prototypes?
void readFile (string FILENAME, Billionaire*, const int count);
void displayAll(Billionaire[], const int count);
void getRange(Billionaire[], const int count, float&, float&);
Billionaire getWealthiest(Billionaire[], const int count);
int getUs (Billionaire[], const int count);

int main()
{
const string FILENAME = "WealthyTechies.csv";
const int COUNT = 30;
Billionaire billionaire[COUNT];

// Load billionaire array with Billionaire objects read from data file
readFile(FILENAME,billionaire,COUNT);

// Display the array of Billionaire objects
displayAll(billionaire,COUNT);
cout << endl;

// Determine the range of wealth values and display
float low;
float high;
getRange(billionaire,COUNT,low,high);
cout << "The wealth of the billionaires range from $" << low
<< " B to $" << high << " B" << endl;

// Determine the wealthiest Billionaire and display
Billionaire richPerson = getWealthiest(billionaire,COUNT);
cout << "The wealthiest technology person is " << endl;
richPerson.printBillionaire();

// Determine how many are from the US and display
int usTotal = getUs(billionaire, COUNT);
cout << "There are " << usTotal << " US billionaires in the top 30!";

return 0;
}

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 5 steps with 9 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