Let's put together a rectangle

  • 3
  • unavailable
OKEA sells unassembled space shuttles. They are all rectangular (we don't know why). These guys ordered a program from Company X for automatically generating shuttle instructions. You've been assigned to create a rectangle class and initializer methods for whatever life might throw at it.
You can't complete this task, because you're not signed in.
Comments(7)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Kent HerveyLevel 7
20 October, 23:52
BTW, 4 is the maximum number of initializers because overiding can only be done by changing the signature which means parameter list. There are only four parameters, so that is the maximum. Java is looking for variable types, not order. So (int top, int left) and (int left, int top) looks the same and would be a conflict.
Kent HerveyLevel 7
20 October, 23:39
I am starting this very confused For example: - width/height is not specified (both are 0) - height is not specified (it is equal to the width), we'll create a square So why say height not specified twice. And if square, then left=top. and if square, then width and height can't be 0 Well, somebody says that left and top are not lengths of a side, but rather the position of the left and top of the rectangle...okay I completed it with just four initialize and no method to copy another rectangle....I passed, though I do something that might give me a bad score, but saves time. I verify after every step.
Mihály DombiLevel 8 , Szeged
27 August, 22:27
I made this task but I didn't know what I did. What's the point? Why there are top and left variables? They are the same I guess as width and height variables. I mean... a rectangle has 2 variables, not 4.. Somebody please explain this task. Thank you in advance..
Adrie TaniwidjajaLevel 11 , Bandung
7 May, 05:25
This task's requirement is confusing. What is the meaning of the requirement No. 3 until No. 6? It should be written like this: 3. The class must have at least one initialized method with one input parameter 4. The class must have at least one initialized method with two input parameter 5. The class must have at least one initialized method with three input parameter 6. The class must have at least one initialized method with four input parameter but if you just make 4 initialized method ( 1 for each requirement) you will not completed this task. you must add another 1 initialized method. So the total number of initialized method must be 5 not 4 !
RomanLevel 41
7 May, 08:02
4 initialized methods are enough to complete the task
Adrie TaniwidjajaLevel 11 , Bandung
9 May, 10:27
I already try to make only 4 initialized method with many variation and I never get pass the task. But when I made them to 5 finally I can passed the task.
RomanLevel 41
10 May, 06:34
Give me your codes with 4 and 5 initialized methods, please.