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

 

andersoniii.edwin@cusd80.com > artillery
prev  |  next  |  chance

Artillery - The distance to the landing point of the projectile. It is launched at an angle, given in degrees and must be converted into radians with an initial velocity (velocity in feet per second), ignoring air resistance. The distance is given by the formula: distance = (velocity^2*sin(2*angle))/32.2 If the projectile comes within 1% of the distance to the target, return true. If the projectile doesn’t come close enough, return false. The method receives an integer for the angle, integer for initial velocity, and integer for distance.


artillery(20, 100, 200) → true
artillery(25, 100, 240) → true
artillery(60, 250, 1699) → false

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

public boolean artillery(int angle, int vel, int dist) { }

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: 125

Copyright Nick Parlante 2017 - privacy