Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int CarRegister::getAllCarsWith(string * list, double upperPrice, double lowerPrice, double upperDistance, double lowerDistance) const {
- int added = 0;
- for (int i = 0; i < carCount; i++) {
- double p = cars[i]->getPrice();
- double d = cars[i]->getDistance();
- if (lowerPrice <= p && p <= upperPrice && lowerDistance <= d && d <= upperDistance)
- list[added++] = cars[i]->toString();
- }
- return added;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement