Respuesta :

Answer:

//import the Scanner class

import java.util.Scanner;

//Begin class definition

public class Converter {

   

   //Begin main method

   public static void main(String args[]) {

       //Create an object of the Scanner class

       //To allow for reading from standard inputs

       Scanner input = new Scanner(System.in);

       

       //Prompt the user to enter some number in meters

       System.out.println("Enter the number in meters: ");

       

       //Store the user's input in a variable of type double

       double meters = input.nextDouble();

       

       //Convert the user's input to feet

       //Since 1 meter = 3.28 feet

       double feet = meters * 3.28;

       

       //Display the result

       System.out.println("The number in feet is " + feet);

   

       

   } //End of main method

} // End of class definition

Sample Output

>> Enter the number in meters:

2

The number in feet is 6.56

Explanation:

The program above has been written in Java and it contains comments explaining each line of the code. Kindly go through the comments.

A sample output resulting from a run of the code has also been provided.

The snapshots of the program and the sample output have been attached to this response.

Ver imagen stigawithfun
Ver imagen stigawithfun