Computers and Technology

Write a program that replaces words in a sentence. The input begins with an integer indicating the number of word replacement pairs (original and replacement) that follow. The next line of input begins with an integer indicating the number of words in the sentence that follows. Any word on the original list is replaced. Assume that the list will always contain less than 20 word replacement pairs. Ex: If the input is: automobile car manufacturer maker children kids 15 The automobile manufacturer recommends car seats for children if the automobile doesn't already have one. then the output is: The car maker recommends car seats for kids if the car doesn't already have one. You can assume the original words are unique. For coding simplicity, follow each output word by a space, even the last one. Hint: For words to replace, use two arrays: One for the original words, and the other for the replacements. Your program must define and call the following method that returns index of word's first occurrence in wordList. If not found, the method returns -1 public static int findWordInWordList(String[] wordList, String wordToFind, int numInList) LAB ACTIVITY 6.43.1: LAB: Replacement words 0/10 LabProgram. java Load default template

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 09:40, Tyrant4life
It is vital to research each of the services you plan to disable before implementing any change, especially on critical machines such as the: a. servers in the test environment. b. domain controller and other infrastructure servers. c. desktops that have previously been attacked. d. desktops used by upper-level management.
Answers: 2
image
Computers and Technology, 22.06.2019 18:30, lizz1228
Kto rozmawia z clamentain przez krĂłtkofalĂłwke w the walking dead w 4 epizodzie
Answers: 1
image
Computers and Technology, 22.06.2019 19:20, mahaleyrenee1195
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 2
image
Computers and Technology, 23.06.2019 03:30, natalie2sheffield
Hashtags serve to identify the topic of a given tweet true false
Answers: 2
Do you know the correct answer?
Write a program that replaces words in a sentence. The input begins with an integer indicating the n...

Questions in other subjects:

Konu
Health, 03.02.2020 14:03