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

 

amjadm@miamioh.edu > areLocked
prev  |  next  |  chance

Given two doubles, they are locked when both numbers have the same number of digits, and corresponding digits are either both even or both odd. e.g. num1 = 12.31, num2 = 30.33. 1 and 3 are both odd. 2 and 0 are both even. 3 and 3 are both odd, and 1 and 2 are both odd.


areLocked(6.0, 2.0) → true
areLocked(61.1, 27.9) → true
areLocked(66.0, 7.0) → false

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

public boolean areLocked(double num1, double num2) { }

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

Copyright Nick Parlante 2017 - privacy