You are on page 1of 2

CSCI 455: Lab 7

1 of 2

http://scf.usc.edu/~csci455/curr/labs/lab7/lab7.html

CS 455 Lab 7: Recursion


Fall 2015 [Bono]

Goals and Background


NOTE: There is a home football game this Thursday evening (10/8). Because of the extra traffic around
campus, if you are in the 4pm or 7pm lab, your lab will not meet this week, and you will be submitting your
work electronically instead. Your lab TAs will be holding some extra office hours on Friday in case you need
help with the lab. Students in those sections will have until 5pm on Friday, Oct. 9 to submit their lab. For the
affected students, please see the directions at the bottom of this page on how to submit this lab.
All the other labs will meet as normal, and students in those labs will get their work checked off in lab, just
like every other week.

This lab is for you to practice writing recursive code. Each of the problems are small problems that you
would probably not normally write recursively, but that are easy enough so you can apply the idea of
"thinking recursively" and turn it into working code. Writing such code recursively will help you to be able to
solve more complicated problems recursively; i.e., ones that would be much more difficult or complicated to
solve without recursion.
Thus to get the lab point on these problems, you not only have to get the code to work, but you have to solve
it recursively, and follow the other specifications of the problem (two of them are problems that we also
discussed in the recursion lecture, but that we will be doing a different way for the lab).
For this lab we will be using the website codingbat.com This very useful website, created by my colleague
Nick Parlante at Stanford, has lots and lots of Java practice problems with a way to compile and test
individual methods stand-alone right on the web page. (By the way, there is also a link to this website from
our Sample Exams page, as a useful resource for more practice exam problems).

Reading and reference material


Horstmann, Chapter 13 on Recursion
CS 455 Recursion lectures (10/6 and 10/8)

Exercises 1, 2, and 3 (1 checkoff point each)


Note: if you want to save your code beyond your lab session (e.g., to look at it or work on it more later), you
should create an account in codingbat. I recommend you do this in case you somehow have to leave your
session or get disconnected before you complete your lab and get it checked off. DEN students and the
students in the 4pm and 7pm lab sections must create a codingbat account and share it with us for us to be
able to see that you have completed the lab. Please read the DEN section below and follow the directions
there before starting your lab.
One point for each of the problems linked from the following web page. Each problem is described on its
problem page:

10/6/2015 6:34 PM

CSCI 455: Lab 7

2 of 2

http://scf.usc.edu/~csci455/curr/labs/lab7/lab7.html

Recursion Lab Codingbat page

Codingbat is pretty self-explanatory, but for more information, on each codingbat problem page there is a link
to a help page at the top right of the page. Reading the first section of that help page should be enough to get
you started. Also, at the bottom of each problem page there is a link labeled Java Example Solution Code.
That solution page includes an example solved recursion problem in a section labeled Recursion.

Checkoff for DEN students (and students in 4pm and 7pm labs)
As mentioned above, you must create your own account in codingbat to be able to save your work. Please use
your USC email address as the account name to make it easy to identify you.
So we can access the code you wrote for your lab, you will need to share your account with your lab TA's
account. How to do this: once you have an account there's a preferences (prefs) link at the top right of the
page. On the preferences page enter the email address of your lab TA in the Teacher Share section. Here are
the relevant email addresses:
4pm section: chen681@usc.edu (Andrew)
7p section: dnakrani@usc.edu
(Dhananjay)
DEN section: ghasamig@usc.edu (Majid)

While you're on the preferences page also enter your full name in the section for that so we know who is
who. For students working with a partner, please enter the name of the two partners in a comment before the
code for each problem (i.e., before the method), and only share one copy of the solution with your TA.
The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy,
integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such
content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees

10/6/2015 6:34 PM

You might also like