Question: Use Java Please and remember to print a message if the name is not in the list !!! Exercise 4. Write a program that keeps

Use Java Please and remember to print a message if the name is not in the list !!!
Exercise 4. Write a program that keeps track of students in a class. The program will prompt the teacher to enter the total number of students. Then the teacher will input the last names of all the students (multiples of the same last name are possible). Next, the program will ask the teacher to enter a name. The program will print out the indices of all matching last names in the array (or a message that the name is not in the array). The program will then ask the teacher to enter a letter, after which the program will print out all the unique names in the array that start with that letter. Finally, the program will print out the name(s) with the longest number of letters. See below for sample output: Please enter the total number of students:7 Enter the last name: Smith+ Enter the last name: Jian- Enter the last name: Theriault+ Enter the last name: Jones Enter the last name: Dillon Enter the last name: Branson Enter the last name: Jannis Enter a name to search for: Branson Branson is at index 5 Enter a letter to search on: J+ The last names that start with J: Jian Jones Jannis + The longest name is Theriault with 9 letters
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
