Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Rules Roundup beta error  RSS feed

 
Brigette Anderson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm totally new to the site, but I just wanted to tell ya'll how glad I am that I found it. It has made studying for my J2CP exam much easier. And I LOVE the Rules Roundup! It is one of the best quizzer utilities that I have encountered in studying for any exam.
As to the error, Question #44 counts the right answer as wrong. For reference, it asks (approximately)
Given x=y--, which is true? x<y , x==y , x>y
I answered x>y and it counted it as wrong.

-B
[ October 27, 2002: Message edited by: Brigette Anderson ]
[ October 27, 2002: Message edited by: Brigette Anderson ]
 
Marilyn de Queiroz
Sheriff
Posts: 9080
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given x = y--;

Which of these will be true AFTER execution?

The correct answer is:

x == y

because:

y is assigned to x and THEN y is decremented.

Write a test program and try it.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

When run prints:
false
true
-Barry
 
Marilyn de Queiroz
Sheriff
Posts: 9080
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, yes
We'll have to change that.

And the reason for that is:
y is assigned to x, then y is decremented.
So by the end of the statement, x is greater than y.

Ok, I'll go get some sleep now.
[ October 28, 2002: Message edited by: Marilyn de Queiroz ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!