Santa Monica College API to Manage Shopping Cart Discussion
Description
If you have a class called ShoppingCart, List at least three API (method) that helps manage the ShoppingCart.
For example
public class ShoppingCart {
public static void main(String[] args) {
public double getTaxRate() { // Tax rate of 15%
double taxRate;
return taxRate = 0.15;
}
public String addItem(int quantity, double price, double totalPrice) { // Additems to cart
double add;
add = totalPrice + (quantity * price);
return (“Your shopping cart has a total of $” + add);
}
public String clearCart(int quantity, double totalPrice) { // Clears cart of any quantity and sets price to 0
int clearQuantity;
double clearPrice;
clearQuantity = quantity * 0;
clearPrice = totalPrice * 0;
return (“Your shopping cart has been cleared of all items.”);
}
}
We offer the best custom essay writing services at an affordable rate. We have done this assignment before, we can also do it for you.