Write a program to prompt the user to enter number of names to be sorted. This n
ID: 3642187 • Letter: W
Question
Write a program to prompt the user to enter number of names to be sorted. This number of name has a range from 1 to 20 people. Once you have this number then you need to prompt the user to input names as many number of items as he has specified. These names could be in any order. Your program has to sort them (by first name) in ASCENDING order. Once you are done, you need to clear screen and print the result. Your first output should be the original set of names (unsorted), then followed by second set of your output (sorted names). At the end of the list, your program has to check whether or not the user wants to quit. If he selects "Q" or "q", then your program should clear the screen and terminate your program.Explanation / Answer
#include #include #include void sortptrs(char * nameptr[], int n); main() { int what, limit, j; char name[20][15]; char why; what = 2; while(what == 2) { cout > limit; for (j=0; j name[j]; } sortptrs(name, limit); for (j=0; jRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.