Buggy code:
public class Shopping { public static int section ( Sections [ ] sections ) { } public static int subsection ( int sectionID ) { } public static String itemFinder ( Items [ ] itemList , int subsection , Descriptions [ ] descriptions ) { Scanner user = new Scanner ( System . in ) ; String stay = "y" ; Items selectedItem ; int listNum = 0 ; int counter = 0 ; Items currentItem ; Items [ ] inSubsection = new Items [ itemList . length ] ; CartRecord [ ] inCart = new CartRecord [ 1000 ] ; String buy = "" ; int itemBought = 0 ; String backToTop = "" ; boolean addTo = false ; subsection -- ; while ( ( stay . charAt ( 0 ) ) == 'y' ) { System . out . println ( ( ( "This<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>list<seq2seq4repair_space>of<seq2seq4repair_space>items<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>" + ( TigerDirect . subsections [ subsection ] . name ) ) + "<seq2seq4repair_space>subsection." ) ) ; counter = 0 ; for ( int i = 0 ; i < ( Employees . numItems ) ; i ++ ) { currentItem = itemList [ i ] ; if ( ( ( itemList [ i ] . subsection ) == ( TigerDirect . subsections [ subsection ] . ID ) ) && ( ( itemList [ i ] . stock ) > 0 ) ) { counter ++ ; System . out . println ( ( ( counter + ".<seq2seq4repair_space>" ) + ( itemList [ i ] . name ) ) ) ; inSubsection [ counter ] = itemList [ i ] ; } } listNum = Console . getInt ( "Enter<seq2seq4repair_space>the<seq2seq4repair_space>corresponing<seq2seq4repair_space>number<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>item<seq2seq4repair_space>you<seq2seq4repair_space>are<seq2seq4repair_space>selecting:<seq2seq4repair_space>" , 1 , counter ) ; System . out . println ( inSubsection [ listNum ] . name ) ; System . out . println ( ( "Item<seq2seq4repair_space>ID:<seq2seq4repair_space>" + ( inSubsection [ listNum ] . ID ) ) ) ; System . out . println ( ( ( ( "Price:<seq2seq4repair_space>" + ( inSubsection [ listNum ] . dollarPrice ) ) + "." ) + ( inSubsection [ listNum ] . centPrice ) ) ) ; for ( int i = 0 ; i < ( Employees . numItems ) ; i ++ ) { if ( ( descriptions [ i ] . ID ) == ( inSubsection [ listNum ] . ID ) ) { System . out . println ( ( "Description:<seq2seq4repair_space>" + ( descriptions [ i ] . description ) ) ) ; } } System . out . print ( "Are<seq2seq4repair_space>you<seq2seq4repair_space>sure<seq2seq4repair_space>you<seq2seq4repair_space>would<seq2seq4repair_space>like<seq2seq4repair_space>to<seq2seq4repair_space>purchase<seq2seq4repair_space>this<seq2seq4repair_space>product?:<seq2seq4repair_space>" ) ; buy = user . nextLine ( ) ; while ( ( ( buy . trim ( ) . toLowerCase ( ) . charAt ( 0 ) ) != 'y' ) && ( ( buy . trim ( ) . toLowerCase ( ) . charAt ( 0 ) ) != 'n' ) ) { System . out . println ( "Please<seq2seq4repair_space>enter<seq2seq4repair_space>either<seq2seq4repair_space>y<seq2seq4repair_space>or<seq2seq4repair_space>n." ) ; System . out . print ( "Are<seq2seq4repair_space>you<seq2seq4repair_space>sure<seq2seq4repair_space>you<seq2seq4repair_space>would<seq2seq4repair_space>like<seq2seq4repair_space>to<seq2seq4repair_space>purchase<seq2seq4repair_space>this<seq2seq4repair_space>product?:<seq2seq4repair_space>" ) ; buy = user . nextLine ( ) ; } if ( ( buy . trim ( ) . toLowerCase ( ) . charAt ( 0 ) ) == 'y' ) { itemBought = Console . getInt ( "Please<seq2seq4repair_space>enter<seq2seq4repair_space>how<seq2seq4repair_space>many<seq2seq4repair_space>of<seq2seq4repair_space>this<seq2seq4repair_space>item<seq2seq4repair_space>you<seq2seq4repair_space>would<seq2seq4repair_space>like<seq2seq4repair_space>to<seq2seq4repair_space>purchase:<seq2seq4repair_space>" ) ; while ( ( itemBought > ( inSubsection [ listNum ] . stock ) ) || ( itemBought == 0 ) ) { if ( itemBought > ( inSubsection [ listNum ] . stock ) ) { <START_BUG> itemBought = Console . getInt ( "There<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>that<seq2seq4repair_space>many<seq2seq4repair_space>items<seq2seq4repair_space>of<seq2seq4repair_space>that<seq2seq4repair_space>type<seq2seq4repair_space>in<seq2seq4repair_space>stock,<seq2seq4repair_space>please<seq2seq4repair_space>enter<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>number:<seq2seq4repair_space>" ) ; <END_BUG> } else if ( itemBought == 0 ) { itemBought = Console . getInt ( "You<seq2seq4repair_space>cannot<seq2seq4repair_space>purchase<seq2seq4repair_space>0<seq2seq4repair_space>items.\nPlease<seq2seq4repair_space>enter<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>number:<seq2seq4repair_space>" ) ; } } ( TigerDirect . counter2 ) ++ ; if ( ( TigerDirect . numItemsInCart ) > 0 ) { for ( int i = 0 ; i < ( inCart . length ) ; i ++ ) { if ( ( inSubsection [ listNum ] . ID ) == ( inCart [ i ] . ID ) ) { inCart [ i ] . quantity += itemBought ; ( TigerDirect . counter2 ) -- ; addTo = true ; } } } if ( addTo == false ) { inCart [ TigerDirect . counter2 ] = new CartRecord ( inSubsection [ listNum ] . name , inSubsection [ listNum ] . ID , inSubsection [ listNum ] . section , inSubsection [ listNum ] . subsection , inSubsection [ listNum ] . dollarPrice , inSubsection [ listNum ] . centPrice , itemBought ) ; System . out . println ( "The<seq2seq4repair_space>item<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>added<seq2seq4repair_space>to<seq2seq4repair_space>your<seq2seq4repair_space>cart." ) ; } addTo = false ; } TigerDirect . numItemsInCart = TigerDirect . counter2 ; System . out . print ( "Would<seq2seq4repair_space>you<seq2seq4repair_space>like<seq2seq4repair_space>to<seq2seq4repair_space>continue<seq2seq4repair_space>shopping<seq2seq4repair_space>in<seq2seq4repair_space>this<seq2seq4repair_space>subsection?:<seq2seq4repair_space>" ) ; stay = user . nextLine ( ) . trim ( ) . toLowerCase ( ) ; while ( ( ( stay . charAt ( 0 ) ) != 'y' ) && ( ( stay . charAt ( 0 ) ) != 'n' ) ) { System . out . println ( "Please<seq2seq4repair_space>enter<seq2seq4repair_space>either<seq2seq4repair_space>y<seq2seq4repair_space>or<seq2seq4repair_space>n." ) ; System . out . print ( "Would<seq2seq4repair_space>you<seq2seq4repair_space>like<seq2seq4repair_space>to<seq2seq4repair_space>continue<seq2seq4repair_space>shopping<seq2seq4repair_space>in<seq2seq4repair_space>this<seq2seq4repair_space>subsection?:<seq2seq4repair_space>" ) ; stay = user . nextLine ( ) . trim ( ) . toLowerCase ( ) ; } } System . out . print ( "Would<seq2seq4repair_space>you<seq2seq4repair_space>like<seq2seq4repair_space>to<seq2seq4repair_space>continue<seq2seq4repair_space>shopping?:<seq2seq4repair_space>" ) ; backToTop = user . nextLine ( ) . trim ( ) . toLowerCase ( ) ; while ( ( ( backToTop . charAt ( 0 ) ) != 'y' ) && ( ( backToTop . charAt ( 0 ) ) != 'n' ) ) { System . out . println ( "Please<seq2seq4repair_space>enter<seq2seq4repair_space>either<seq2seq4repair_space>y<seq2seq4repair_space>or<seq2seq4repair_space>n." ) ; System . out . print ( "Would<seq2seq4repair_space>you<seq2seq4repair_space>like<seq2seq4repair_space>to<seq2seq4repair_space>continue<seq2seq4repair_space>shopping?:<seq2seq4repair_space>" ) ; backToTop = user . nextLine ( ) ; } return backToTop . trim ( ) . toLowerCase ( ) . substring ( 0 , 1 ) ; } No newline ; at end ; of file ; }

Fix:
itemBought = Console . getInt ( ( ( "There<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>that<seq2seq4repair_space>many<seq2seq4repair_space>items<seq2seq4repair_space>of<seq2seq4repair_space>that<seq2seq4repair_space>type<seq2seq4repair_space>in<seq2seq4repair_space>stock,<seq2seq4repair_space>please<seq2seq4repair_space>enter<seq2seq4repair_space>a<seq2seq4repair_space>num<seq2seq4repair_space>no<seq2seq4repair_space>greater<seq2seq4repair_space>than<seq2seq4repair_space>" + ( inSubsection [ listNum ] . stock ) ) + ":<seq2seq4repair_space>" ) ) ;