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, 22.06.2019 21:30
The salespeople at hyperactive media sales all use laptop computers so they can take data with them on the road. you are a salesperson for superduper lightspeed computers talking to hyperactive media sales about upgrading the laptops to windows 10. explain how network location awareness in windows 10 would make the laptops more secure.
Answers: 3
question
Computers and Technology, 23.06.2019 14:00
Need ! will choose brainliest! discuss the role of abstraction in the history of computer software.
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
Which of the following is not an enhancement to the standard wiki to make it more attractive for corporations? encryptionwork spacespermission toolspredictive text
Answers: 2
question
Computers and Technology, 24.06.2019 07:20
3pointsyou've found an image you want to insert into your slide presentation. youwant to make the image look more gray so that it looks like an older imagewhat would you need to adjust? 0.00o a. sizeo b. hueo c. contrasto d. tones
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
Mathematics, 18.09.2019 05:30
question
Social Studies, 18.09.2019 05:30
Questions on the website: 13722363