Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

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

Power Bi And Azure Integrating Cloud Analytics For Scalable Solutions

Authors: Kiet Huynh

1st Edition

B0CMHKB85L, 979-8868959943

More Books

Students also viewed these Databases questions

Question

g. Is the value of b equal to 0.5? Pg45

Answered: 1 week ago

Question

3. What are the current trends in computer hardware platforms?

Answered: 1 week ago