answer this question in Java and only if you are fully confident of the answer. The code
Question:
answer this question in Java and only if you are fully confident of the answer. The code should work without any errors. These are not stocks, but transactions that have occurred. Cashback value can be calculated using amount (third item on each transaction) * cashback value for respective company. The final item for each transaction is the date the transaction occurred in the format mm-dd-yyyy.
Data for question:
Transaction:
[ ["PURCHASE", "Starbucks", 100, 02152022], ["PURCHASE", "Starbucks", 10, 02162022], ["PURCHASE", "Amazon", 15, 02122022], ["PURCHASE", "Walmart", 30, 03192022], ["REFUND", "Walmart", 30, 03202022], ]
Cashback value:
[ ["Starbucks", 0.1], ["Amazon", 0.2], ["Walmart", 0.01], ]
Question:
i) Store the transaction list as a heap and the cashback value list as a hashmap
ii) Calculate the top cashback value for the month "02" (FEB)
Example output: 3 (since 15*0.2 > 10*0.1) for transactions that occurred in the month "02"
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill