Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 0.45 KB | None | 0 0
  1. public class Order
  2. {
  3.  // ...
  4.  public double Price()
  5.  {
  6.    return new PriceCalculator(this).Compute();
  7.  }
  8. }
  9.  
  10. public class PriceCalculator
  11. {
  12.  private double primaryBasePrice;
  13.  private double secondaryBasePrice;
  14.  private double tertiaryBasePrice;
  15.  
  16.  public PriceCalculator(Order order)
  17.  {
  18.    // Copy relevant information from the
  19.    // order object.
  20.  }
  21.  
  22.  public double Compute()
  23.  {
  24.    // Perform long computation.
  25.  }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement