Question
For the following exercises, use the incremental development methodology to implement the program. For each exercise, identify the program tasks, create a design document with
For the following exercises, use the incremental development methodology to implement the program. For each exercise, identify the program tasks, create a design document with class descriptions, and draw the program diagram. Map out the development steps at the start. Present any design alternatives and justify your selection. Be sure to perform adequate testing at the end of each development step.
MyJava Coffee Outlet (see Exercise 29 from Chap. 3) decided to give discounts to volume buyers. The discount is based on the following table:
Each bag of beans costs $5.50. Write an application that accepts the number of bags ordered and prints out the total cost of the order in the following style:
Exercise 29 from Chap. 3:
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 is $1.80; a medium box, $1.00; and a small box, $0.60. The order is shipped in the least expensive manner. For example, the order of 52 bags will be shipped in four boxes: two large, one medium, and one small. The rule for packing is to fill the large and medium boxes completely; that is, the box is fully packed. Only the small boxes can have empty spaces. For example, to ship 52 bags, you could have used 3 large boxes, but that would leave the third box not fully packed. Develop a program that computes the total cost of an order. Display the output in the following format:
Order Volume Discount 5% of total price 2 25 bags 2 50 bags 2 100 bags 2 150 bags 2 200 bags 2 300 bags 10% of total price 15% of total price 20% of total price 25% of total price 30% of total price
Step by Step Solution
3.43 Rating (153 Votes )
There are 3 Steps involved in it
Step: 1
Average distances of two coordinate points Program Plan Import all the clas...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started