import java.io.*;
import SimpleExtendsMetre;

public class SimpleChangeExtendsCall
{

	public static void main (String args[]) throws IOException 
	{

		//create a bufferreader object rd to read the InputStreamReader
		BufferedReader rd = new BufferedReader(new InputStreamReader(System.in));
		
		SimpleExtendsMetre sm = new SimpleExtendsMetre();

		String answer;
		String s = new String();
		double metres;
		double inches;
		do
		{// use of do while loop
		System.out.println("Enter number of inches ");
		System.out.flush();// clears the input stream

		s=rd.readLine();
		Double m= new Double(s); // converts string to float
		inches = m.doubleValue();  // sets metres equal to m 

		// converts method to convert inches to metres
		metres = sm.convertInchesToMetres(inches);
		System.out.println("There are " + metres + " metres in " + inches + " inches.");

		// TESTTING THE INHERITANCE
		System.out.println("This part calls the inherited method convertMetre ");
		System.out.println("Enter the number of metres ");
		System.out.flush();
		s=rd.readLine();
		Double me=new Double(s); // Converts the string to a float
		metres= me.doubleValue(); // sets metres equal to me
		inches = SimpleExtendsMetre.convertMetre(metres); // uses the convert method to convert metres to inches .
	
		System.out.println("There are " + inches + " inches in " + metres + " metres.");
		
		//This is for the continuation loop
		System.out.println("Do you want to continue. Enter Y to carry on, anything else to quit ");
		System.out.flush();
		answer=rd.readLine();
	        } while(answer.equalsIgnoreCase("Y"));

	}

}