## CS 1401, Quiz #6, version a

**Date:** Tuesday, October 11, 2005

**Name** (please type legibly, ideally in block letters):
______________________________________________________________________

7. Let us assume that the distances to different planets
in light-years are stored, line by line, in a file *planets.dat*. Write down a
piece of code that, given this file, produces a new file *days.dat* in which the same distances are listed in light-days.

8. Define a class
*Car* with three fields *make*, *horsepower*, and
*wheelRadius*,
constructor method, and methods which return the wheel's circumference and area.
Use constant(s) and methods from the Math package.

*Reminder:*

- the circumference of a wheel is equal to 2 times PI times its radius;
- the area of a circle
is PI times the radius squared; use a method from the Math package
to compute the second power of the radius.