Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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"

Step by Step Solution

3.48 Rating (168 Votes )

There are 3 Steps involved in it

Step: 1

Heres a Java code that addresses the given question import javautil class Transaction String type St... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Operating System questions