Computers and Technology

Write a C++ program to do the following: Load up an array of names from the files names. data
Assigns integer id's to each name, starting at 1001, and in the order in which they are read from the file (so the first name would be assigned 1001, the second 1002, etc)
We don't have classes yet, so use parallel arrays, i. e., two arrays of the same capacity, the first containing the names, the second the corresponding id
Sort the arrays by name
Write the sorted data to the file results. data, each name / id pair on a separate line
Sample Test Run #1
For example if the file names. data contains:
Langsam
Tenenbaum
Arnow
Weiss
Cox
upon program termination, the console output should be:
5 records processed.
the file results. data should contain:
Arnow 1003
Cox 1005
Langsam 1001
Tenenbaum 1002
Weiss 1004
and the exit code should be 0.
Sample Test Run #2
If the file names. data did not exist, the console output should be:
*** Exception *** input file names. data not found
and the exit code should be 1.
Sample Test Run #3
If the file names. data contains more than 50 names, the console output should be:
*** Exception *** array capacity exceeded
and the exit code should be 1.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:30, ghazanfarwaheed7967
Auniversity wants to install a client-server network. which feature do you think is important for them as they set up the network? sending email blocking multiple people to use the same file low security low set up cost limited access to files
Answers: 1
image
Computers and Technology, 23.06.2019 21:20, nicki76
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
image
Computers and Technology, 24.06.2019 11:00, abolton04
In three to five sentences, describe how you can organize written information logically and sequentially
Answers: 1
image
Computers and Technology, 24.06.2019 12:40, kanga06
Match the feature to the network architecture. expensive to set up useful for a small organization easy to track files has a central server inexpensive to set up difficult to track files useful for a large organization does not have a central server client- server network peer-to-peer network
Answers: 3
Do you know the correct answer?
Write a C++ program to do the following: Load up an array of names from the files names. data
...

Questions in other subjects:

Konu
English, 04.12.2021 14:20
Konu
Health, 04.12.2021 14:20