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.
- 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:- 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.
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:
Algorithm - A complete Java Program with comments/documentation
- 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.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 6 images