100 Beta Invites For CodeAnthem.com (C# & Java Tests Available)

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

41 Replies - 5752 Views - Last Post: 26 August 2010 - 10:52 AM

#31 Vestah  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 21
  • View blog
  • Posts: 86
  • Joined: 15-October 09

Re: 100 Beta Invites For CodeAnthem.com (C# & Java Tests Available)

Posted 15 August 2010 - 09:11 AM

I would like the problem specification to be more complete like how you should deal with integer overflow the Fibonacci problem.

I don't know if it was intentional, but I got faulty code handed out to me: public String[] sortChronologically(string[] daysOfWeek)
It should be String[]

It was a fun little time-waster.
Was This Post Helpful? 0
  • +
  • -

#32 SwiftStriker00  Icon User is offline

  • No idea why my code works
  • member icon

Reputation: 433
  • View blog
  • Posts: 1,599
  • Joined: 25-December 08

Re: 100 Beta Invites For CodeAnthem.com (C# & Java Tests Available)

Posted 15 August 2010 - 04:07 PM

Its seems in java if you omit curly braces it doesnt seem to like it. personally I like the site javabat.com better
Was This Post Helpful? 0
  • +
  • -

#33 Vestah  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 21
  • View blog
  • Posts: 86
  • Joined: 15-October 09

Re: 100 Beta Invites For CodeAnthem.com (C# & Java Tests Available)

Posted 15 August 2010 - 05:10 PM

I think I saw using an IDE was suggested somewhere.
I would recommend using one anyway to deal with Java's boilerplate.
Was This Post Helpful? 0
  • +
  • -

#34 hartra34  Icon User is offline

  • New D.I.C Head

Reputation: 10
  • View blog
  • Posts: 26
  • Joined: 04-November 09

Re: 100 Beta Invites For CodeAnthem.com (C# & Java Tests Available)

Posted 15 August 2010 - 06:03 PM

overall i thought the C# one fairly easy; although id like to know why i missed the Fib. sequence one, i double checked it before submitting it not to mention i've had to do it in like 5 different languages for classes alone...... but I tried to avoid as many class methods as possible and only use basic ones like substring(if that's not included it's fail); i reinvented the wheel as much as possible just to be sure; but it was a fun little exercise
Was This Post Helpful? 0
  • +
  • -

#35 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2062
  • View blog
  • Posts: 4,285
  • Joined: 11-December 07

Re: 100 Beta Invites For CodeAnthem.com (C# & Java Tests Available)

Posted 15 August 2010 - 06:19 PM

The explanation page says it lets you retake tests. Anyone see how to do that?
Was This Post Helpful? 0
  • +
  • -

#36 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2062
  • View blog
  • Posts: 4,285
  • Joined: 11-December 07

Re: 100 Beta Invites For CodeAnthem.com (C# & Java Tests Available)

Posted 15 August 2010 - 06:33 PM

This question looks easy but is not possible. I need a double or float return type. Even a Number return type would do.

Secure the Perimeter
Write a program that determines the perimeter of a polygon. The input is an array of point objects that contain the x and y values for each vertex. The vertices are connected in order from one to the next, and the first and last indices are also connected to close the shape. The output will be the number representing the perimeter of the shape in the same undefined units used for the x and y values.

public int calculatePerimeter(Point[] polygonVertices)
{


}

Consider a right angled triangle, two sides (not the hypotenuse) 1 unit in length. The answer would be (2 + SQRT(1)). Not an int!
Was This Post Helpful? 0
  • +
  • -

#37 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3116
  • View blog
  • Posts: 19,153
  • Joined: 14-September 07

Re: 100 Beta Invites For CodeAnthem.com (C# & Java Tests Available)

Posted 15 August 2010 - 06:51 PM

View Postcfoley, on 15 August 2010 - 06:19 PM, said:

The explanation page says it lets you retake tests. Anyone see how to do that?


Go back to take test part and start again.

View Postcfoley, on 15 August 2010 - 06:33 PM, said:

public int calculatePerimeter(Point[] polygonVertices){
}


I typecasted for that one, might explain why I got it "wrong".
Was This Post Helpful? 0
  • +
  • -

#38 AdaHacker  Icon User is offline

  • Resident Curmudgeon

Reputation: 452
  • View blog
  • Posts: 811
  • Joined: 17-June 08

Re: 100 Beta Invites For CodeAnthem.com (C# & Java Tests Available)

Posted 15 August 2010 - 08:41 PM

Wow, after reading everybody else's scores, I feel a lot less bad about my 4.0 on the C# test. It marked my answers to the Fibonacci and palindrome questions wrong, and I still can't see why. I compiled and tested all my answers, and I'm about 99% sure they were correct. It would be nice if they provided some feedback on why answers were rejected - at least a test input for which it fails. Not especially useful otherwise.

View Postcfoley, on 15 August 2010 - 07:33 PM, said:

Consider a right angled triangle, two sides (not the hypotenuse) 1 unit in length. The answer would be (2 + SQRT(1)). Not an int!

I think you mean (2 + SQRT(2)). If it were (2 + SQRT(1)), it actually would be an int. ;)
Was This Post Helpful? 1
  • +
  • -

#39 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2062
  • View blog
  • Posts: 4,285
  • Joined: 11-December 07

Re: 100 Beta Invites For CodeAnthem.com (C# & Java Tests Available)

Posted 16 August 2010 - 02:18 AM

I think you mean (2 + SQRT(2)). If it were (2 + SQRT(1)), it actually would be an int.  


Oh yeah. :) It was late when I posted last night!
Was This Post Helpful? 0
  • +
  • -

#40 baavgai  Icon User is online

  • Dreaming Coder
  • member icon

Reputation: 5901
  • View blog
  • Posts: 12,804
  • Joined: 16-October 07

Re: 100 Beta Invites For CodeAnthem.com (C# & Java Tests Available)

Posted 16 August 2010 - 03:01 AM

View Postcfoley, on 15 August 2010 - 07:33 PM, said:

public int calculatePerimeter(Point[] polygonVertices)


It's an array of points, not lengths. It would be more like:
dx = pt1.x-pt2.x;
dy = pt1.y-pt2.y;
perimeter += Math.sqrt(dx*dx + dy*dy);



Though, yes, float comes into play.
Was This Post Helpful? 0
  • +
  • -

#41 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2062
  • View blog
  • Posts: 4,285
  • Joined: 11-December 07

Re: 100 Beta Invites For CodeAnthem.com (C# & Java Tests Available)

Posted 16 August 2010 - 04:25 AM

I know. Just thought my example would be clearer if I described my shape in terms of lengths. :)
Was This Post Helpful? 0
  • +
  • -

#42 fashionnugget  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 163
  • Joined: 25-November 08

Re: 100 Beta Invites For CodeAnthem.com (C# & Java Tests Available)

Posted 26 August 2010 - 10:52 AM

I was so embarrassed by my first score (2) that I didn't even post about it. But I e-mailed them and they updated it to 9 (they said they fixed a lot of bugs). If you guys got a low score, you should e-mail them about it. Personally, I think it's okay that their beta had some bugs, but they should have made a very big disclaimer, for their own sake that is.
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3