Hello all!
So, I'm creating a program that deals with a discount loyalty system. When the customer buys $100.00 worth of items, they get a $10.00 discount. This discount needs to be a boolean method (discountReached()). Thus far, I have:
class Customer { //Declare variables double totalCost; double discount = 10; public Customer() { totalCost = 0; } public void makePurchase(double amount) { totalCost = totalCost + amount; } public double getTotal() { return totalCost; } }
So, I have the total amount all worked out. Now I don't know how to go about having the boolean method ONLY run once when the total reaches over $100.00.
Any help is appreciated!
Thanks,
Scorks