Question: Hello, new to java and in need of help. Write a program MyTokenTester.java that reads in a sentence and displays the sentence in reverse order.
Hello, new to java and in need of help. Write a program MyTokenTester.java that reads in a sentence and displays the sentence in reverse order. Use the split method to extract each word from the sentence. If there is punctuation (. ! or ?) at the end of the sentence you must remove it and place it at the end of the reversed sentence. The program must keep running until the user enters "quit" (upper- or lowercase). For example: I went to school. school to went I.
Write a program TheFinder.java that reads in a sentence and counts every occurrence of the word "the" (uppercase, lowercase, or a combination) in the sentence. Use the indexOf method to do this. The word "the" could also appear in a larger word, such as "Theresa" or "other". Display the count clearly labeled. The program must keep running until the user enters "quit" (upper- or lowercase).
Create a program Substitute that gets a sentence from the user and replaces every occurrence of the word java (uppercase, lowercase, or a combination) with JAVA. You may not change the original content of the sentence except for the substitution of JAVA. Note that Java could appear in a larger word such as JavaScript, openjava, javazon, Ajjavara, Javanese. You MUST use the substring method to do this. Display the modified sentence. The program must keep running until the user enters "quit" (upper- or lowercase).
Use the command prompt window (terminal) for all programs. DO NOT USE REGULAR EXPRESSIONS.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
