Need Help ?
Have a Question ?

(Solved): 4. For Each Of The Following Java Methods, State Whether Or Not It Meets The Definition Of A Functio ...

4. For each of the following Java methods, state whether or not it meets the definition of a function with domain and codomai

4. For each of the following Java methods, state whether or not it meets the definition of a function with domain and codomain Color. If not, state the reason why. a. /** * Returns a new Color that is the negative of the given Color public static Color negative (Color c) { return new Color(255 - C.red, 255 - c.green, 255 - c.blue) * Returns a new Color that grayscales' the given Color by averaging its rgb values public static Color grayscale(color c) { int average = (c.red + c.green + c.blue) / 3; return new Color (average, average, average); * Returns a new Color with the same green and blue values * as the given color, but with a red value entered by the user public static Color setRed(Color c) { int newRed; // read in a value from the user to use as the new red value try (Scanner in = new Scanner(System.in)) { System.out.println("Enter a new red value: "); newRed = in.nextInt(); return new Color (newRed, c.green, c.blue);

Expert Answer


We have an Answer from Expert Buy This Answer $6