ACTIVITY 1.3

The instructions for exercise 1.3 are given below.
In this exercise, you will explore operators and
expressions.

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\1.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 'App.java' file to
	open it.

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

5.  Read the App.java file, and make sure you understand what
    the existing code there is doing.

6.  Beneath each of the comments containing '###', add code
    as directed by those comments.

7.  Create a new terminal window, and compile and run your
    program. Does it behave as you would expect?

8.  Beneath the comment // Experiment below... add two double
    floating point variables, and initialise them with some
    starting values:

    double x = 5, y = 12;

9.  Write code that uses Pythagoras's theorem to calculate
    the length of the hypotenuse of a triangle based on
    x and y:

    double h = Math.sqrt(x*x + y*y);

10. Add a line of code to display 'h' when the program is run.

11. Run your program. The hypotenuse value should be 13.

12. Add a line of code as follows:

    double oneSeventh = 1/7;

13. Add a line of code to output the result, and run your program.
    What value are you seeing for 'oneSeventh', and why?

14. Modify your code so that the 7 is preceded by a cast to a
    double, and run your program again. What happens?

IF YOU HAVE TIME ...

15. Explore how the remainder operator works (%) for negative
    numbers.

YOU HAVE FINISHED!


