CSE 1325-001 Homework #2: Secret Code – C++ File Handling, Vectors, and String Processing (Answered)

$35.00

This downloadable ZIP file covers a C++ secret code extraction program using vectors, string manipulation, and text file handling. The resource addresses uppercase character identification, digit summation, consecutive digit recognition, file reading and writing, appending decoded messages, and terminal output.

Original Work ?

Download Details:

  • Name: Homework-2-uxoc1b.zip
  • Type: zip
  • Size: 412.74 KB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (3 votes)

CSE 1325-001 Homework #2 focuses on developing a C++ secret code extraction program using text file processing, vectors, and string manipulation. The assignment explores character classification, uppercase letter extraction, numerical summation, file input and output operations, and an optional bonus exercise involving consecutive digits and two-digit number recognition.

Assignment Description

For this homework assignment, you will be given a text document with a secret code. The text
document contains a series of lowercase words, each on a separate line. Some worlds will have
letters replaced with uppercase letters or numbers. The secret code is all the capital letters put
together and the sum of the numbers.

Here is a list of what you must do:

 Open the file Words.txt to be read
 Store each word in a vector
 Output the list of words to the terminal
 Go through the vector checking each character of each string
 If an uppercase letter, add it to the word
 If a number, add it to a sum of all numbers
 Output the secret code to terminal
 Save the secret code to a file called abc1234_Secret_Code_1.txt
 Append the secret code to the end of the text document that came with the homework

Bonus (10 pts)

The bonus for this homework will work the same as the full credit but with two exceptions. The
first is that you will use the file Bonus_Words.txt. The second that if you see two numbers next
to each other, that is a two digit number, not 2 separate numbers.

Deliverables

You will submit your code and screen shots of your code working via Blackboard. You will
upload a ZIP file, named “abc1234_HW1.zip”, containing 2 files (5 if you did bonus):
 abc1234_Secret_Code_1.cpp (source code)
 Words.txt
 abc1234_Secret_Code_1.png (screen shot of program running)
 abc1234_Secret_Code_1.txt
 abc1234_Secret_Code_2.cpp (source code)
 Bonus_Words.txt
 abc1234_Secret_Code_2.png (screen shot of program running)
 abc1234_Secret_Code_2.txt
 When you submit your file, leave the GTA instructions on how to compile your code and
run it. Note: he will be using terminal on the virtual machine that I used in class.
Instructions can be included as a comment on blackboard or in a README.txt file.
Full credit files named incorrectly result in a loss of 5 points each. Bonus files named incorrectly
will result in a loss of 1 bonus point each.

Solution Overview

The solution implements C++ secret code extraction from text files using vectors, character traversal, uppercase letter concatenation, and numerical summation. It addresses terminal output, file creation, appending decoded results, bonus two-digit number processing, compilation instructions, and execution screenshots.