Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double currentTotal = 0.0;
- for (Car c : myCars) {
- c.percent = Math.round((double) c.points / (double) total * 1000.0);
- c.lowerPercentLimit = currentTotal + 1;
- c.upperPercentLimit = c.lowerPercentLimit + c.percent;
- currentTotal = c.upperPercentLimit;
- }
Add Comment
Please, Sign In to add comment