Java Reference
In-Depth Information
3.
Write a program that defines a floating point variable initialized with a dollar value for your
income and a second floating point variable initialized with a value corresponding to a tax
rate of 35 percent. Calculate and output the amount of tax you must pay with the dollars and
cents stored as separate integer values (use two variables of type
int
to hold the tax, perhaps
taxDollars
and
taxCents
).
4.
The diameter of the Sun is approximately 865,000 miles. The diameter of the Earth is
approximately 7600 miles. Use the methods in the class
Math
to calculate:
the volume of the Earth in cubic miles
❑
the volume of the Sun in cubic miles
❑
the ratio of the volume of the Sun to the volume of the Earth
❑