Question: PLease Objectives: Use basic C++constructs: if, switch, and repetition (looping)Perform simple data type manipulations Solve problem, design solution and implement using C++ Define C++ class
PLease
Objectives:
Use basic C++constructs: if, switch, and repetition (looping)Perform simple data type manipulations
Solve problem, design solution and implement using C++
Define C++ class and create and manage a list of objects
Description:
Improve and enhance your BuyStocks.cppand name it as BuyStockCmd that uses commands instead of menu with the following changes:
1.Accept a command line argument which is the purchase data file in the following format:
Here is an example of the data file:
100 INTC 30.13
200 CSCO 24.00
50 IBM 130.00
100 AAPL 94.28
2.Define a new C++ Stock class that manages a stock price, number of share and stock symbol
3.The program will read and process the following user-entered commands:
buybuy a stock by asking for the stock symbol, quantity and share price
displaydisplay all purchases
summarydisplay only the summary of purchase total and number of purchases
find display all purchase only for that symbol
amount>= display all purchases >= the given amounthelpdisplay this help messageexitexit the program after the confirmationNotes:
The amount is compared with the total cost of the purchase (not the share price)
The symbol search is a substring search. In another words, the symbol can contain that search string
The user can buy the same stock symbol multiple times
.The findand amount>=requires the 2ndsearch argument.
Requirementsthat are still applicable:
1.For each purchase, it is required to create a new Stock object to keep track of the purchasing info.
Note: this Stockclass must not have cin or cout or vector being used within the class.
2.To manage the list of purchases, you will need to have a Vector object to manage the list of Stocks objects. In another words, you are no longer using string to keep track of purchasing history.
3.The user can enterthe share pricewith any number of decimals,but all outputamounts must be displayed with dollar sign and only two-digit decimals.
4.It must ask for confirmation of Are you sure that you want to exit the program (y)?before exiting the program. If the user enters n, the program will continue.
5.All data members in a class must be declared as private
These are sample out puts for each steps.





