id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

abraskin@mbusd.org > squareOrRoot
prev  |  next  |  chance

The squareOrRoot method returns the square root of positive values and the square of negative values.


squareOrRoot(-9) → 81.0
squareOrRoot(9) → 3.0
squareOrRoot(2.5) → 1.5811388300841898

...Save, Compile, Run (ctrl-enter)

public double squareOrRoot(double num){ }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Copyright Nick Parlante 2017 - privacy