Published using Google Docs
Java Intro 5 - ShoppingCart
Updated automatically every 5 minutes

Java Intro 5 – Shopping Cart

(Final 10% for Second Language 1)

In class, we created a shopping example that uses the Switch statement.  Start with this file and save but create a new copy by going through the following process:

  1. File… Save As Assign5_Shopping.java.
  2. This will cause an error.  You need to change the CLASS line in your code to read: public class Assign5_Shopping {     Note that it will be case sensitive. It must match exactly what you typed for the file name.

Need a copy of the start file?  You can find it by clicking here.   Be sure to run the file before continuing to be sure it works.

The First 80% - add the following to the start file

The Last 20% - Part 2: A tough challenge

Update the stock of each item by subtracting what is ordered.  If an order is for more than what you have in stock, you must cancel that part of the order and warn the user that there are only X left.

How?