Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Code in C++
image text in transcribed
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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions

Question

=+ Are they breakable for any reason?

Answered: 1 week ago

Question

=+When and under what circumstances are contracts renegotiated?

Answered: 1 week ago

Question

=+Are the contracts enforceable?

Answered: 1 week ago