Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A program that read names in a text file and sort them alphabetically also outpu

ID: 3666156 • Letter: A

Question

A program that read names in a text file and sort them
alphabetically also output them to the screen with these specifications:
A. The names are to be stored in an input text file, one name per line.
B. Prompt the user to enter the filename via the console keyboard.
C. Skip any blank lines that may be in the input file.
D. Skip any exact duplicates that may be in the input file.
E. Allow up to 25 names. Stop reading the file after the end-of-file is reached, or the 25th name is
added and the list reaches its capacity.
F. Sort the list alphabetically, from A to Z, according to the first letter in the name string. The sorting and checking for duplicates should both be
case-independent. But do not permanently convert the name case -- compare lowercase (or uppercase) versions of the
text for sorting purposes only.
G. Ask the user what name to search for. If the name is not on the list, then add it to the file. Sort the list and output all the names.

Example partial output:

Enter the name of the file containing names: myFriends.txt
Alex
beth
Carl
Pat
Sasha

Its supposed to be a program that can store up to 25 names alphabetically the names are to be stored in an input text file. The program should ask the user what name to search for. If the name is not on the list, then add it to the file. Kinda like finding contacts on your phone if you search Steve on your phone a name will pop up if Steve is not a contact you can add it. Hope it helps Thanks

Explanation / Answer

Please find the required program below :

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote