Guest User

Untitled

a guest
Jul 17th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.25 KB | None | 0 0
  1. double currentTotal = 0.0;
  2. for (Car c : myCars) {
  3.     c.percent = Math.round((double) c.points / (double) total * 1000.0);
  4.     c.lowerPercentLimit = currentTotal + 1;
  5.     c.upperPercentLimit = c.lowerPercentLimit + c.percent;
  6.     currentTotal = c.upperPercentLimit;
  7. }
Add Comment
Please, Sign In to add comment