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

 

gaurav1780@gmail.com 03_loops > is_square_root
prev  |  next  |  chance

Complete the function squareRoot that will result in the following solution of isSquareRoot to pass the tests provided. Due to the nature of codingbat, you need to copy the partially-completed template below into the answer box first. boolean isSquareRoot(double a, double b) { double root = squareRoot(a); if(Math.abs(a - b*b) <= a/100.0) { return true; } return false; } double squareRoot(int val) { //to be completed }


is_square_root(10.5, 3.24) → True
is_square_root(1729.6174, 41.58) → True
is_square_root(10.5, 3.23) → True

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

def is_square_root(a, b):

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

Python Help

Difficulty: 6 Post-solution available

Copyright Nick Parlante 2017 - privacy