Meaningless Drivel is fun!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes New Assertions Exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "New Assertions Exam" Watch "New Assertions Exam" New topic
Author

New Assertions Exam

Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
I just uploaded a beta version of a
new assertions exam. At this time, it only has eight questions. I will be adding more questions over the next few days.
This beta version of the assertions exam is not accessible from the home page of my mock exam. Instead, it is only available at the link provided above.
It is possible that I might upload changes to the beta version of the assertions exam at any time. To avoid opening a question and answer page that are out of sync, please open both the question and answer pages in separate windows.
Please give it a try and let me know what you think. Is it too easy, too difficult, or just about right? Are there any answers that you don't agree with?


Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787
Hi Dan:
Good questions. As usual your question require substaintial brain work (for me at least). However, I have doubts following question:
Question 8

Which statements are true?
a. With assertions enabled it prints an error message.
b. With assertions enabled it prints nothing.
c. With assertions disabled it prints an error message.
d. With assertions disabled it prints nothing.
e. An assertion should not be placed at any location that the programmer believes will never be reached under normal operating conditions.
f. The assert statement indicates that the programmer expects no more than one boolean, b1, b2, or b3 to be true.
g. The assert statement is being used to verify an invariant.
h. A compiler error is generated.
i. None of the above.
The answer is a d f g.
The wording of a is bit confusing. Do you mean to say that AssertError is also a regular error message?
f does NOT seem to be right. The statement:
assert b3 & !b2 & !b1;
expects b2 and b1 to be true. That is more than one true.
g. Which invariant are you refering to?
Thanks Dan for your great work.
Barkat
Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787
I retract. I think the original option f stated as:
f. The assert statement indicates that the programmer expects no more than one boolean, b1, b2, or b3 to be true.
should be stated as:
f. The assert statement indicates that the programmer expects no more than one boolean to be true and that boolean should be b3.
[ September 11, 2002: Message edited by: Barkat Mardhani ]
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Barkat,
Thank you for your feedback.
I only have about a minute so I can only write a very quick response now.

f. The assert statement indicates that the programmer expects no more than one boolean, b1, b2, or b3 to be true.

The assert statement is placed after a series of if/else statements. The first "if" is processed if all of the booleans are false. The second is processed if only b1 is true. The third is processed if only b2 is true. The assert statement verifies that only b3 is true.

assert b3 & !b2 & !b1;

This suggests that the programmer expects the three booleans to be in only one of four states--all are false or only one is true. This expectation is an example of an invariant and the assertion is used to verify that the expectation is correct.
Barkat Mardhani
Ranch Hand

Joined: Aug 05, 2002
Posts: 787
Hi Dan:
Based on our explaination f should be reworded to:
asert statement and all if statements indicate that programer is expecting only one true..
Other option is in my second post above...
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Barkat,
Yes, I agree. I think I'll upload the following version.

The combination of the if/else statements and the assert statement indicate that the programmer expects no more than one boolean, b1, b2, or b3 to be true.

Thank you.
Ioana Danescu
Greenhorn

Joined: Aug 28, 2002
Posts: 9
Thank you for your good questions!
I'm looking forward for more questions about assertions, maybe using the other form of the statement too?
Niral Trivedi
Ranch Hand

Joined: Nov 26, 2001
Posts: 46
Thanks Dan..
I was looking forward to your Assertion exam.. questions are really good as usual..
And as you are keeping your contineous effort.. May I ask you for more??
How about a Thread questions on your exam???
Thanks again..
Niral
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Originally posted by Niral Trivedi:
Thanks Dan..
How about a Thread questions on your exam???
Niral

Yes, I will start working on a thread exam after I add more questions to the assertions exam. I will probably get started on threads next week.
Thank you.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: New Assertions Exam
 
Similar Threads
Operator Precedence
1.0 (Non-Beta) SCJA Exam
New Questions for Dan's Exam
New Assertions Exam
New Collections Exam