COSC 060 Introduction to Software Problem Solving
Fall 2008
Homework Assignment #1
"The metric system is the tool of the devil!
My car gets forty rods to the hogshead and that's the
way I likes it."
-- Grandpa Simpson, A Star is Burns
Due: Wednesday, September 3rd, 11:59PM CDT
Submit: Turn in your "Project1.java" using the turnin command
on Morbius, as instructed in Lab.
Work is to be completed individually. You may submit multiple times, but
only the last turnin will be kept. The automatic submission system will
not accept work after the deadline.
The Distance Calculator
Measurement has been a tricky topic throughout history. Units of
length, mass, volume and temperature have evolved over time, competing
systems have waxed and waned, and definitions of base units have
gradually come to be founded more on universal scientific properties
and less on the length of the King's foot.
Write a program that accepts a positive, integer number of inches, and
calculates its equivalent in larger units from the following system:
Twelve inches per foot, three feet per yard, two yards per fathom, 110
fathoms per furlong, eight furlongs per mile, and three miles per league.
Example Runs
Example #1
Please enter a length in inches:
1
1 inches is equivalent to:
0 leagues,
0 miles,
0 furlongs,
0 fathoms,
0 yards,
0 feet, and
1 inches.
Example #2
Please enter a length in inches:
380159
380159 inches is equivalent to:
1 leagues,
2 miles,
7 furlongs,
109 fathoms,
1 yards,
2 feet, and
11 inches.
Back
[Revised 2008 Aug 25 21:46 DWB]