Main Content

A behaviour driven example of writing a Java program

Archive - Originally posted on "The Horse's Mouth" - 2014-12-09 13:27:44 - Graham Ellis

A new exercise example just posted from the Java course I'm running this week - contionals, loops, and a few static functions.

The question is to rea from the user how many tables there are in a restaurant, then read the width and length of each table and report on the number of people who can be seated at each table as it's added in, and to keep a cumulative total for the restaruant as a whole.

I provided a sample of what I wanted the results to look like as my specification - "Behaviour Driven Developement" in its simplest form if you would like to thing of it like that. Full source [here]