Advertisement
Guest User

Untitled

a guest
Nov 25th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1.  
  2. int CarRegister::getAllCarsWith(string * list, double upperPrice, double lowerPrice, double upperDistance, double lowerDistance) const {
  3.     int added = 0;
  4.     for (int i = 0; i < carCount; i++) {
  5.         double p = cars[i]->getPrice();
  6.         double d = cars[i]->getDistance();
  7.         if (lowerPrice <= p && p <= upperPrice && lowerDistance <= d && d <= upperDistance)
  8.             list[added++] = cars[i]->toString();
  9.     }
  10.     return added;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement