- Using the following data, calculate and print out the average miles per gallon for each vehicle.
- Round the output to the nearest 10th gallon.
- Be sure to use variables with easily recognizable names.
| Vehicle | Miles | Gallons |
|---|---|---|
| Royale | 286 | 9 |
| Koopa King | 412 | 40 |
| Pipe Frame | 361 | 18 |
| Badwagon | 161 | 11 |
- System.out
- Variable Assignment
- Math Operators
Mushroom Cup Prix Racer Average Miles/Per Gallon:
Royale averaged 31.8 m/g
Koopa King averaged 10.3 m/g
Pipe Frame averaged 20.1 m/g
Badwagon averaged 14.6 m/g