Having completed projects that use simple arithmetic expressions, we
will be continuing to build on that knowledge with this project. We
will also include a test of your knowledge of the if and
if/else
statements. You will also be required to do some
basic problem solving and organization of conditional statements, as
well as basic keyboard input and output.
MyJava Coffee Outlet runs a catalog business. It sells only one type of coffee beans, harvested exclusively in the remote area of Irian Jaya. 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 bags of 2 lb, the medium 10 bags, and the small 5 bags. The cost of a large box if $1.80; a medium box, $1.00; and a small box, $0.60. The order is shipped using the least number of boxes. For example, the order of 22 bags will be shipped in two boxes, one large and one small. In addition MyJava Coffee Outlet has decided to give discounts to volume buyers. The discount is based on the following table:
| Order Volume | Discount |
| >= 25 bags | 5% of total price |
| >= 50 bags | 10% of total price |
| >= 100 bags | 15% of total price |
| >= 150 bags | 20% of total price |
| >= 200 bags | 25% of total price |
| >= 300 bags | 30% of total price |
Develop an application that computes the total cost of an order, including cost of the beans, the appropriate discount, and the cost of the boxes. Display the output in the format specified in the Output Specifications section.
Proj3.java.
The output from a single run of your program must match the following. Your output should look as much like the following as possible.
Please enter the number of bags of coffee purchased: 53
53
Number of Bags Ordered: 53 - $291.50
Discount:
10% - $29.15
Boxes Used:
2 Large - $3.60
1 Medium - $1.00
1 Small - $0.60
Your total charge is: $267.55
Another:
Please enter the number of bags of coffee purchased: 21
21
Number of Bags Ordered: 21 - $115.50
Boxes Used:
1 Large - $1.80
1 Small - $0.60
Your total charge is: $117.90
I have given
you 3 possible test cases above which you can run by hand. The output from those
three sets of data is in out.dat. Run as many test cases
as you think necessary to make sure your program works under all normal input
conditions.
Normally you will be expected to determine what documentation and
formatting will be necessary for your project on your own, with the help
of the Style Guide in your Lab manual. Fully correct documentation must
follow the javadoc conventions and include:
} // main
Honor Code. The honor code applies to all programming done in this course. Reread the CS Department's document: Programming Assignments and the Honor Code.
Start now .. your mileage may vary