Question: provided .h download link https://www.sendspace.com/file/cvyjfx Background We will use some real data from the Dow Jones Industrial Average (http://en.wikipedia.org/wiki/Dow_Jones_Industrial_Average), a set of 30 stocks that

 provided .h download link https://www.sendspace.com/file/cvyjfx Background We will use some real

data from the Dow Jones Industrial Average (http://en.wikipedia.org/wiki/Dow_Jones_Industrial_Average), a set of 30

provided .h download link https://www.sendspace.com/file/cvyjfx

Background We will use some real data from the Dow Jones Industrial Average (http://en.wikipedia.org/wiki/Dow_Jones_Industrial_Average), a set of 30 stocks that are used as an indication of the U.S. stock market. This sample is from 8/31/2012 to 6/14/2001 Market You will help create a Market struct. The proj08_market.h file provides three data members . string file name, the name of the file containing the data . vector symbol_list. A list of the short names of each of the 30 stocks in the Dow . map > stocks. The prices of the 30 stocks on the date (the key). The prices are in order of the elements in symbol list (that is, alphabetically by short name) You must write the following methods . a constructor that takes a single string argument, a string file name That file contains closing stock prices for 30 stocks of the Dow Jones for a particular date (see format below). It populates the data member stocks o e a method double get_price (string stock, long date). o returns the price of the stock on the date if . the date is a valid date the stock symbol is a valid stock symbol o returns a -1.0 otherwise a method high_low_year (long year, string symbol). Returns as a pair the high and low values (in that order) for that stock for the provided year o if the year or the symbol does not exist, returns the pair -1.0, -1.0 Plaver You will help create a Player struct. The proj08_player.h provides 2 data members: h How much money the player has double cas map stocks. The key is the stock symbol and the long is the quantity of that stock that the player owns (an integer value of stocks) You must write the following methods . a constructor that takes a single parameter, the double cash the player starts with. . a method bool buy (Market &m, string stock, long date, long quantity). An attempt to buy a stock by the player from the Market on the specified date o returns true if the player: has enough cash to make the purchase the stock symbol is one of the valid 30 symbols " the date is valid (within the range of dates stored in Market) o if true, purchase is made and the player info is updated Background We will use some real data from the Dow Jones Industrial Average (http://en.wikipedia.org/wiki/Dow_Jones_Industrial_Average), a set of 30 stocks that are used as an indication of the U.S. stock market. This sample is from 8/31/2012 to 6/14/2001 Market You will help create a Market struct. The proj08_market.h file provides three data members . string file name, the name of the file containing the data . vector symbol_list. A list of the short names of each of the 30 stocks in the Dow . map > stocks. The prices of the 30 stocks on the date (the key). The prices are in order of the elements in symbol list (that is, alphabetically by short name) You must write the following methods . a constructor that takes a single string argument, a string file name That file contains closing stock prices for 30 stocks of the Dow Jones for a particular date (see format below). It populates the data member stocks o e a method double get_price (string stock, long date). o returns the price of the stock on the date if . the date is a valid date the stock symbol is a valid stock symbol o returns a -1.0 otherwise a method high_low_year (long year, string symbol). Returns as a pair the high and low values (in that order) for that stock for the provided year o if the year or the symbol does not exist, returns the pair -1.0, -1.0 Plaver You will help create a Player struct. The proj08_player.h provides 2 data members: h How much money the player has double cas map stocks. The key is the stock symbol and the long is the quantity of that stock that the player owns (an integer value of stocks) You must write the following methods . a constructor that takes a single parameter, the double cash the player starts with. . a method bool buy (Market &m, string stock, long date, long quantity). An attempt to buy a stock by the player from the Market on the specified date o returns true if the player: has enough cash to make the purchase the stock symbol is one of the valid 30 symbols " the date is valid (within the range of dates stored in Market) o if true, purchase is made and the player info is updated

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!