/**
* Determine the profit from a sale.
*
* @author Kris Pepper
* @version 2/6/07
*/
public class Profit
{
public static void
main(String[] args)
{
double DRESSER_PRICE = 100.00;
double MIRROR_PRICE = 50;
double TABLE_PRICE = 250;
double DRESSER_COST = 75.00;
double MIRROR_COST = 40.00;
double TABLE_COST = 50.00;
double TAX_RATE = .10;
int
DRESSER_QTY = 3;
int
MIRROR_QTY = 3;
int
TABLE_QTY = 2;
double itemProfit, totDresserProfit, totMirrorProfit, totTableProfit;
itemProfit =
DRESSER_PRICE + (TAX_RATE * DRESSER_PRICE)
- DRESSER_COST ;
totDresserProfit = itemProfit * DRESSER_QTY;
itemProfit =
MIRROR_PRICE + (TAX_RATE * MIRROR_PRICE)
- MIRROR_COST ;
totMirrorProfit = itemProfit * MIRROR_QTY;
itemProfit =
TABLE_PRICE
- TABLE_COST ;
totTableProfit = itemProfit * TABLE_QTY;
double allItemProfit = totTableProfit + totMirrorProfit +
totDresserProfit;
System.out.println("The total profit is " + allItemProfit);
}
}