subject

Can I have some help debugging this exercise:// Application lists valid shipping codes// then prompts user for a code// Application accepts a shipping code// and determines if it is validimport java. util.*;public class DebugEight1{public static void main(String args[]){Scanner input = new Scanner(System. in);char userCode;String entry, message;boolean found = false;char[] okayCodes = {'A''C''T''H'};StringBuffer prompt = newStringBuffer("Enter shipping code for this delivery\nValid codes are: ");for(int x = 0; x < length; ++x){prompt. append(okayCodes[x]);if(x != (okayCodes. length - 1))prompt. append(", "); }System. out. println(prompt);entry = input. next();userCode = entry. charAt(0);for(int i = 0; i < length; ++i){if(userCode = okayCodes){found = true;}}if(found)message = "Good code";elsemessage = "Sorry code not found";System. out. println(message);}}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 03:10
Acomputer has a two-level cache. suppose that 60% of the memory references hit on the first level cache, 35% hit on the second level, and 5% miss. the access times are 5 nsec, 15 nsec, and 60 nsec, respectively, where the times for the level 2 cache and memory start counting at the moment it is known that they are needed (e.g., a level 2 cache access does not even start until the level 1 cache miss occurs). what is the average access time?
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
Brian wants to conduct an online search with a certain phrase. he intends to use the words books that belong to the 1800s in his search. how should he use the word that in his search?
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
question
Computers and Technology, 24.06.2019 08:00
Java the manager of a football stadium wants you to write a program that calculates the total ticket sales after each game
Answers: 1
You know the right answer?
Can I have some help debugging this exercise:// Application lists valid shipping codes// then prompt...
Questions
question
Mathematics, 30.10.2020 21:40
question
Geography, 30.10.2020 21:40
question
Mathematics, 30.10.2020 21:40
question
Chemistry, 30.10.2020 21:40
Questions on the website: 13722367