BlurbParser - /* / Author: Lewis/Loftus /...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // Author: Lewis/Loftus // // Solution to Programming Project 11.8 // // Parses a string using recursion and determines if // the string is a valid Blurb, //******************************************************************** / import java.util.Scanner; i public class BlurbParser { p //----------------------------------------------------------------- // Parses a Whatzit. // A Whatzit is a 'q' followed by either a 'z' or a 'd', followed // by a Whoozit. //----------------------------------------------------------------- private boolean parseWhatzit(String aString) { if (aString.length() >= 3) // long enough if (aString.charAt(0) == 'q') if (aString.charAt(1) == 'z' || aString.charAt(1) == 'd') return parseWhoozit(aString.substring(2)); return false; // does not begin with 'q' } //----------------------------------------------------------------- // Parses a Whoozit. // A Whoozit is the character 'x' followed by zero or more 'y's
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Page1 / 2

BlurbParser - /* / Author: Lewis/Loftus /...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online