I hope it will be better. That's all sample out puts I got.
BuyStocks_output1 - Notepad Le Edit Format View Help :\>BuyStocks lease enter the 8-digit account number: ABCDEFGH nly digits, please. lease enter the 8-digit account number: ABC Che account number must be exactly 8 digits. Only digits, please. Please enter the 8-digit account number: 1234ABCD Only digits, please. You have reached maximum number of retries. Please try again at later time. Thank you for using our program. C:\>BuyStocks Please enter the 8-digit account number: ABCD1234 Only digits, please. Please enter the 8-digit account number: 12345678ABC The account number must be exactly 8 digits. Only digits, please. Please enter the 8-digit account number: 12345678 Stock Trading Menu: 1. Buy 2. Report 3. Exit Enter your option: 3 Thank you for using our program. BuyStocks_output2 (1) - Notepad File Edit Format View Help C:\>BuyStocks Please enter the 8-digit account number 12345678 Stock Trading Menu: 1. Buy 2. Report 3. Exit Enter your option: 2 Number of purchases: 0 Purchase total: $0.00 Stock Trading Menu: 1. Buy 2. Report 3. Exit Enter your option: 1 Please enter the company name: IBM Please enter the number of shares: 100 Please enter the share's price: 150 100 shares of IBM at $150.00 per share. Transaction cost: $10.00. Total: $15010.00. Stock Trading Menu: 1. Buy 2. Report 3. Exit Enter your option: 2 List of all purchases: 100 shares of IBM at $150.00 per share. Transaction cost: $10.00. Total: $15019.00. Number of purchases: 1 Purchase total: $15010.00 Stock Trading Menu: 1. Buy 2. Report 3. Exit Enter your option: 1 Please enter the company name: Facebook Please enter the number of shares: 1000 Please enter the share's price: 142 1000 shares of Facebook at $142.00 per share. Transaction cost: $0.00. Total: $142000.ee. Stock Trading Menu: 1. Buy 2. Report 3. Exit Enter your option: 2 List of all purchases: 100 shares of IBM at $150.00 per share. Transaction cost: $19.00. Total: $15e1e.ee. 1000 shares of Facebook at $142.00 per share. Transaction cost: $e.ee. Total: $142eee.ee. Number of purchases: 2 Purchase total: $157010.00 Stock Trading Menu: I buystock_output3 - Notepad File Edit Format View Help D:\>BuyStockCmd purchasedata3.txt Please enter a command: display SYMBOL (INTC) PRICE($30.13) QUANTITY(100) TOTAL ($3013.00) SYMBOL(CSCO) PRICE ($24.00) QUANTITY(200) TOTAL ($4800.00) SYMBOL(IBM) PRICE ($130.00) QUANTITY(50) TOTAL($6500.00) SYMBOL (AAPL) PRICE($94.28) QUANTITY(100) TOTAL ($9428.00) Please enter a command: buy Please enter the stock symbol: GOOG Please enter the number of shares: 300 Please enter the share price: 99.99 The stock has been purchased successfully. Please enter a command: buy Please enter the stock symbol: COSTCO Please enter the number of shares: 10 Please enter the share price: 350.50 The stock has been purchased successfully. Please enter a command: display SYMBOL (INTC) PRICE($30.13) QUANTITY(100) TOTAL($3013.00) SYMBOL (CSCO) PRICE ($24.00) QUANTITY(200) TOTAL($4800.00) SYMBOL (IBM) PRICE $130.00) QUANTITY(50) TOTAL($6500.00) SYMBOL (AAPL) PRICE ($94.28) QUANTITY(100) TOTAL ($9428.00) SYMBOL (GOOG) PRICE ($99.99) QUANTITY(300) TOTAL ($29997.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL ($3505.00) Please enter a command: find Co SYMBOL (CSCO) PRICE($24.00) QUANTITY(200) TOTAL($4800.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL ($3505.00) Please enter a command: buy Please enter the stock symbol: AAPL Please enter the number of shares: 5 Please enter the share price: 98.0 The stock has been purchased successfully. Please enter a command: display SYMBOL (INTC) PRICE($30.13) QUANTITY(100) TOTAL($3013.00) SYMBOL (CSCO) PRICE ($24.00) QUANTITY(200) TOTAL($4800.00) SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL($6500.00) SYMBOL (AAPL) PRICE ($94.28) QUANTITY(100) TOTAL($9428.00) SYMBOL (GOOG) PRICE ($99.99) QUANTITY(300) TOTAL($29997.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL ($3505.00) SYMBOL (AAPL) PRICE ($98.00) QUANTITY(5) TOTAL ($490.00) Please enter a command: find AAPL SYMBOL (AAPL) PRICE ($94.28) QUANTITY(100) TOTAL ($9428.00) SYMBOL (AAPL) PRICE($98.00) QUANTITY(5) TOTAL($490.00) in 1. CC I File Edit Format View Help Please enter a command: find AAPL SYMBOL (AAPL) PRICE($94.28) QUANTITY(100) TOTAL ($9428.00) SYMBOL (AAPL) PRICE($98.00) QUANTITY(5) TOTAL ($490.00) Please enter a command: find C SYMBOL(INTC) PRICE($30.13) QUANTITY(100) TOTAL($3013.00) SYMBOL (CSCO) PRICE($24.00) QUANTITY(200) TOTAL($4800.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL ($3505.00) Please enter a command: amount>= 1000 SYMBOL(INTC) PRICE($30.13) QUANTITY(100) TOTAL ($3013.00) SYMBOL(CSCO) PRICE ($24.00) QUANTITY(200) TOTAL ($4800.00) SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL($6500.00) SYMBOL (AAPL) PRICE ($94.28) QUANTITY(100) TOTAL ($9428.00) SYMBOL (GOOG) PRICE($99.99) QUANTITY(300) TOTAL($29997.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL ($3505.00) Please enter a command: amount>= 10000 SYMBOL (GOOG) PRICE ($99.99) QUANTITY(300) TOTAL($29997.00) Please enter a command: amount>= 5000 SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL ($6500.00) SYMBOL (AAPL) PRICE($94.28) QUANTITY(100) TOTAL($9428.00) SYMBOL (GOOG) PRICE($99.99) QUANTITY(300) TOTAL($29997.00) Please enter a command: buy Please enter the stock symbol: AAPL Please enter the number of shares: -1 Number of shares cannot be zero or negative. Please try it again. Please enter the number of shares: 0 Number of shares cannot be zero or negative. Please try it again. Please enter the number of shares: 2 Please enter the share price: -5 Share price cannot be zero or negative. Please try it again. Please enter the share price: 0 Share price cannot be zero or negative. Please try it again. Please enter the share price: 99 The stock has been purchased successfully. Please enter a command: display SYMBOL (INTC) PRICE($30.13) QUANTITY(100) TOTAL($3013.00) SYMBOL (CSCO) PRICE ($24.00) QUANTITY(200) TOTAL ($4800.00) SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL ($6500.00) SYMBOL (AAPL) PRICE ($94.28) QUANTITY(100) TOTAL($9428.00) SYMBOL (GOOG) PRICE($99.99) QUANTITY(300) TOTAL($29997.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL($3505.00) SYMBOL (AAPL) PRICE ($98.00) QUANTITY(5) TOTAL ($490.00) SYMBOL (AAPL) PRICE ($99.00) QUANTITY(2) TOTAL($198.00) Type here to search In 1 C O II [ ** > I cannot be zero or negative. Please try it again. Please enter the number of shares: 2 Please enter the share price: -5 Share price cannot be zero or negative. Please try it again. Please enter the share price: 0 Share price cannot be zero or negative. Please try it again. Please enter the share price: 99 The stock has been purchased successfully. Please enter a command: display SYMBOL(INTC) PRICE($30.13) QUANTITY(100) TOTAL($3013.00) SYMBOL (CSCO) PRICE($24.00) QUANTITY(200) TOTAL ($4800.00) SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL($6500.00) SYMBOL (AAPL) PRICE ($94.28) QUANTITY(100) TOTAL ($9428.00) SYMBOL (GOOG) PRICE($99.99) QUANTITY(300) TOTAL ($29997.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL ($3505.00) SYMBOL (AAPL) PRICE ($98.00) QUANTITY(5) TOTAL ($490.00) SYMBOL (AAPL) PRICE($99.00) QUANTITY(2) TOTAL ($198.00) Please enter a command: quit Invalid command. Type "help" for more info. Please enter a command: help "buy" buy a stock by asking for the stock symbol, quantity and share price "display" display all purchases "summary" display only the summary of purchase total and number of purchases "find " display all purchase only for that symbol "amount>= " display all purchases >= the given amount "help" display this help message "exit" exit the program after the confirmation Please enter a command: exit Are you sure that you want to exit the program? n Please enter a command: display SYMBOL (INTC) PRICE($30.13) QUANTITY(100) TOTAL ($3013.00) SYMBOL (CSCO) PRICE($24.00) QUANTITY(200) TOTAL ($4800.00) SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL ($6500.00) SYMBOL (AAPL) PRICE ($94.28) QUANTITY(100) TOTAL ($9428.00) SYMBOL (GOOG) PRICE ($99.99) QUANTITY(300) TOTAL($29997.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL($3505.00) SYMBOL (AAPL) PRICE ($98.00) QUANTITY(5) TOTAL($490.00) SYMBOL(AAPL) PRICE($99.00) QUANTITY(2) TOTAL($198.00) Please enter a command: exit Are you sure that you want to exit the program? y Ln Type here to search O BI buystock_output4 (2) - Notepad File Edit Format View Help D:\>BuyStockCmd purchasedata3.txt Please enter a command: display SYMBOL(INTC) PRICE($30.13) QUANTITY(100) TOTAL($3013.00) SYMBOL(CSCO) PRICE($24.00) QUANTITY(200) TOTAL($4800.00) SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL ($6500.00) SYMBOL (AAPL) PRICE($94.28) QUANTITY(100) TOTAL($9428.00) Please enter a command: summary Number-of-purchases (4) Total-cost($23741.00) Please enter a command: buy Please enter the stock symbol: GOOG Please enter the number of shares: 10 Please enter the share price: 550.1234 The stock has been purchased successfully. Please enter a command: display SYMBOL(INTC) PRICE($30.13) QUANTITY(100) TOTAL($3013.00) SYMBOL (CSCO) PRICE ($24.00) QUANTITY(200) TOTAL($4800.00) SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL ($6500.00) SYMBOL (AAPL) PRICE($94.28) QUANTITY(100) TOTAL($9428.00) SYMBOL (GOOG) PRICE($550.12) QUANTITY(10) TOTAL($5501.23) Please enter a command: summary Number-of-purchases (5) Total-cost($29242.23) Please enter a command: exit Are you sure that you want to exit the program? y BuyStocks_output1 - Notepad Le Edit Format View Help :\>BuyStocks lease enter the 8-digit account number: ABCDEFGH nly digits, please. lease enter the 8-digit account number: ABC Che account number must be exactly 8 digits. Only digits, please. Please enter the 8-digit account number: 1234ABCD Only digits, please. You have reached maximum number of retries. Please try again at later time. Thank you for using our program. C:\>BuyStocks Please enter the 8-digit account number: ABCD1234 Only digits, please. Please enter the 8-digit account number: 12345678ABC The account number must be exactly 8 digits. Only digits, please. Please enter the 8-digit account number: 12345678 Stock Trading Menu: 1. Buy 2. Report 3. Exit Enter your option: 3 Thank you for using our program. BuyStocks_output2 (1) - Notepad File Edit Format View Help C:\>BuyStocks Please enter the 8-digit account number 12345678 Stock Trading Menu: 1. Buy 2. Report 3. Exit Enter your option: 2 Number of purchases: 0 Purchase total: $0.00 Stock Trading Menu: 1. Buy 2. Report 3. Exit Enter your option: 1 Please enter the company name: IBM Please enter the number of shares: 100 Please enter the share's price: 150 100 shares of IBM at $150.00 per share. Transaction cost: $10.00. Total: $15010.00. Stock Trading Menu: 1. Buy 2. Report 3. Exit Enter your option: 2 List of all purchases: 100 shares of IBM at $150.00 per share. Transaction cost: $10.00. Total: $15019.00. Number of purchases: 1 Purchase total: $15010.00 Stock Trading Menu: 1. Buy 2. Report 3. Exit Enter your option: 1 Please enter the company name: Facebook Please enter the number of shares: 1000 Please enter the share's price: 142 1000 shares of Facebook at $142.00 per share. Transaction cost: $0.00. Total: $142000.ee. Stock Trading Menu: 1. Buy 2. Report 3. Exit Enter your option: 2 List of all purchases: 100 shares of IBM at $150.00 per share. Transaction cost: $19.00. Total: $15e1e.ee. 1000 shares of Facebook at $142.00 per share. Transaction cost: $e.ee. Total: $142eee.ee. Number of purchases: 2 Purchase total: $157010.00 Stock Trading Menu: I buystock_output3 - Notepad File Edit Format View Help D:\>BuyStockCmd purchasedata3.txt Please enter a command: display SYMBOL (INTC) PRICE($30.13) QUANTITY(100) TOTAL ($3013.00) SYMBOL(CSCO) PRICE ($24.00) QUANTITY(200) TOTAL ($4800.00) SYMBOL(IBM) PRICE ($130.00) QUANTITY(50) TOTAL($6500.00) SYMBOL (AAPL) PRICE($94.28) QUANTITY(100) TOTAL ($9428.00) Please enter a command: buy Please enter the stock symbol: GOOG Please enter the number of shares: 300 Please enter the share price: 99.99 The stock has been purchased successfully. Please enter a command: buy Please enter the stock symbol: COSTCO Please enter the number of shares: 10 Please enter the share price: 350.50 The stock has been purchased successfully. Please enter a command: display SYMBOL (INTC) PRICE($30.13) QUANTITY(100) TOTAL($3013.00) SYMBOL (CSCO) PRICE ($24.00) QUANTITY(200) TOTAL($4800.00) SYMBOL (IBM) PRICE $130.00) QUANTITY(50) TOTAL($6500.00) SYMBOL (AAPL) PRICE ($94.28) QUANTITY(100) TOTAL ($9428.00) SYMBOL (GOOG) PRICE ($99.99) QUANTITY(300) TOTAL ($29997.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL ($3505.00) Please enter a command: find Co SYMBOL (CSCO) PRICE($24.00) QUANTITY(200) TOTAL($4800.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL ($3505.00) Please enter a command: buy Please enter the stock symbol: AAPL Please enter the number of shares: 5 Please enter the share price: 98.0 The stock has been purchased successfully. Please enter a command: display SYMBOL (INTC) PRICE($30.13) QUANTITY(100) TOTAL($3013.00) SYMBOL (CSCO) PRICE ($24.00) QUANTITY(200) TOTAL($4800.00) SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL($6500.00) SYMBOL (AAPL) PRICE ($94.28) QUANTITY(100) TOTAL($9428.00) SYMBOL (GOOG) PRICE ($99.99) QUANTITY(300) TOTAL($29997.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL ($3505.00) SYMBOL (AAPL) PRICE ($98.00) QUANTITY(5) TOTAL ($490.00) Please enter a command: find AAPL SYMBOL (AAPL) PRICE ($94.28) QUANTITY(100) TOTAL ($9428.00) SYMBOL (AAPL) PRICE($98.00) QUANTITY(5) TOTAL($490.00) in 1. CC I File Edit Format View Help Please enter a command: find AAPL SYMBOL (AAPL) PRICE($94.28) QUANTITY(100) TOTAL ($9428.00) SYMBOL (AAPL) PRICE($98.00) QUANTITY(5) TOTAL ($490.00) Please enter a command: find C SYMBOL(INTC) PRICE($30.13) QUANTITY(100) TOTAL($3013.00) SYMBOL (CSCO) PRICE($24.00) QUANTITY(200) TOTAL($4800.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL ($3505.00) Please enter a command: amount>= 1000 SYMBOL(INTC) PRICE($30.13) QUANTITY(100) TOTAL ($3013.00) SYMBOL(CSCO) PRICE ($24.00) QUANTITY(200) TOTAL ($4800.00) SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL($6500.00) SYMBOL (AAPL) PRICE ($94.28) QUANTITY(100) TOTAL ($9428.00) SYMBOL (GOOG) PRICE($99.99) QUANTITY(300) TOTAL($29997.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL ($3505.00) Please enter a command: amount>= 10000 SYMBOL (GOOG) PRICE ($99.99) QUANTITY(300) TOTAL($29997.00) Please enter a command: amount>= 5000 SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL ($6500.00) SYMBOL (AAPL) PRICE($94.28) QUANTITY(100) TOTAL($9428.00) SYMBOL (GOOG) PRICE($99.99) QUANTITY(300) TOTAL($29997.00) Please enter a command: buy Please enter the stock symbol: AAPL Please enter the number of shares: -1 Number of shares cannot be zero or negative. Please try it again. Please enter the number of shares: 0 Number of shares cannot be zero or negative. Please try it again. Please enter the number of shares: 2 Please enter the share price: -5 Share price cannot be zero or negative. Please try it again. Please enter the share price: 0 Share price cannot be zero or negative. Please try it again. Please enter the share price: 99 The stock has been purchased successfully. Please enter a command: display SYMBOL (INTC) PRICE($30.13) QUANTITY(100) TOTAL($3013.00) SYMBOL (CSCO) PRICE ($24.00) QUANTITY(200) TOTAL ($4800.00) SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL ($6500.00) SYMBOL (AAPL) PRICE ($94.28) QUANTITY(100) TOTAL($9428.00) SYMBOL (GOOG) PRICE($99.99) QUANTITY(300) TOTAL($29997.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL($3505.00) SYMBOL (AAPL) PRICE ($98.00) QUANTITY(5) TOTAL ($490.00) SYMBOL (AAPL) PRICE ($99.00) QUANTITY(2) TOTAL($198.00) Type here to search In 1 C O II [ ** > I cannot be zero or negative. Please try it again. Please enter the number of shares: 2 Please enter the share price: -5 Share price cannot be zero or negative. Please try it again. Please enter the share price: 0 Share price cannot be zero or negative. Please try it again. Please enter the share price: 99 The stock has been purchased successfully. Please enter a command: display SYMBOL(INTC) PRICE($30.13) QUANTITY(100) TOTAL($3013.00) SYMBOL (CSCO) PRICE($24.00) QUANTITY(200) TOTAL ($4800.00) SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL($6500.00) SYMBOL (AAPL) PRICE ($94.28) QUANTITY(100) TOTAL ($9428.00) SYMBOL (GOOG) PRICE($99.99) QUANTITY(300) TOTAL ($29997.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL ($3505.00) SYMBOL (AAPL) PRICE ($98.00) QUANTITY(5) TOTAL ($490.00) SYMBOL (AAPL) PRICE($99.00) QUANTITY(2) TOTAL ($198.00) Please enter a command: quit Invalid command. Type "help" for more info. Please enter a command: help "buy" buy a stock by asking for the stock symbol, quantity and share price "display" display all purchases "summary" display only the summary of purchase total and number of purchases "find " display all purchase only for that symbol "amount>= " display all purchases >= the given amount "help" display this help message "exit" exit the program after the confirmation Please enter a command: exit Are you sure that you want to exit the program? n Please enter a command: display SYMBOL (INTC) PRICE($30.13) QUANTITY(100) TOTAL ($3013.00) SYMBOL (CSCO) PRICE($24.00) QUANTITY(200) TOTAL ($4800.00) SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL ($6500.00) SYMBOL (AAPL) PRICE ($94.28) QUANTITY(100) TOTAL ($9428.00) SYMBOL (GOOG) PRICE ($99.99) QUANTITY(300) TOTAL($29997.00) SYMBOL (COSTCO) PRICE($350.50) QUANTITY(10) TOTAL($3505.00) SYMBOL (AAPL) PRICE ($98.00) QUANTITY(5) TOTAL($490.00) SYMBOL(AAPL) PRICE($99.00) QUANTITY(2) TOTAL($198.00) Please enter a command: exit Are you sure that you want to exit the program? y Ln Type here to search O BI buystock_output4 (2) - Notepad File Edit Format View Help D:\>BuyStockCmd purchasedata3.txt Please enter a command: display SYMBOL(INTC) PRICE($30.13) QUANTITY(100) TOTAL($3013.00) SYMBOL(CSCO) PRICE($24.00) QUANTITY(200) TOTAL($4800.00) SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL ($6500.00) SYMBOL (AAPL) PRICE($94.28) QUANTITY(100) TOTAL($9428.00) Please enter a command: summary Number-of-purchases (4) Total-cost($23741.00) Please enter a command: buy Please enter the stock symbol: GOOG Please enter the number of shares: 10 Please enter the share price: 550.1234 The stock has been purchased successfully. Please enter a command: display SYMBOL(INTC) PRICE($30.13) QUANTITY(100) TOTAL($3013.00) SYMBOL (CSCO) PRICE ($24.00) QUANTITY(200) TOTAL($4800.00) SYMBOL (IBM) PRICE($130.00) QUANTITY(50) TOTAL ($6500.00) SYMBOL (AAPL) PRICE($94.28) QUANTITY(100) TOTAL($9428.00) SYMBOL (GOOG) PRICE($550.12) QUANTITY(10) TOTAL($5501.23) Please enter a command: summary Number-of-purchases (5) Total-cost($29242.23) Please enter a command: exit Are you sure that you want to exit the program? y