For a university assignment in Java the specification requires that
Code Listings: in 10-point Courier New typeface, and in Landscape mode if you have lines that are too long to fit into Portrait mode.
are included in the 开发者_JS百科documentation. The term seem ambiguous to me and it's a bit late to consult my tutor, how would you define "code listings"? Are these method signatures?
That just means printing out your java code. :-)
It sounds like they want everything. If that's too much, I would include the major interfaces and implementations. Any utility-type classes may be out-of-bounds if you have too much. But I'd be tempted to include everything, and structure it such that the most important classes and interfaces are presented first.
If you want to present everything nicely (and why not?) check out enscript. It'll print code in courier with syntax highlighting and decent headers/footers etc. Here's my config to print out in landscape with syntax highlighting:
# -2 = 2 columns
# -G = fancy header
# -E = syntax filter
# -r = rotated (landscape)
# syntax is picked up from .enscriptrc / .enscript dir
enscript -2GrE $*
Sounds like my University, which for Java (and our capstone) wanted every line of coded printed.
If you want it syntax highlighted and are using Netbeans, it has a "print to html" option in the File menu. Otherwise, you could use enscript like Brian suggested.
I would object to submitting actual dead trees and "print" code listings into PDF for submission.
精彩评论