Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can I get the autolab instructions and the part 4 separately AutoLab Instructions In a class named Lab3 write a public static method named computeProfit

Can I get the autolab instructions and the part 4 separately

image text in transcribedimage text in transcribed

AutoLab Instructions In a class named "Lab3" write a public static method named "computeProfit" 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 also a HashMap but this one represent our cost for us to purchase each type of item for our inventory. 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 our total profit for this day. Note that the profit of selling an item is the cost to the customer (prices in the first parameter) minus our cost to purchase the item for our inventory (second parameter). In all computation, use the following prices. 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) Purchase prices: eggs-1.2, orange juice-1.0, yogurt=1.0, bread-1. 1 5, butter= 1 .95, peppers-0.99, chips-0.9, chocolate chips-1.79 popcorn-0.99, tomato sauce-04, frozen pizza-2.6, milk= 1.89, bananas-0.39, hot dog-0.79, relish-0.49, frozen dinner= 1.5, cereal= 1.55 tuna fish-0.49, coffee 0.6, pasta-0.5, strawberries-1.99, apples-0.99, sugar-1.5, ketchup 0.98)

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

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago