The goal of the following method is to calculate and return the average of four integers given as parameters. What is wrong in this method? *

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter3: Using Methods, Classes, And Objects
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question
100%
What is the solution of this problem?
The goal of the following method
is to calculate and return the
average of four integers given as
parameters. What is wrong in this
method?
public static void average(int a, int b, int c, int d) {
return (a + b + c + d) / 4.0;
The method name should start with a
capital letter.
A method cannot accept 4 paramters of
the same type.
The method does not return the
average of the 4 integer numbers.
All the above
None of the above
Transcribed Image Text:The goal of the following method is to calculate and return the average of four integers given as parameters. What is wrong in this method? public static void average(int a, int b, int c, int d) { return (a + b + c + d) / 4.0; The method name should start with a capital letter. A method cannot accept 4 paramters of the same type. The method does not return the average of the 4 integer numbers. All the above None of the above
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Troubleshooting
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT