{\rtf1\ansi\deff0\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman{\*\falt Thorndale};}{\f1\froman\fprq2\fcharset0 Times New Roman{\*\falt Thorndale};}{\f2\fmodern\fprq1\fcharset0 Courier New;}{\f3\froman\fprq2\fcharset0 Times New Roman;}{\f4\fswiss\fprq2\fcharset0 Arial;}{\f5\fnil\fprq2\fcharset0 HG Mincho Light J;}{\f6\fnil\fprq2\fcharset0 Arial Unicode MS;}}
{\colortbl;\red0\green0\blue0;\red0\green0\blue128;\red128\green128\blue128;}
{\stylesheet{\s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\snext1 Default;}
{\s2\sa120\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext2 Text body;}
{\s3\sb240\sa120\keepn\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs28\lang1033\sbasedon1\snext2 Heading;}
{\s4\sb240\sa60\keepn\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs28\lang1033\b\sbasedon1\snext1{\*\soutlvl0} Heading 1;}
{\s5\sb240\sa60\keepn\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs24\lang1033\i\b\sbasedon1\snext1{\*\soutlvl1} Heading 2;}
{\s6\sb240\sa60\keepn\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs24\lang1033\sbasedon1\snext1{\*\soutlvl2} Heading 3;}
{\s7\sb240\sa60\keepn\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs24\lang1033\b\sbasedon1\snext1{\*\soutlvl3} Heading 4;}
{\s8\sb240\sa60\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs22\lang1033\sbasedon1\snext1{\*\soutlvl4} Heading 5;}
{\s9\sb240\sa60\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs22\lang1033\i\sbasedon1\snext1{\*\soutlvl5} Heading 6;}
{\s10\li360\ri0\fi-360\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext10 List;}
{\s11\li720\ri0\fi-360\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext11 List 2;}
{\s12\li1080\ri0\fi-360\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext12 List 3;}
{\s13\cf1{\*\tlswg8236}\tqc\tx4320{\*\tlswg8236}\tqr\tx8640{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext13 Header;}
{\s14\cf1{\*\tlswg8236}\tqc\tx4320{\*\tlswg8236}\tqr\tx8640{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext14 Footer;}
{\s15\sb240\sa60\cf1\qc{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs32\lang1033\b\sbasedon1\snext16 Title;}
{\s16\sa60\cf1\qc{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs24\lang1033\sbasedon1\snext2 Subtitle;}
{\s17\li360\ri0\fi1\sa120\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext17 WW-List Continue;}
{\s18\li360\ri0\fi1\sa120\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext18 WW-Body Text 2;}
{\s19\li360\ri0\fi1\sa120\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon18\snext19 WW-Body Text 3;}
{\s20\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext20 Normal;}
{\s21\li720\ri0\fi0\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon20\snext21 Body Text 2;}
{\*\cs23\cf1{\*\updnprop5801}\up10\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\fs24\lang1033\sbasedon26 Footnote Characters;}
{\*\cs24\cf1\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\fs24\lang1033 Page Number;}
{\*\cs25\cf2\ul\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\fs24\lang1033 Internet Link;}
{\*\cs26\cf1\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\fs24\lang1033 WW-Absatz-Standardschriftart;}
{\*\cs27\cf1\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\lang1033 WW-Absatz-Standardschriftart1;}
{\*\cs28\cf1{\*\updnprop5801}\up10\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\lang1033\sbasedon27 WW-Footnote Symbol;}
{\*\cs29\cf1\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\lang1033 WW-Default Paragraph Font;}
{\*\cs30\cf1\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\lang1033 WW-Page Number;}
{\*\cs31\cf1\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\lang1033\sbasedon29 WW-Page Number1;}
{\*\cs32\cf1\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\lang1033\b\sbasedon29 WW-Strong;}
}
{\info{\title 132hw06 - s03}{\author Sharon Tuttle}{\creatim\yr2001\mo1\dy23\hr10\min30}{\operator Sharon Tuttle}{\revtim\yr2003\mo3\dy15\hr0\min0}{\printim\yr2003\mo1\dy28\hr11\min42}{\comment StarWriter}{\vern6410}}\deftab720
{\*\pgdsctbl
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn720\margbsxn720\headery0{\*\headeryb283\headerxl0\headerxr0\headeryh0}{\header \pard\plain \s13\cf1{\*\tlswg8236}\tqc\tx4320{\*\tlswg8236}\tqr\tx8640{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs12 {\ltrch\loch\f3 CIS 132 - HW #6\tab \tab p. {\field{\*\fldinst \\page}{\fldrslt 3}}}
\par {\ltrch\loch\f3 Spring 2003}
\par }
\pgdscnxt0 Default;}}
\paperh15840\paperw12240\margl1440\margr1440\margt720\margb720\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn1303\margbsxn720\headery720{\header \pard\plain \s13\cf1{\*\tlswg8236}\tqc\tx4320{\*\tlswg8236}\tqr\tx8640{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs12 {\ltrch\loch\f3 CIS 132 - HW #6\tab \tab p. {\field{\*\fldinst \\page}{\fldrslt 3}}}
\par {\ltrch\loch\f3 Spring 2003}
\par }
\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
\pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\qc{\*\tlswg8236}\tx6300\ltrch\loch\fs24\b {\ltrch\loch\f3 HUMBOLDT STATE UNIVERSITY}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\qc\ltrch\loch\fs24\b {\ltrch\loch\f3 CIS 132 - Introduction to Computer Science II - Spring 2003}
\par {\ltrch\loch\f3 Homework #6 - due Friday, March 24th,  4:30 pm}
\par {\ltrch\loch\f3 Stacks and Queues}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033{\*\tlswg8236}\tx1260\ltrch\loch\fs24\b 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24\b {\ltrch\loch\f3 IMPORTANT NOTE: {\b0 You must turn in the zip/floppy/cd containing your homework files to my mailbox in }NHW 234{\b0  (the departmental office) by the time and date specified above. Make sure that the zip/floppy/CD has your name on it, and that all of your HW #6 file
s are within a directory named }132hw06 {\b0 on that zip/floppy/cd.}}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24 
\par {\ltrch\loch\f3 In the same section of the course web page as this homework handout, you will find a version of a stack interface, {\b Cs132Stack.java}, and a queue interface, {\b Cs132Queue.java}. (They should look familiar --- they were discussed and displayed in lecture, too, an
d links to them were posted under that heading.) Along with them are the classes for the exceptions mentioned within those interfaces, {\b StackEmptyException.java} and {\b QueueEmptyException.java}.}
\par 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24\b {\ltrch\loch\f3 Exercise #1}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24 {\ltrch\loch\f3 Create a class {\b Cs132LinkedStack.java} that implements interface {\b Cs132Stack.java} (and include any other classes you need to in order to do so). It must use a linked implementation; it may not use an array implementation. (While you can --- and should!! --- b
orrow ideas liberally from {\b Cs132LinkedList.java}, you may not simply implement your stack as a {\b Cs132LinkedList }instance. That's another exercise. 8-) ) You should, of course, also create a corresponding {\b Cs132LinkedStackTest.java} class to test it, and should
 also turn in a copy of the text console contents from running those tests.}
\par 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24\b {\ltrch\loch\f3 Exercise #2}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24 {\ltrch\loch\f3 Create a class {\b Cs132ArrayQueue.java} that implements interface {\b Cs132Queue.java} (and include any other classes you need in order to do so). It must use an array implementation; it may not use a linked implementation. (Note that it must not overflow because o
f the underlying array being full --- see {\b Cs132ArrayList.java} for some ideas about how to avoid such overflow...) (While you can --- and should!! --- borrow ideas liberally from {\b Cs132ArrayList.java}, you may not simply implement your queue as a {\b Cs132ArrayLi
st} instance. That's another exercise.) You should, of course, also create a corresponding {\b Cs132ArrayQueueTest.java }class to test it, and should also turn in a copy of the text console contents from running those tests.}
\par 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24\b {\ltrch\loch\f3 Exercise #3}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24 {\ltrch\loch\f3 Okay, now choose either {\b Cs132Stack.java} OR {\b Cs132Queue.java} and implement it in terms of a {\b Cs132List} (you may choose either implementation {\b Cs132LinkedList.java} or {\b Cs132ArrayList.java}). That is, something of type {\b Cs132List} should be amongst the data fields o
f your stack or queue implementation. Along with your {\b Cs132ListStack.java }OR {\b Cs132ListQueue.java }(and any other classes that you need), include your corresponding {\b Cs132ListStackTest.java }OR {\b Cs132ListQueueTest.java}, and a copy of the text console contents f
rom running those tests.}
\par 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24\b {\ltrch\loch\f3 Exercise #4}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24 {\ltrch\loch\f3 Choose your Stack implementation that you feel most confident about, and use it in a  {\b static} method{\b  ckIfBalanced()} within a class {\b StackAndQueueApps.java} whose purpose is to contain (among other things, eventually) this method; the desired first line/header
 for {\b ckIfBalanced() }is as follows:}
\par 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24\b {\ltrch\loch\f3 public static boolean ckIfBalanced(String strToCk)}
\par {\ltrch\loch\f3  }
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24 {\ltrch\loch\f3 (We are not exactly having instances of this class, so we are making it {\b static} so that it can be called by using {\b StackAndQueueApps.ckIfBalanced(}desired_str) in other classes --- such as in}
\par {\ltrch\loch\f3 a test class {\b SackAndQueueAppsTest.java }{\b0 ...!})}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24\b 
\par {\ltrch\loch\f3 ckIfBalanced() {\b0 should return }true{\b0  if, within the given string} strToCk{\b0 ,} {\b0 any parentheses }( ){\b0 , curly braces }\{ \}{\b0 , square brackets }[ ]{\b0 , or angle brackets {\b < >} are balanced: whenever such a pair is begun, any pair begun after this is closed before this one is clo
sed. }}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24 
\par {\ltrch\loch\f3 \{ [ ( 3 ) + [ 4 * 7 ] / \{7 * 4 \}] - <2 * 6>\}\tab {\b is }balanced;}
\par 
\par {\ltrch\loch\f3 ( ( (3) + (4 * 7) / (7 * 4) ) - (2 * 6) )\tab \tab {\b is} balanced;}
\par 
\par {\ltrch\loch\f3 3 * 4\tab \tab \tab \tab \tab \tab {\b is }balanced, too;}
\par 
\par {\ltrch\loch\f3 (\tab \tab \tab \tab \tab \tab is {\b not} balanced (never closed);}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24\b 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24 {\ltrch\loch\f3 ( [ ] )\tab \tab \tab \tab \tab \tab {\b is }balanced;}
\par 
\par {\ltrch\loch\f3 ( [ ) ] \tab \tab \tab \tab \tab \tab is {\b not} balanced (square brackets are not closed}
\par {\ltrch\loch\f3 \tab \tab \tab \tab \tab \tab before parentheses are closed);}
\par 
\par {\ltrch\loch\f3 ( ) )\tab \tab \tab \tab \tab \tab is {\b not} balanced (too many right parentheses)}
\par 
\par {\ltrch\loch\f3 (If the meaning of "balanced" is still not clear, then please {\b ask me}! I'm assuming you've seen the concept in using parentheses in mathematical expressions, but in case I'm wrong...)}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24\b 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24 {\ltrch\loch\f3 It turns out that a {\b stack} can be used to see if the parentheses/curly brackets/square brackets/angle brackets in a string are indeed balanced. }
\par 
\par {\ltrch\loch\f3 Since the point here is to make use of the stack, I'll give you a head start on the basic algorithm: imagine that you are checking every character within a string. Every time you see a left parenthesis/curly bracket/square bracket/angle bracket, you push i
t onto the stack. If the string is balanced in terms of these, then whenever you see a right  parenthesis/curly bracket/square bracket/angle bracket, you should be able to pop the stack and get the corresponding left parenthesis/curly bracket/square bracke
t/angle bracket. (If you get something else, the string is not balanced!) When you are finished with the string, the stack had better be empty, or there is at least one unclosed parenthesis/curly bracket/square bracket/angle bracket. And if you ever try to
 pop the stack and it is empty, then there is a right parenthesis/curly bracket/square bracket/angle bracket that was never opened.}
\par 
\par {\ltrch\loch\f3 (I'd highly recommend practicing the above algorithm on the above strings until you are clear on what I mean, and at least reasonably convinced that it works...)}
\par 
\par {\ltrch\loch\f3 Include within a class {\b StackAndQueueAppsTest.java} an appropriate test method {\b ckIfBalancedTest()} for your completed method {\b ckIfBalanced()}. Also note: you are welcome to use private helper methods within {\b StackAndQueueApps.java} if you wish; be sure to test th
em within {\b StackAndQueueApps.java} if you do so, however. (Being private, you cannot call them in the test class...!) Also turn in a copy of the text console contents from running those tests.}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24\b 
\par {\ltrch\loch\f3 Exercise #5}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24 {\ltrch\loch\f3 Consider a {\b palindrome} --- that's a word or phrase that reads the same {\b backwards} as {\b forwards}}
\par {\ltrch\loch\f3 (not taking white space, punctuation, or letter case into account):}
\par 
\par {\ltrch\loch\f3 Madam, I'm Adam}
\par {\ltrch\loch\f3 A man, a plan, a canal --- Panama}
\par {\ltrch\loch\f3 Gift fig}
\par {\ltrch\loch\f3 Radar}
\par {\ltrch\loch\f3 Tap Pat.}
\par 
\par {\ltrch\loch\f3 It so happens that you can determine if a String contains a palindrome or not with the help of a stack and a queue. (Think about it --- if you put lowercase versions of each letter only (not white space, punctuation, etc.) from a string into both a stack a
nd a queue --- how can you then use those two filled structures to tell if the letters in that string are the same reading backwards or forwards?) }
\par 
\par {\ltrch\loch\f3 Add a {\b static }method {\b ckIfPalindrome()} to {\b StackAndQueueApps.java}, also, that is also static, that also returns a boolean, and also expects a String argument. It should use a stack and a queue to determine if the passed string is indeed a palindrome or not, a
nd return true or false accordingly. You may choose which of your stack and queue implementations to use; and include a test method for{\b  ckIfPalindrome()  }within{\b  StackAndQueueAppsTest.java}, also, of course.{\b  }And, turn in a copy of the text console contents f
rom running that test method (and any others needed for testing any helper methods you also write, if necessary).}
\par 
\par {\ltrch\loch\f3 Minor notes: }
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\li420\ri0\fi-420\ltrch\loch\fs24 {\ltrch\loch\f3 *\tab Java wrapper class {\b Character} has a static {\b isLetter()} method...and a static {\b toLowerCase()} method, too... But check the Java 1.4 API for arguments required, etc. (class {\b Character }is in package {\b java.lang}) --- and remember how one calls a static method!}
\par 
\par {\ltrch\loch\f3 *\tab remember: pop() and dequeue() return Objects. To store their result into a variable of a more specific type (when you know what that type is, of course! 8-) ), you should {\b cast} the pop() or dequeue() result to that type. It'll throw an exception if the ca
st cannot work...}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24 
\par 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\f2\fs24 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24 
\par 
\par 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24\b 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\f2\fs24 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\li360\ri0\fi-360 
\par }