// Problem from Joyce Farrell, Java Programming Comprehensive, 1999

// "Create a program that displays the result of a sales transaction.  The calculation 
// requires three numbers.  The first number represents the product price.  The second 
// number is the salesperson commission.  These two numbers should be added together.  The 
// third value represents a customer discount; subtract this third number from the result of 
// the addition.  Create two classes.  The first class contains the method to do the 
// calculation.  The three numbers are passed to this method by a statement in the other 
// class.  The display is performed in the class that calls the calculation method.  Save 
// the program as Calculator.java...."

public class Calculator
{

public static void main(String[] args)
{
   System.out.println("Sales transaction="+ Calculation.calculation( 1000.00, 
                                                              30.00, 150.00));
} // end of main() method

} // end of Calculator class

class Calculation
{

public static double calculation( double productPrice, double salesCommission, 
                                  double customerDiscount)
{
  return productPrice+salesCommission-customerDiscount;

}// end of calculation() method

}// end of Calculation class

// end of file Calculator.java

1