public class Store {
// Total the customer's items at the check-out
public static double totalCost(Product[] cart){
}
// Display the customer's shopping cart items
public static void showCart(Product[] cart) {
}
public static Product[] customer1() {
}
public static Product[] customer2() {
}
public static void main(String[] args) {
// Start of program
Product shoppingCart[]; // list of customer's products
shoppingCart = customer1(); // Replace with customer2() for other test case
showCart(shoppingCart);
double cost = totalCost(shoppingCart);
System.out.println("Total cost is " + cost);
}
}
| Type of
Prodcuct |
Name |
Price |
Extra
Attribute |
| Product |
Candy bar |
0.99 |
|
| Bulk |
Sugar |
0.5 |
20 |
| Bulk | Flour |
0.6 |
50 |
| Bulk | Ketchup |
1.25 |
100 |
| Type of
Prodcuct |
Name |
Price |
Extra
Attribute |
| Product |
Candy bar |
0.99 |
|
| Produce |
Apple |
1.67 |
1.3 |
| Member |
Radio |
10 |
true |
| Member |
Toy |
10 |
false |
| Bulk |
Sugar |
0.5 |
20 |
| Bulk | Flour |
0.6 |
50 |
| Bulk | Ketchup |
1.25 |
100 |
/* COMP 110 F07
* Summary:
* Date:
* Author:
*/