Write a complete program that : (1)Read in 12 names starting with J from an inpu
ID: 3609221 • Letter: W
Question
Write a complete program that :(1)Read in 12 names starting with J from an input file and printsnames. (2)Print the length of each name using functioncall String Length, strlen(s). (3)Put names in Alphabetical order using functioncall String Compare, strcmp(s1, s2). 4)Print the First and Last names (of alphabet order names)using function call String Copy, strcpy(s1, s2) Basically use the functions strlen(s), strcmp(s1, s2),strcpy(s1, s2) with the header file <cstring> Write a complete program that :
(1)Read in 12 names starting with J from an input file and printsnames. (2)Print the length of each name using functioncall String Length, strlen(s). (3)Put names in Alphabetical order using functioncall String Compare, strcmp(s1, s2). 4)Print the First and Last names (of alphabet order names)using function call String Copy, strcpy(s1, s2) Basically use the functions strlen(s), strcmp(s1, s2),strcpy(s1, s2) with the header file <cstring>
Explanation / Answer
This work? The functions you give only work with character arrays,not strings. if you have any questions about what I did feel freeto ask. #include #include #include #include using namespace std; const int numberOfNames = 12; void displayNames(string name[]) { coutRelated 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.