COSC 1010 Introduction to Software Problem Solving

Fall 2010

Homework Assignment #1

Grandpa Simpson*
"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 8th, 11:00am CDT
Submit: Turn in your "Project1.java" using D2L dropbox, 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.

* - This project is not endorsed by Abe Simpson, any other fictional characters, or their legal copyright holders.
Back
[Revised 2010 Sep 01 11:41 DWB]