Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please sir in gava with out comments , and please write code in netbeans, and give me output please thanke you so much 8. Conversion
please sir in gava with out comments , and please write code in netbeans, and give me output please
8. Conversion Program Write a program that as the wt to enter a distance in meters. The program will then pre sent the following mena of selections: 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. Here are the specific requirements Write a vald method named showkilometers, which accepts the number of meters as an argument. The method should display the argument converted to kilometers. Con vert the meter to kilometers using the following formulat kilometers - meters 0.001 Write a void method named showinches, which accepts the number of meters as an argument. The method should display the argument converted to inches. Convert the meters to inches sung the following formular inchester 37.37 Write a void method named showreet, which accept the number of meters as an argument. The method should doplay the argument converted to feet. Convert the meters to feet using the following formular feet - meters. ).281 Write a void method named menu that displays the menu of election. This method should not accept any arguments The program should continue to display the menu until the mer enters 4 to quit the program The program should not accept negative numbers for the distance in meters. If the user select an invalid choice from the menu, the program should display an error message. Here is an example session with the program, using console input. The user's input is shown Inter a distance is mters: 500 (Enter) 1. Convert to kilometern 2. Convert to inches 3. Convert to feet 4. Quit the program Enter your choice 1 (Enter) 500 meters to 0.5 kilometers. 1. Convert to kilometers 2. Convert to inches 3. Convert to feet 4. Qust the program in hold Programming Challenges 315 Inter your choice 3 (Enter) 500 meters in 1840.5 tot. 1. Convert to kilometers 2. Convert to inches 3. Convert to teet 4. Out the program Inter your choice 4 [inter bye thanke you so much
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started