subject

Do it in java! output to be exactly the ! i need it asap! 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: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 17:00
What are the 12 colors of the spectrum called?
Answers: 1
question
Computers and Technology, 24.06.2019 02:50
Be sure to answer all parts. synthesize the following compound from benzene. a. b. c. d. e. f. reaction [1] conditions: a b c d e f reaction [1] product: draw structure reaction [2] conditions: a b c d e f reaction [2] product: draw structure reaction [3] conditions: a b c d e f reaction [3] product:
Answers: 3
question
Computers and Technology, 24.06.2019 08:00
Java the manager of a football stadium wants you to write a program that calculates the total ticket sales after each game
Answers: 1
question
Computers and Technology, 24.06.2019 12:00
How can we take picture in this app
Answers: 1
You know the right answer?
Do it in java! output to be exactly the ! i need it asap! we say a portfolio matches the benchmark...
Questions
question
Mathematics, 11.01.2020 02:31
question
Mathematics, 11.01.2020 02:31
Questions on the website: 13722363