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

 

jebbert@volusia.k12.fl.us > test2022_01_20_HL_hit
prev  |  next  |  chance

This method deals with a single target and a single shot at that target. The coordinates of both the target and the location where the shot hits are given in 3-dimensional space. Write a method that returns 'true' if the distance between the target and the shot is less than 'range' and 'false' if the shot is out of range. Look at the test data for examples.


test2022_01_20_HL_hit([100, 500, 200], [120, 490, 200], 22) → false
test2022_01_20_HL_hit([100, 500, 200], [120, 490, 200], 23) → true
test2022_01_20_HL_hit([100, 500, 200], [120, 490, 200], 22.4) → true

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

public boolean test2022_01_20_HL_hit(double[] targetCoords, double[] shotCoords, double range) { }

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

Difficulty: 290

Copyright Nick Parlante 2017 - privacy