Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You should write main () program that creates a portfolio and presents a menu to the user that looks like this: S should

You should write main() program that creates a portfolio and presents a menu to the user that looks like this:

"S" should allow the user to record the purchase of some stocks and add the purchase to the Stocks list. Likewise, "B" should allow the user to record the purchase of some bonds and add the purchase to the Bonds list."L" should list all of the securities in the portfolio, first displaying all of the Stocks, sorted by ticker symbol, followed by all of the bonds, sorted by issuer.The user should be able to add stocks, add bonds, and list repeatedly until he or she selects "Q" to quit.

There are a couple several things to point out about the output:

  1. The Interest Rate for Bonds is displayed as a percentage (that is, the interest rate entered by the user must be multiplied by 100 in the output).
  2. The Price Per Share of Stocks is calculated based on the total purchase price of the sale divided by the number of shares purchased.
  3. Note that within the Stocks section, the Stocks are sorted by ticker symbol.Within the Bonds section, the bonds are sorted by issuer.

These calculations can be performed in the output statements, or separate member functions can be created for them in their respective classes.

Use good coding style and principles for all code and input/output formatting. All data in a class must be private (not public nor protected).

You may find the tokenizeDate function and the strtok_s function.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions