Ask your own question, for FREE!
Mathematics 9 Online
OpenStudy (anonymous):

Which of the following shows the header for a method that accepts a double value and returns a double? public static void sqrt(double num) public static double sqrt(25) public static double sqrt(double 25) public static double sqrt (double num) I'm pretty positive that "public static double sqrt (double num)" is the correct answer but I don't know for sure.

OpenStudy (anonymous):

@AlexandervonHumboldt2

OpenStudy (anonymous):

@Directrix

OpenStudy (anonymous):

@DanJS

OpenStudy (anonymous):

@Godlovesme

OpenStudy (godlovesme):

sorry idk :( @Nnesha @sleepyjess @jim_thompson5910 help

OpenStudy (anonymous):

lol

OpenStudy (anonymous):

Java~ Such a wonderful thing to try and start and finish in a single week

OpenStudy (sleepyjess):

ummmmm I have no idea what all that means... sowwy :(

jimthompson5910 (jim_thompson5910):

idk about the "public static" part, but luckily that's in each answer choice the format for a function/method header is <return type> <function name>(<argument type>) http://www.homeandlearn.co.uk/java/java_methods.html

OpenStudy (anonymous):

hmm...

OpenStudy (anonymous):

yea I knew that that's kinda why I went with the fourth answer. Does it seem like a reasonable answer to you @jim_thompson5910 ...?

jimthompson5910 (jim_thompson5910):

yes the others are either missing key things or have 25 (which is a constant, not a variable) in them

OpenStudy (anonymous):

It's always a little difficult for me to be 100% correct cause there aren't a ton of things online about constructing lines of code online. Most of the things are over the counter books that don't always have the best explanations

OpenStudy (anonymous):

Would you mind looking over a few more questions?

jimthompson5910 (jim_thompson5910):

A) public static void sqrt(double num) is missing the return type of double ------------------------------------------------------- B) public static double sqrt(25) the input is 25, which is a constant, when it should be a variable ------------------------------------------------------- C) public static double sqrt(double 25) the input type is given, but it's still a constant ------------------------------------------------------- D) public static double sqrt (double num) both return type and argument type are given to be doubles

jimthompson5910 (jim_thompson5910):

ok, just a few more, but no guarantees since I'm not really fluent in Java

OpenStudy (anonymous):

That's alright :) I just want a second opinion. I'm not looking for indefinite answers.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!