# In Class Exercises. Chapter 3, problem 25  Develop an application to compute the total cost of an order for MyJava Coffee Outlet including the boxes.

## Presentation on theme: "In Class Exercises. Chapter 3, problem 25  Develop an application to compute the total cost of an order for MyJava Coffee Outlet including the boxes."— Presentation transcript:

In Class Exercises

Chapter 3, problem 25  Develop an application to compute the total cost of an order for MyJava Coffee Outlet including the boxes used to ship it.  Coffee is sold in 2-lb bags which cost \$5.50 each.  SizeHoldsCost Large20\$1.80 Medium10\$1.00 Small5\$0.60

Output Format Number of Bags ordered: 52 Cost of Coffee: \$286.00 Boxes Used: 2 Large - \$3.60 1 Medium - \$1.00 1 Small - \$0.60 Your total cost is: \$291.20

Development Process  Any questions about the specification?  What classes do we need to use?  Which do we need to write?  How should we break down the development?

Adding Arrival date  Use today's date as the date of order  Expected arrival date is two weeks from date of order. Date of Order: September 13, 2005 Expected Arrival: September 13, 2005

Prime Numbers  A prime number is a number greater than 1 which is divisible only by 1 and itself.  Write a method that returns true if its parameter is a prime number  Write code to generate a list of all the primes between 1 and some number.

Fibonacci Numbers  The Fibonacci sequence is defined by f(1) = f(2) = 1 f(n) = f(n-1) + f(n-2)  Write code to calculate the first N Fibonacci numbers

Download ppt "In Class Exercises. Chapter 3, problem 25  Develop an application to compute the total cost of an order for MyJava Coffee Outlet including the boxes."

Similar presentations