Java - String Methods Name That Celebrity
Create a new project called NameThatCelebrity in which only partially recognizable names of
celebrities are to be produced. In a real implementation of this game, the idea is for a contestant
to be able to guess the real name of the celebrity after the first two and last three letters are
dropped from the name. We have been given the task of testing the feasibility of this idea by
producing the following printout:
Allan Alda >>> lan A
John Wayne >>> hn Wa
Gregory Peck >>> egory P
Apply the length() and substring() methods to these Strings to produce the above printout.
celebrities are to be produced. In a real implementation of this game, the idea is for a contestant
to be able to guess the real name of the celebrity after the first two and last three letters are
dropped from the name. We have been given the task of testing the feasibility of this idea by
producing the following printout:
Allan Alda >>> lan A
John Wayne >>> hn Wa
Gregory Peck >>> egory P
Apply the length() and substring() methods to these Strings to produce the above printout.
//SAMPLE CODE
//DECLARE VARIABLES
//You come up with different Celebrity names
String name1 = "";
String name2 = "";
String name3 = "";
String name4 = "";
String name5 = "";
//NO INPUT THIS PROGRAM
//PRINT OUT RESULTS