Check the essay

Report a typo

You have been asked to read and check a student's essay about the Eiffel Tower. You've noticed some recurring spelling errors and decided to write a program to correct these mistakes throughout the whole text.

Your program should make all of the following changes (in any context):

  • Franse —> France
  • Eifel tower —> Eiffel Tower
  • 19th —> XIXth
  • 20th —> XXth
  • 21st —> XXIst

Sample Input 1:

The Eifel tower is a wrought-iron lattice tower on the Champ de Mars in Paris, Franse.

Sample Output 1:

The Eiffel Tower is a wrought-iron lattice tower on the Champ de Mars in Paris, France.
Write a program in Java 17
import java.util.Scanner;


class CheckTheEssay {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);

String text = scanner.nextLine();

// write your code here

}
}
___

Create a free account to access the full topic