ACTIVITY 2.3

In this activity, you will Modify your program to use interfaces

1. 	As before, open Visual Studio Code by double-clicking its
	icon on the desktop, or by selecting it from the application
	menu.
	
2.	Your instructor will have given you the path to a folder
	containing the course exercises. It will be something like
	Documents\Course\2.3. From the main menu bar, select
	File | Open folder... then in the folder search dialog
	that appears, navigate to the folder your instructor
	gave you. Click 'Select folder' to open the folder.

3.	In the Explorer bar at the left of the screen, Click
	the 'src' folder, then click the 'Vehicle.java' file to
	open it.

4.	Make sure the Vehicle.java tab is selected at the top of the
	window, if you get a Java overview window hiding Vehicle.java.

5.  Make a list of the public method names you find in this class

6.  Now open the file JetPlane.java. Put a tick next to the
    method names a JetPlane has that a Vehicle also has.

7.  You are now going to create an interface that describes
    capabilities both JetPlanes and Vehicles have. From the
    main menu, select File | New... to create a new file.

8.  Click on 'Select language' and choose Java from the
    drop-down list.

9.  From the main menu, select File|Save As... and navigate 
    to the src folder, saving the file as Drivable.java.

10. The file will be automatically populated with an empty
    class called 'Drivable' but you will select 'interface'
    from the drop-down to convert it into an interface.

11. Add the following method declarations from your ticked
    list into the body of the interface:

    String GetMake();
    int GetTopSpeed();
    String CalculateJourney(double miles);

12. Open the file Vehicle.java again and modify the class
    so that it mow implements the interface:

    public class Vehicle implements Drivable {

13. Do the same thing for the JetPlane class

14. Open the file App.java. Notice that this has code in
    already that creates a Vehicle and reports on it,
    then creates a JetPlane and reports on that.

15. At the top of the App class, add a new method that
    takes a Drivable as an argument:

    public static void ReportDrivable(Drivable v) {

    }

16. Copy the first pair of System.out.println lines from
    the main() method into the new method body.

17. Edit the copied lines of code so that they access the
    methods of v rather than myCar:

        System.out.println("My vehicle is a " + v.GetMake());
        System.out.println(version.CalculateJourney(30));

18. Now modify the two separate lines of code that invoke
    'new' to create vehicles or jet planes in the main()
    method, so that they store their objects into a Drivable
    rather than a Vehicle or JetPlane:

        Drivable myCar = new Vehicle("VW Golf", 120, 7.5, 56);

    and:

        Drivable myPlane = new JetPlane("Tornado Jet", 950, 1.5, 52000);

19. Lastly, change the System.out.println pairs of lines in main()
    so that they call the ReportDrivable method instead:

        ReportDrivable(myCar);
    
    and:

        ReportDrivable(myPlane);

20. Save all files, launch a new terminal, and compile and run.
    Make sure your program still reports the right results.

YOU HAVE FINISHED!
