Question: Can you please write a code which stimulate the buying stocks resulting in the following output in the file in C++? Thank You! C:>BuyStocks Please

Can you please write a code which stimulate the buying stocks resulting in the following output in the file in C++? Thank You!

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: $15010.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.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: $15010.00. 1000 shares of Facebook at $142.00 per share. Transaction cost: $0.00. Total: $142000.00.

Number of purchases: 2 Purchase total: $157010.00

Stock Trading Menu: 1. Buy 2. Report 3. Exit Enter your option: 1

Please enter the company name: Intel Please enter the number of shares: 1 Please enter the share's price: 35.2 1 shares of Intel at $35.20 per share. Transaction cost: $10.00. Total: $45.20.

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: $15010.00. 1000 shares of Facebook at $142.00 per share. Transaction cost: $0.00. Total: $142000.00. 1 shares of Intel at $35.20 per share. Transaction cost: $10.00. Total: $45.20.

Number of purchases: 3 Purchase total: $157055.20

Stock Trading Menu: 1. Buy 2. Report 3. Exit Enter your option: 1

Please enter the company name: Yahoo Please enter the number of shares: 1100 Please enter the share's price: 27 1100 shares of Yahoo at $27.00 per share. Transaction cost: $0.00. Total: $29700.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: $15010.00. 1000 shares of Facebook at $142.00 per share. Transaction cost: $0.00. Total: $142000.00. 1 shares of Intel at $35.20 per share. Transaction cost: $10.00. Total: $45.20. 1100 shares of Yahoo at $27.00 per share. Transaction cost: $0.00. Total: $29700.00.

Number of purchases: 4 Purchase total: $186755.20

Stock Trading Menu: 1. Buy 2. Report 3. Exit Enter your option: 3

Thank you for using our program.

C:\>

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!