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

 

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

Write a method that accepts an array containing 4 integer values representing a 2 by 2 matrix. Your method returns the determinate of that matrix. If the integers in the array are {a, b, c, d} they represent a square matrix in the form: a is the upper-left corner, b is the upper-right corner, c is the lower-left corner, and d is the lower-right corner. The determinate of that matrix is a*d-c*b. Look at the test data for further examples.


crazyDeterminate([4, 7, 8, 14]) → 0
crazyDeterminate([18, 2, -3, 10]) → 186
crazyDeterminate([7, 0, 3, 10]) → 70

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

public long crazyDeterminate(int[] matrix) { }

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

Copyright Nick Parlante 2017 - privacy