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, 22.06.2019 17:00
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best suited for this?
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Write the html code to make a link out of the text “all about puppies”. it should link to a pdf called “puppies.pdf” inside the “documents” folder. the pdf should open in a new window.
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
question
Computers and Technology, 24.06.2019 01:10
Create a program that will take in a single x and y coordinate as the origin. after the input is provided, the output should be all of the coordinates (all 26 coordinates read from the “coordinates.json” file), in order of closest-to-farthest from the origin.
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
Business, 13.11.2020 18:00
question
Mathematics, 13.11.2020 18:00
question
SAT, 13.11.2020 18:00
question
Mathematics, 13.11.2020 18:00
Questions on the website: 13722367