subject

We say a portfolio matches the benchmark when the market value percentage of each asset in the portfolio matches the market value percentage of each asset in the benchmark. Your challenge is to write a program that determines the transactions necessary to make a portfolio match a benchmark, assuming the total market value of the portfolio stays the same. BackgroundA portfolio is a collection of assets such as stocks and bonds. A portfolio could have 10 shares of Vodafone stock, 15 shares of Google stock and 15 shares of Microsoft bonds. A benchmark is also just a collection of assets. A benchmark could have 15 shares of Vodafone stock, 10 shares of Google stock and 15 shares of Microsoft bonds. The market value of a stock isshares * priceThe market value of a bond isshares * (price + accrued interest) * 0.01A transaction is when you "buy" or "sell" a particular asset. For instance, you can decide to buy 5 shares of Vodafone stock which, given the portfolio described above, would result in you having 15 shares of Vodafone stock. An asset’s market value percentage can be calculated by dividing the market value of the asset by the total market value of every asset in the portfolio or benchmark. For example, given the portfolio described above and assuming all assets have a price of 5 and accrued interest is 0.05, the market value percentage of Vodafone would be(10 * 5) / ( (10 * 5) + (15 * 5) + (15 * (5 + 0.05) * 0.01) )Inputs and OutputsYou will receive a string in the following format Portfolio:Benchmark where Portfolio & Benchmark each are in the same format. Here is the format: Name, AssetType, Shares, Price, AccruedInterest where each asset within Portfolio or Benchmark is separated by '|' symbol. The output for the transactions is TransactionType, Name, SharesAssumptionsShares & Price are positive decimalsThere will always be at least 1 asset present in the Portfolio and BenchmarkA particular asset will only be a stock or a bond, but not bothThe final trades should be rounded to the nearest decimalsThe trades should be sorted in ascending order based on the names of the assetsInput:Vodafone, STOCK,10,50,0|Google, STOCK,15,50,0|Microsoft, BOND,15,100,0.05:Vodafone, STOCK,15,50,0|Google, STOCK,10,50,0|Microsoft, BOND,15,100,0.05Output:BUY, Vodafone,5SELL, Google,5Test 1Test InputDownload Test InputGoogle, STOCK,10,50,0|Microsoft, STOCK,15,50,0|IBM, BOND,15,100,0.05:IBM, BOND,20,100,0.05|Google, STOCK,15,50,0|Microsoft, STOCK,10,50,0.05Expected OutputDownload Test OutputBUY, Google,5BUY, IBM,5SELL, Microsoft,5Test 2Test InputDownload Test InputVodafone, STOCK,10,50,0|Google, STOCK,15,50,0|Microsoft, BOND,15,100,0.05:Vodafone, STOCK,15,50,0|Google, STOCK,10,50,0|Microsoft, BOND,15,100,0.05Expected OutputDownload Test OutputSELL, Google,5BUY, Vodafone,5

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:00
In this lab, you add a loop and the statements that make up the loop body to a c++ program that is provided. when completed, the program should calculate two totals: the number of left-handed people and the number of right-handed people in your class. your loop should execute until the user enters the character x instead of l for left-handed or r for right-handed. the inputs for this program are as follows: r, r, r, l, l, l, r, l, r, r, l, x variables have been declared for you, and the input and output statements have been written.
Answers: 3
question
Computers and Technology, 22.06.2019 11:00
When working with a team you should always do the following, except? question 3 options: be dependable and trustworthy be sensitive to others feelings do your fair share critique members of the group
Answers: 2
question
Computers and Technology, 22.06.2019 23:30
Select all that apply. which of the following are proofreading options included in microsoft word? spell check find replace grammar check formatting check
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Best laptops for college [$100-$500 range]?
Answers: 2
You know the right answer?
We say a portfolio matches the benchmark when the market value percentage of each asset in the portf...
Questions
question
Chemistry, 20.05.2020 07:57
question
Mathematics, 20.05.2020 07:57
question
Mathematics, 20.05.2020 07:57
question
History, 20.05.2020 07:57
question
Mathematics, 20.05.2020 07:57
question
Mathematics, 20.05.2020 07:57
question
Spanish, 20.05.2020 07:57