Buggy code:
public class Checkout { static Scanner user = new Scanner ( System . in ) ; public static String company ( ) { } public static String name ( ) { } public static String number ( ) { } public static int expiryMonth ( ) { } public static int expiryYear ( ) { } public static int code ( ) { } public static void editPayment ( String type , String name , String number , int month , int year , int code ) { } public static String shippingStreet ( ) { } public static String shippingCity ( ) { } public static String shippingProvince ( ) { } public static String shippingPostal ( ) { } public static void editShipping ( String street , String city , String province , String postalCode , int numItems , String cardType , String cardHolder , String cardNumber , int cardExpiryMonth , int cardExpiryYear , int cardSecurityCode ) throws IOException { } public static void shippingCost ( int numItems , String street , String city , String province , String postalCode , String cardType , String cardHolder , String cardNumber , int cardExpiryMonth , int cardExpiryYear , int cardSecurityCode ) throws IOException { double shippingPrice = 0.0 ; double tax = 0.0 ; double subtotalPrice = 0.0 ; double totalPrice = 0.0 ; <START_BUG> for ( int i = 0 ; i < numItems ; i ++ ) { <END_BUG> subtotalPrice += TigerDirect . cart [ i ] . dollarPrice ; subtotalPrice += Double . valueOf ( ( "0." + ( TigerDirect . cart [ i ] . centPrice ) ) ) ; } if ( province . equals ( "British<seq2seq4repair_space>Columbia" ) ) { shippingPrice = 19.99 ; } else if ( province . equals ( "Alberta" ) ) { shippingPrice = 17.99 ; } else if ( province . equals ( "Saskatchewan" ) ) { shippingPrice = 16.49 ; } else if ( province . equals ( "Manitoba" ) ) { shippingPrice = 14.99 ; } else if ( province . equals ( "Ontario" ) ) { shippingPrice = 4.99 ; } else if ( province . equals ( "Quebec" ) ) { shippingPrice = 9.99 ; } else if ( province . equals ( "New<seq2seq4repair_space>Brunswick" ) ) { shippingPrice = 12.95 ; } else if ( province . equals ( "Nova<seq2seq4repair_space>Scotia" ) ) { shippingPrice = 13.99 ; } else if ( province . equals ( "Prince<seq2seq4repair_space>Edward<seq2seq4repair_space>Island" ) ) { shippingPrice = 14.99 ; } else if ( province . equals ( "Newfoundland" ) ) { shippingPrice = 16.49 ; } else if ( province . equals ( "Yukon" ) ) { shippingPrice = 21.99 ; } else if ( province . equals ( "North-West<seq2seq4repair_space>Territories" ) ) { shippingPrice = 23.99 ; } else { shippingPrice = 24.99 ; } tax = subtotalPrice * 0.13 ; totalPrice = ( subtotalPrice + shippingPrice ) + tax ; Checkout . invoice ( totalPrice , subtotalPrice , shippingPrice , tax , numItems , street , city , province , postalCode , cardType , cardHolder , cardNumber , cardExpiryMonth , cardExpiryYear , cardSecurityCode ) ; } public static void invoice ( double total , double subtotal , double shipping , double tax , int numItems , String street , String city , String province , String postalCode , String cardType , String cardHolder , String cardNumber , int cardExpiryMonth , int cardExpiryYear , int cardSecurityCode ) throws IOException { } public static void removeStock ( ) throws FileNotFoundException { } public static void checkout ( CartRecord [ ] cart , int numItems ) throws IOException { } No newline ; at end ; of file ; }

Fix:
for ( int i = 0 ; i < ( TigerDirect . numItemsInCart ) ; i ++ ) {