Java Coffee Outlet runs a catalog business selling one type of rare coffee. The company sells the coffee in 2-lb bags only, and the price of a single 2-lb bag is $5.50. When a customer places an order, the company ships the order in boxes. The boxes come in three sizes: the large box holds 20 2-lb bags, the medium holds 10 2-lb bags, and the small box hold 5 2-lb bags. The cost of a large box is $2.00, a medium box is $1.00, and a small box $0.50. The order is shipped using the least number of boxes with the cheapest cost. For example, the order of 25 bags will be shipped in two boxes, one large and one small. Write a class called CoffeeBags with a method called computeCost, which takes the total number of bags ordered as an integer parameter. The computeCost method should figure out how much an order costs, with output as follows:
Your total cost is: $ 291.5
Good luck!
Assignment from C. Thomas Wu, An Introduction to Object Oriented Programming With Java, McGraw-Hill, 2001.