writing methods =============== Exercise 1 ---------- Write a method called sum, that - takes two integer arguments - returns the sum of the two integer aguments public int sum(int a, int b) { return a + b; } Exercise 2 ---------- Write a method call vat that - takes the net price as argument (a double) - returns the price including VAT (which is 20% in Italy) public double vat(double price) { double tax = (20.0 / 100.0) * price; return price + tax; } // example: // double netprice = 100.0; // double price; // price = vat(netprice); Exercise 3 ---------- write just a method that: - takes an array of integers as its argument - returns a new array of integers with all the elements of the argument array in REVERSED order Example: if a[] contains 1, 2, 3, 4 and I pass a[] to this method, I'll get back another array that contains 4, 3, 2, 1. public int[] reverse(int[] a) { int size = a.length; int b[] = new int[size]; int finger = 0; // start copying from a[0] int pen = size - 1; // start assigning to b[size -1] while(pen >= 0) { b[pen] = a[finger]; finger++; // add 1 to finger pen--; // subtract 1 from pen } return b; }