1. Engineering
  2. Computer Science
  3. code in c...

Question: code in c...

Question details
Code in C++

Description: For this project you will write a program to: a) read-in the 10 first names from a file (the file is a cach) into a 2-dimensional character array, b) output the names to the terminal with each one preceded by a number indicating its original order in the list, c) sort the list of names, and then d) output the sorted names both to the terminal and to a file original order in the list. Although an example input file (Names.txt) is provided, for grading purposes your project will be tested against a file that we will supply butl not be provided to you beforehand. Our test file will be in the same format as the example input file. , agai n with each one preceded by its c The following minimum functionality and structure is required for your program: Make a program that sequentially executes in order the following steps: Asks the user fo Reads in the list of names from the desired input file. Stores the names list in a two-dimensional character array Use character arrays(i.e., Cstrings) to hold your names) r the input and output file names. Prints out the unsorted list of names to the terminal, preceded by their original order in the input file Sorts the list of names by-length. Prints the list of sorted-by-length names to the terminal, preceded by their original order in the input file. Note: You are not allowed to modify in any way the structure of your original 2-dimensional char array to achieve that (i.e. do not try to prepend the order to the each name Cstring) Writes the list of sorted-by-length names to an output file (e.g. SortedByLength.txt), preceded by their original order in the input file. Re-sorts the list of names alphabetically this time. Prints the list of alphabetically-sorted names to the terminal, preceded by their original order in the input file. Note: You are not allowed to modify in any way the structure of your original 2-dimensional char array to achieve that (i.e. do not try to prepend the order to the each name Cstring) Writes the list of alphabetically-sorted names to a different output file (e.g. SortedNames.txt), preceded by their original order in the input file Note: Make sure you implement multiple functions. Make sure you use them.
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution