pretzelpalace
Class PretzelStore

java.lang.Object
  |
  +--pretzelpalace.PretzelStore

public class PretzelStore
extends java.lang.Object


Constructor Summary
PretzelStore()
          Creates default new PretzelStore
PretzelStore(int inv, double price, double profit)
          Creates new PretzelStore - with non defaults
 
Method Summary
 double getMargin()
          report amount of profit per pretzel
 double getSalePrice()
          report price for each pretzel sold
 int getStart()
          report number of pretzels that have ever been in the store
 double getTotalInventoryValue()
          report total inventory value
 double getTotalProfit()
          report total profit for the day
static void main(java.lang.String[] args)
          dummy driver - not currnetly doing anything
 boolean orderNewBatch(int numBatches)
          increase current inventory levels by ordering a new batch of pretzels Pretzels come in batches of 12 Assume they arrive immediately Checks to ensure don't order negative batches returns boolean indicating whether successful
 boolean sell(int num)
          Sell given number of pretzels - reflecting in instance variables First ensure that that many are available returns boolean indicating whether successful
 boolean setMargin(double amt)
          Change profit margin Checks to ensure don't take margin negative returns boolean indicating whether successful
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PretzelStore

public PretzelStore()
Creates default new PretzelStore


PretzelStore

public PretzelStore(int inv,
                    double price,
                    double profit)
Creates new PretzelStore - with non defaults

Method Detail

getStart

public int getStart()
report number of pretzels that have ever been in the store


getSalePrice

public double getSalePrice()
report price for each pretzel sold


getMargin

public double getMargin()
report amount of profit per pretzel


getTotalProfit

public double getTotalProfit()
report total profit for the day


getTotalInventoryValue

public double getTotalInventoryValue()
report total inventory value


orderNewBatch

public boolean orderNewBatch(int numBatches)
increase current inventory levels by ordering a new batch of pretzels Pretzels come in batches of 12 Assume they arrive immediately Checks to ensure don't order negative batches returns boolean indicating whether successful


setMargin

public boolean setMargin(double amt)
Change profit margin Checks to ensure don't take margin negative returns boolean indicating whether successful


sell

public boolean sell(int num)
Sell given number of pretzels - reflecting in instance variables First ensure that that many are available returns boolean indicating whether successful


main

public static void main(java.lang.String[] args)
dummy driver - not currnetly doing anything