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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education