Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 lettersStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started