Respuesta :
The program that finds word differences between sentences (according to the description) above is given below.
What is a program?
A program is a set of codes and or instructions that are written sequentially and deliberately such that the computer, when it reads and executes them give a specific and premedicated output.
The lines of code that gives the output described above is:
import java.util.Scanner; public class LabProgram {
public static int findWordInWordList(String[] wordList, String wordToFind, int numInList) {
for (int i = 0; i < numInList; i++) {
if (wordList[i].equals(wordToFind)) {
return i;
} } return -1;
} public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
String[] original = new String[20], modified = new String[20]; int numInList = scnr.nextInt();
for (int i = 0; i < numInList; i++) {
original[i] = scnr.next();
modified[i] = scnr.next();
} int numWords = scnr.nextInt();
String[] words = new String[numWords];
for (int i = 0; i < numWords; i++) {
words[i] = scnr.next();
} int index;
for (int i = 0; i < numWords; i++) {
index = findWordInWordList(original, words[i], numInList); if (index != -1)
words[i] = modified[index];
} for (int i = 0; i < numWords; i++) System.out.print(words[i] + " ");
System.out.println(); } }
Learn more about programing:
https://brainly.com/question/23275071
#SPJ1