Computers and Technology
Computers and Technology, 13.10.2020 03:01, ansley81

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);}}

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:00, seddy86
Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". any value that is the same as the immediately preceding value is considered a consecutive duplicate. in this example, there are three such consecutive duplicates: the 2nd and 3rd 5s and the second 6. note that the last 3 is not a consecutive duplicate because it was preceded by a 7. write some code that uses a loop to read such a sequence of non-negative integers , terminated by a negative number. when the code finishes executing, the number of consecutive duplicates encountered is printed. in this case, 3 would be printed. assume the availability of a variable, stdin, that references a scanner object associated with standard input. that is, stdin = new scanner(system. in); is given.
Answers: 1
image
Computers and Technology, 22.06.2019 15:00, misslux
This is not a factor that you should use to determine the content of your presentation. your audience your goals your purpose your technology
Answers: 1
image
Computers and Technology, 22.06.2019 18:40, penelopymorales24
Mariah was working on a multimedia presentation that included both video and audio files. the file was huge, and she wanted to send it to her coworker in another office. she needed to reduce the size of the file so that it could be transmitted faster. the utility she used to do this was
Answers: 2
image
Computers and Technology, 22.06.2019 19:30, 710jonathan
The following is an excerpt from a slide presentation. today we will inverse operations solving equations using inverse operations solving inequalities using inverse operations from which part of the presentation does the slide most likely come from? a. introduction b. outline c. body d. conclusion
Answers: 1
Do you know the correct answer?
Can I have some help debugging this exercise:// Application lists valid shipping codes// then prompt...

Questions in other subjects: