Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Chapter 14: Programming Project. Create Javadoc for an ArrayIntStack Submit just

ID: 642992 • Letter: C

Question

Chapter 14: Programming Project. Create Javadoc for an ArrayIntStack

Submit just the Javadoc html as a single file that looks good by itself (see below, do not submit index.htm).

A. Create your own Stack Class, call it ArrayIntStack.java and write four public stack methods (this is the easy part of the assignment). Use at least one private helper method. All methods in your ArrayIntStack must have O(constant) run-time. Your ArrayIntStack extends no other Classes from the Java API. Build your own data structure here!!!

1. boolean empty(); Tests if this stack is empty.
2. int peek(); Looks at the object at the top of this stack without removing it from the stack.
3. int pop(); Removes the object at the top of this stack and returns that object as the value of this function.
4. int push(int item); Pushes an item onto the top of this stack.

Since we're using int for return, you must throw an appropriate "empty" Exception for illegal peek and pop operations.

B. Generate the standard Javadoc for your class (has author, date, and all methods, each with return types plus brief descriptions) and submit just one html file : See Appendix B (Javadoc comments). Just one html file becomes the tough part of this assignment. Read on......

I require your Javadoc to have method summaries with information as listed (four methods) above, plus the header comments with author and date as shown by example below for the Iterator interface.

CAUTION: Be certain your file submitted works by itself!!! I know it looks fine on your computer, but what will it look like when I get just that one file?

You will probably need to configure your IDE to use the javadoc standard that comes with the Oracle JDK download. On my computer, the configuration path was (yours' will be slightly different): C:/Program Files (x86)/Java/jdk1.6.0_21/bin/javadoc.exe   But then I upgraded to Java7 on a 64-bit PC, and the path to javadoc changed to C:/Program Files/Java/jdk1.7.0_25/bin/javadoc.exe And maybe you've gone as far as Java8 now?

In the Iterator example above I used Java6. If you never upgraded to Java7, you're lucky, and probably done. The rest of us have now "updated" to Java7 or Java8 and it gets ugly if you're not careful, see this (BAD->): IteratorJ7.html  We have some more work to do:

Option a) Find the stylesheet reference, and change it to something like: rel="stylesheet" type="text/css" href="http://docs.oracle.com/javase/7/docs/api/stylesheet.css"

Option b) Find the stylesheet reference in you html document,   rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"

Comment out or delete that line, and go find the css file in the text/css folder. Copy that code so you have the following:


And once again: You can only submit one html file here. Get it right. And yes, this becomes an HTML exercise, the Java coding is trivial.

Explanation / Answer

After compiling these files, you invoke the Javadoc tool using this command:

The -private option tells Javadoc to expose private field and method information, and the -doclet option tells Javadoc what doclet to invoke. The last parameter is the file to be parsed. The output of the program is the following:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote