Question: write a public static method named totalCostOfRemainingInventory that takes three parameters and returns a double. The first parameter is a HashMap representing the selling price

write a public static method named "totalCostOfRemainingInventory" that takes three parameters and returns a double. The first parameter is a HashMap representing the selling price of each item in our store that we have been using throughout this lab. The second parameter is a HashMap representing our inventory at the start of the day (quantities of each item in the store). The third parameter is an ArrayList> representing all the orders that have been made in a day. This is an ArrayList where each element is a HashMap representing a customer's cart in the same format as the previous part. This method computes and returns the total cost to purchase all of our remaining inventory at the end of the day. That is, how much value we have in inventory after all the customer purchases have been proccessed. In all computations use the following prices and initial inventory

Selling prices: {eggs=1.79, orange juice=2.5, yogurt=1.99, bread=2.49, butter=2.39, peppers=1.49, chips=2.95, chocolate chips=2.39, popcorn=1.99, tomato sauce=0.99, frozen pizza=5.49, milk=2.09, bananas=0.49, hot dog=1.29, relish=0.99, frozen dinner=2.5, cereal=3.25, tuna fish=0.99, coffee=2.0, pasta=0.99, strawberries=3.5, apples=1.29, sugar=1.99, ketchup=2.89}

Initial inventory: {eggs=41, orange juice=18, yogurt=17, bread=25, butter=23, peppers=22, chips=32, chocolate chips=28, popcorn=46, tomato sauce=49, frozen pizza=19, milk=27, bananas=22, hot dog=37, relish=19, frozen dinner=34, cereal=44, tuna fish=23, coffee=33, pasta=23, strawberries=42, apples=35, sugar=44, ketchup=35}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!