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

 

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

This method is designed to determine which of the following is true about two lines: 1. They are the same line. 2. They are parallel lines. 3. They are perpendicular lines.; or 4. None of the above. The input parameters will be the integer values of the coefficients and constant for each line in two different arrays. For example lineType({4,6,1},{3,8,-2}) represents the lines: 4x+6y=1 and 3x+8y=-2. The method returns a 1, 2, 3, or 4 corresponding to the numbered possibilities above. So lineType({4,6,1},{3,8,-2}) returns a 4 since these lines are not the same, parallel, or perpendicular. Note that NONE of the lines will be horizontal or vertical lines in this problem.


lineType([1, -1, 6], [-1, 1, 3]) → 2
lineType([-10, 1, 500], [4, 40, -40]) → 3
lineType([2, 5, 4], [6, 15, 24]) → 2

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

public int lineType(int[] a, int[] 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

Java Help

Misc Code Practice

Difficulty: 410

Copyright Nick Parlante 2017 - privacy