Program Name: FinalExamConversion. Write a program that asks the user to enter a distance in meters. The program will then present the following menu of selection: Convert to Kilometers Convert to Inches Convert to Feet Quit the Program The program will convert the distance to kilometers, inches or feet, depending on the user’s selection. Write the following methods: getInput: This method prompts user to enter a distance in meters. Returns input to the caller. TestData: Cannot accept negative numbers. Menu: This method does not accept any arguments, but returns a selection to the caller. Convert2Kilometers: This method receives a parameter, converts to kilometers (meters * 0.001) and returns the value to the caller. Convert2Inches: This method receives a parameter, converts to inches (meters * 39.37) and returns the value to the caller. Convert2Feet: This method receives a parameter, converts to feet (meters * 3.281) and returns the value to the caller. DisplayData: This method receives the input and the converted value.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 4GZ
icon
Related questions
Question
  1. Chapter 5, Programming Challenge #8, Conversion Program (page 314). Program Name: FinalExamConversion. Write a program that asks the user to enter a distance in meters. The program will then present the following menu of selection:
    1. Convert to Kilometers
    2. Convert to Inches
    3. Convert to Feet
    4. Quit the Program

The program will convert the distance to kilometers, inches or feet, depending on the user’s selection. Write the following methods:

  • getInput: This method prompts user to enter a distance in meters. Returns input to the caller.
  • TestData: Cannot accept negative numbers.
  • Menu: This method does not accept any arguments, but returns a selection to the caller.
  • Convert2Kilometers: This method receives a parameter, converts to kilometers (meters * 0.001) and returns the value to the caller.
  • Convert2Inches: This method receives a parameter, converts to inches (meters * 39.37) and returns the value to the caller.
  • Convert2Feet: This method receives a parameter, converts to feet (meters * 3.281) and returns the value to the caller.
  • DisplayData: This method receives the input and the converted value.

 

See p. 314 for other methods.

HINT: Use switch statement for menu selection!

Test Data: see example given in the book. Use the same format.

Submit:

  1. Algorithm
  2. A complete Java Program with comments/documentation
  3. Output

Please for this particular problem the style is very important of the java program, Declared variables in a proper way, Documentations and comments must be like the book which is Starting out with Java from Control Structures through objects 7th edition.

Please put methods first before main methods.

PLEASE COMPLETE THIS PROGRAM WITH PROPER SCREENSHOTS AND EVERY THING A COMPLETE ALGORITHM, COMPLETE JAVA PROGRAM WITH COMMENTS/DOCUMENTATION AND THE OUTPUT. PLEASE HELP ME ANSWER THIS QUESTION VERY CORRECTLY.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 6 images

Blurred answer
Knowledge Booster
Returning value from Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT