Find Us On:

# Java - Distance Conversion

mattworley

## Distance Conversion - Solution

dickersonka

Attached is the solution to the Distance Conversion assignment including source and comments Attachments
LastNamepass9.java (2 K) Preview
System.out.print("Enter your choice: "); menuChoice = input.nextInt(); } //display output based on choice switch (menuChoice) { case 1: showKilometers(distanceInMeters); break; case 2: showInches(distanceInMeters); break; case 3: showFeet(distanceInMeters); break; case 4: quit = true; System.out.println("Bye!"); break; default: continue; } } } /** * Convert meters to kilometers */ private static

Meters_output.png (12 K) Preview

Screenshots

## Distance Conversion - Solution

mariobeka

Below you will find the java file requested, following the rules of the pdf file you provided. A Screenshot of the program working is also attached by. Attachments
LastNamepass9.java (1 K) Preview
" + kilometers + " kilometers.\n"); } /** * Convert meters to inches */ private static void showInches(double meters) { double inches = 0.0; inches = meters * 39.37; System.out.println(meters + " meters is " + inches + " inches.\n"); } /** * Convert meters to feets */ private static

Screen Shot 2014-09-20 at 12.32.45 AM.png (101 K) Preview

Screenshots

## DistanceConverter

uetian_cute

Attached are the code file and a screenshot of output Attachments
DistanceConversion.java (3 K) Preview
* * @param meters * @return the number of kilometers */ static double calculateKilometers(double meters) { double kilometers = meters * 0.001; return kilometers; } /** * This method should calculate inches that are equivalent to a

Capture.PNG (20 K) Preview

Screenshots