Answer:
See Explanation
Explanation:
The following lines of codes were corrected.
Note only lines with error are listed out
char[] okayCodes = {'A''C''T''H'};
corrected to
char[] okayCodes = {'A','C','T','H'};
StringBuffer prompt = newStringBuffer("Enter shipping code for this delivery\nValid codes are: ");
corrected to
StringBuffer prompt = new StringBuffer("Enter shipping code for this deliveryValid codes are: ");
for(int x = 0; x < length; ++x)
corrected to
for(int x = 0; x < okayCodes.length; ++x)
for(int i = 0; i < length; ++i)
corrected to
for(int i = 0; i < okayCodes.length; ++i)
if(userCode = okayCodes)
corrected to
if(userCode == okayCodes[i])
if(found)message = "Good code";elsemessage = "Sorry code not found";
corrected to
if(found)
message = "Good code";
else
message = "Sorry code not found";
However, I've added the full source code as an attachment