Description
For this homework assignment, you will be given two text files that, when used together, will
form a secret code. The first file will contain a series of words with numbers mixed in with the
letters. You must extract the numbers from the words. Then you must use the second file to
map the numbers to the letters. The letters, when combined, will form a word. This word is the
secret code. The numbers will all be positive and be in the range of [0,10).
Here’s a list of what you must do:
When running the program, take in two file names from command line arguments
o This is a CSE 1320 topic. According to curriculum documents, this was supposed
to be covered.
Open the Words.txt file to be read
Store each word in a vector
Output the list of words to the terminal
Go through each word and find the number in each word
Store that number in a separate vector
Output the list of numbers to the vector to the terminal
Open the Map.txt file to be read
Store each number letter pair in a map
Output each pair in the map to the terminal
Match each number from the first file a letter
Output the word formed to the terminal
Create a file called abc1234_output.txt
Write the word to the file
Bonus (5 pts)
The bonus for this homework will work the same as the full credit, but with two exceptions. The
first is you will use Bonus_Words.txt and Bonus_Map.txt. The second is that numbers can be
either positive or negative, and be in the range of (-100,100).
Deliverables
You will submit your code via Canvas. You will upload a ZIP file, named “abc1234_HW2.zip”,
containing 1 folder named “abc1234” and 3 files (6 if you did bonus). Below is an example of
the file structure I’m requesting.
abc1234
o abc1234_Secret_Code_1.cpp (source code)
o Words.txt
o Map.txt
o abc1234_Secret_Code_2.cpp (source code) (BONUS ONLY)
o Bonus_Words.txt (Bonus Only)
o Bonus_Map.txt (Bonus Only)
Your code must compile and run with the following commands:
g++ -std=c++17 -o abc1234_Secret_ Code_1 abc1234_Secret_Code_1.cpp
./abc1234_Hello_World_1 Words.txt Map.txt
Full credit files named incorrectly will result in a loss of 5 points each. Failure to follow proper
file structure will result in a loss of 5 points. Bonus files named incorrectly will result in a loss of
1 bonus point each.