6086 comments
2357 subscribers
6228 on Twitter
Subscribe! Feed reader E-mail

CS1 assignments in Java

I’ve developed a Java library for my CS1 course
that SIGCSE members may be interested in using
for assignments. It includes:

- An implementation of Karel the Robot that is

more full-featured than most. We use it to get
students started in using objects, extending
classes, stepwise refinement, practise
with control structures, and to help understand
polymorphism.

- A set of simplified input and output classes. One

novel feature are methods such as intIsAvailable().
Such methods allow students to write robust code with
error checking.

- A number of user interfaces, each accompanied by a

Java interface. Students write a class to implement
the interface and pass an instance to the UI. The
result is a complete and satisfying program.

  • A combination lock: students write a class to determine when
    the lock is locked or unlocked. It only unlocks if the correct
    combination is passed as parameters. Students practice instance
    variables and parameters.

  • An AM/FM radio: Students write a “tuner” class. It remembers the
    current frequency, tunes up or down, seeks up or down, and has
    presets. Students practice with instance variables, looping,
    parameters.

  • A equation grapher: Students write a class implementing an eval
    function. The provided user interface displays the corresponding
    graph. Three different Java interfaces allow practice with only
    parameters, parameters and instance variables (for the coefficients)
    or parameters and arrays (arbitrary degree polynomials).

  • An image transformation program: Students write a class to
    transform an image stored as a 2D array of integers. The provided user
    interface reads the image from a file and calls the appropriate
    transformation methods in the student class. Transformations can
    include rotating, scaling, brighten, flip, mirror, etc. I believe a
    similar assignment was included in the SIGCSE 2003 Nifty Assignments
    panel.

  • A marks “spreadsheet”: gives students practise with both 1D and 2D
    arrays. The 1D arrays store student and assignment names. The 2D array
    stores the marks.

The library is available for download at
http://www.cs.uwaterloo.ca/~bwbecker/robots
Click on the Software link to see demos and download the
library. It requires Java 1.3.1 or greater.

If you end up using it in one of your courses, I’d appreciate
hearing about it!

Byron

E-Mail from Byron Weber Becker

Short URL: http://sachachua.com/blog/p/1647

On This Day...

  • 2013: Things I value unequally — I was talking to someone who taught a class at Trade School Toronto. To enable more people to access education, [...]
  • 2011: A braindump of tips for other new immigrants from the Philippines — For Anna Simbulan (welcome to Toronto!) and others this can help along the way. =) Winter and clothing [...]
  • 2010: Gifts and graphs: visualization and gift-giving — Many talents might be skills in disguise. For example, my sister Kathy has a flair for giving personal gifts, while [...]
  • 2009: Braindump of conference networking tips — I enjoyed reading Jeff Widman’s interview about networking tips. It reminded me of my rants about the “you’re just a [...]
  • 2009: Weekly review: Week ending January 25, 2009 — The sore throat from last week transformed into a nasty cold. Fortunately, working from home meant I was just as [...]
  • 2008: Time management and work boundaries —   [Never Wrestle With A Pig]: McCormack addresses time management here, making several astute points. The biggest one – and the one [...]
  • 2008: Speech recognition – a month of fun — I hadn’t expected speech recognition to be this much fun. Something magical happens when I take my fingers off the [...]
  • 2008: Taking it Offline — This was a week of online encounters becoming offline ones. I had lunch with Heidi Hansen, a librarian from Ann [...]
  • 2008: Library book reminder script – Perl geeking required — W- and I borrow lots of books from the library. This script helps keep order in the house by reminding [...]
  • 2008: Yak shaving with OpenOffice.org — Fiddly little editing tasks are driving me mad. Formatting all the keyboard shortcuts as EmphasisBold and the command names as [...]
  • 2007: Welcome to the world, Alexander Nolan! — He’s *adorable.* Yay Jen and Chris! Random Emacs symbol: w3m-add-local-hook – Function: Add to the buffer-local value of HOOK the function [...]
  • 2007: It’s almost time to leave — Tomorrow I begin packing for my trip back to Canada. I don’t know how I’ll fit all of the Philippine handicrafts [...]
  • 2005: Ranulf head of Manila chapter of International Game Designers Association; Eric head of acads — From http://news.inq7.net/infotech/index.php?index=1&story_id=25520 Ranulf Goss, a support specialist from the Philippine office of anti-virus firm Trend Micro, was named the new chairman of [...]
  • 2005: THIRD TIME’S THE CHARM, 55-word flash fiction — Burnt the toast. Charred black, three days in a row. He didn’t yell, didn’t leave; just laughed and told me he’d [...]
  • 2004: Wearable computing — - http://www.pdalive.com/showarticle.php?threadid=5052
  • 2004: Tech writing — http://neptune.spacebears.com/opine/style.html
  • 2004: Wearable computing article — http://www.theclockmag.com/wearablecomputers.html
  • 2004: Letter to doctex — Thank you for the opportunity to be of help. We will concentrate on the scheduled updates system first so that the [...]
  • 2004: Use cases for scheduled updates — Encoder - check list of unmet requirements - check off a requirement - add/edit/remove a person - add/edit/remove a requirement JesuitInformationSystem
  • 2004: Met with docprex — We’ll start out with scheduled updates. Jesuits have to be reminded to update documents. The period between updates varies per person [...]
  • 2004: Java and Linux — http://community.java.net/linux/ E-Mail from Melvin Dave P. Vivas
  • 2004: Other links — - Tala’s blog: http://tala-star.tripod.com/links.html ../../sitelogs/sacha.free.net.ph-access_log.3
  • 2004: Resuming CookOrDie — CookOrDie will resume on Monday.
  • 2004: Interesting links — - http://www.ijbo.com/~alex/Wiki/notes/bookmark.xht - http://mistervader.blogspot.com/ – a few posts about me - http://free.net.ph/Members/tuko/index_html/view (JM Ibanez) - http://www.livejournal.com/users/monicai – Monica Isaac discovering open-source software [...]
  • 2004: TheologicalQuestions — Apparently, some people can find that funny… <laugh> I can’t help it! People find even my _serious_ stuff amusing!
  • 2004: Ganesh Swami responds — Looks like some people found my write-up of blogging in Emacs useful. Yeah, sure, coffee or hot chocolate sometime. =) http://www.sfu.ca/~gswamina/2004.01.01.html (Whee! He [...]
  • 2004: iKnow — iKnow is a personal knowledge processor, a tool for bringing order to collections of information and for revealing relationships between pieces of [...]
  • 2004: “Now Where Was I? New Ways to Revisit Web Sites” — Electronic bookmarks were hailed as a premier tool for recalling Web sites and pages important to users, but their use has [...]
  • 2004: “Disabled to Get Greater Access to Linux” — The Free Standards Group says it has established a task force to develop accessibility standards for Linux. Scott McNeil, executive [...]
  • 2004: USB-powered head-mounted device — - http://www.shimadzu.co.jp/products/aero/hmd/dg-a.html - http://www.shimadzu.co.jp/products/aero/hmd/what1.html Also from the wear-hard mailing list: E-Mail from Steve Barr
  • 2004: Gesture-based interfaces overview — http://neasia.nikkeibp.com/wcs/leaf?CID=onair/asabt/fw/287415 From the wear-hard mailing list: E-Mail from Steve Barr

Get the highlights as a PDF!

Stories from my Twenties: Highlights from a Decade of Blogging