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

 

gaurav.gupta@mq.edu.au conditions > canFitInside
prev  |  next  |  chance

Define a function when passed the widths and heights of two rectangles, returns true if the first rectangle can fit inside the second rectangle. Note that a rectangle must be STRICTLY smaller (not equal) to another rectangle to fit inside it. The test cases should help you with this.


canFitInside(10, 20, 10, 20) → false
canFitInside(2, 11, 10, 10) → false
canFitInside(11, 2, 11, 11) → false

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

boolean canFitInside(int width1, int height1, int width2, int height2) { }

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: 3 Post-solution available

Copyright Nick Parlante 2017 - privacy