|
home—info—lects—labs—exams—hws
tutor/PIs—breeze (snow day)
Object120 + its docs—java.lang docs—java.util docs
Today you and your partner will write one method from scratch.
To help you, follow the
design pattern as discussed in lect02a—the design recipe: revisit: stub functions and test drivers,
and refer back to lab01a's
You will turn in today's work on WebCT (both you and your partner), submitting everything but the actual function body. Note that you will turn in code with a stub-function and test cases, but not working code. You will lose points if you submit a working version!?! (I am trying to emphasize that you should write test cases before code; as our problems become more difficult this becomes more critical.)
/** Create an advertising slogan for our bookstore, * involving books whose name is words followed by a number, * like "Fahrenheit 451". * * @param titleStart The first word(s) of the book. * @param num The number which completes the title. * @return An advertising slogan to make various posters with. * Examples: * bookstoreAd( "Slaughterhouse", 5 ) // Vonnegut * = "Books-A-Jillion: we stock 6 copies of Slaughterhouse 5, guaranteed!" * bookstoreAd( "", 1984 ) // Orwell * = "Books-A-Jillion: we stock 1985 copies of 1984, guaranteed!" * (Hmm, an extra space there, in the book-title...) */ |
At this point, you should be able to call your function from Code Pad,
but it will of course give the dummy answer for now.
Similarly, you can call your
Attach a file, and then browse on your H: drive to find it. The BlueJ project creates an entire folder with a bunch of files inside; you want to attach just the one file ending in .java.
(If you care: the .class file contains your compiled code of 0/1s readable by the machine; the remaining files (.ctxt, .bluej) are used internally by BlueJ.)
Note: On Thursday, we will continue this lab, and check it off for credit (you + your lab partner).In general for the semester, some labs will be submitted or checked off, and others won't be. But keep in mind that all lab material is fair game for quiz, homework, and test questions.
home—info—lects—labs—exams—hws
tutor/PIs—breeze (snow day)
Object120 + its docs—java.lang docs—java.util docs
©2012, Ian Barland, Radford University Last modified 2012.Sep.04 (Tue) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |