Question: 8. (10 points) You are glven a class named a method for this class named toString) which r hours is 12 and minutes is 30,
8. (10 points) You are glven a class named a method for this class named toString) which r hours is 12 and minutes is 30, toString Clock with 2 attributes: hours and minutes. Write returns the time as a String; for example, i sSte s 30, the toString method should return 12:30; f hours is 9 and t should return "9:05". Your method should not print anything. 9. (18 points) Write a method to compute and return the value of the average element of an array of integers. The method is passed an array of integers, and should work for any array of integers. For example, if the array has 4 elements: (70, 80, 81, 90), the method should return (70+80+81 +90)/4 -80.25. If the array has no elements, return-1. For full credit, use method decomposition, L.e. call and define a helper method to compute the sum of the elements of the array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
