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 16:30
Technician a says that a dry sump system uses no oil storage sump under the engine. technician b says that a wet sump system uses no oil storage sump under the engine. who is correct?
Answers: 3
question
Computers and Technology, 23.06.2019 15:00
Barbara is interested in pursuing a career in the science and math pathway. which qualifications will her reach that goal? a.an advanced knowledge of physics and math b.an advanced knowledge of engineering and math c. an advanced knowledge of physics and robotics an d. advanced knowledge of machinery and math
Answers: 2
question
Computers and Technology, 24.06.2019 07:00
Why would a business likely use a java applet - to back up their data files for the business - to create a program that a customer can launch in their web browser - to create music on a powerpoint presentation - to organize files on their company directory
Answers: 3
question
Computers and Technology, 24.06.2019 22:30
Distinguish between a skill resume and a chronological resume and explain when it is best to use each format
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
Social Studies, 07.10.2019 06:30
question
Mathematics, 07.10.2019 06:30
question
Physics, 07.10.2019 06:30