In this Signature Assignment, you will demonstrate your mastery of C++ concepts covered in the course.
In this Signature Assignment, you will demonstrate your mastery of C++ concepts covered in the course.
Problem Set: Complete the following programming projects under Chapter 8. Streams – End-of-Chapter Exercises – Programming Projects – P8.2, P8.6, P8.7, and P8.10.
From the textbook: Big C++: Late Objects, Enhanced:
P8.2
Write a program that checks the spelling of all words in a file. It should read each word of a file and check whether it is contained in a word list. A word list is available on most UNIX systems (including Linux and Mac OS X) in the file /usr/share/dict/words. (If you don’t have access to a UNIX system, you can find a copy of the file on the Internet by searching for /usr/share/dict/words.) The program should print out all words that it cannot find in the word list. Follow this pseudocode:
Open the dictionary file.
Define a vector of strings called words.
For each word in the dictionary file
Append the word to the words vector.
Open the file to be checked.
For each word in that file
If the word is not contained in the words vector
Print the word.
P8.6
Write a program that reads the country data in the file how_to_1/worldpop.txt (included with the book’s source code). Do not edit the file. Use the following algorithm for processing each line. Add characters that are not white space to the country name. When you encounter a white space, locate the next non-white space character. If it is not a digit, add a space and that character to the country name, and keep adding characters until the next white space. If a white space is followed by a digit, unget it and read the number. Print the total of all country populations (excepting the entry for “European Union”).
P8.7
Random monoalphabet cipher. The Caesar cipher, which shifts all letters by a fixed amount, is far too easy to crack. Here is a better idea. As the key, don’t use numbers but words. Suppose the key word is FEATHER. Then first remove duplicate letters, yielding FEATHR, and append the other letters of the alphabet in reverse order:
Now encrypt the letters as follows:
A picture containing font, line, measuring stickDescription automatically generated
Write a program that encrypts or decrypts a file using this cipher. For example,
crypt -d -kFEATHER encrypt.txt output.txt
decrypts a file using the keyword FEATHER. It is an error not to supply a keyword.
P8.10
Playfair cipher. Another way of thwarting a simple letter frequency analysis of an encrypted text is to encrypt pairs of letters together. A simple scheme to do this is the Playfair cipher. You pick a keyword and remove duplicate letters from it. Then you fill the keyword, and the remaining letters of the alphabet, into a 5 × 5 square. (Since there are only 25 squares, I and J are considered the same letter.)
Here is such an arrangement with the keyword PLAYFAIR.
A picture containing text, font, typography, designDescription automatically generated
To encrypt a letter pair, say AM, look at the rectangle with corners A and M:
A close-up of a crosswordDescription automatically generated with low confidence
The encoding of this pair is formed by looking at the other two corners of the rectangle, in this case, FH. If both letters happen to be in the same row or column, such as GO, simply swap the two letters. Decryption is done in the same way.
Write a program that encrypts or decrypts an input text according to this cipher.
Horstmann, C. S. (2017). Big C++: Late Objects, Enhanced eText (3rd ed.). Wiley Global Education US.
Design Specification: Verify that each program design (P8.2, P8.6, P8.7, and P8.10) aligns with the description of the desired interface, including prompts for input and output. Remember that the design should clearly communicate the purpose of the program, the desired behavior the user should engage in, and the results with effective labeling of the output.
Functional Specification: Verify that each program (P8.2, P8.6, P8.7, and P8.10) functions based on the desired capability and process as described in the program description.
Instructions
After analyzing the problem and specifications described in the background above, in a Word document, create the pseudocode (language agnostic and using conventions in the text) that describes the algorithm and logic for the proposed solution to the problem scenario.
Verify that the algorithm and logic are well structured (unambiguous, executable, and terminating) based on conventions described in the reading.
Create C++ projects in Visual Studio for each problem in the set and translate the algorithm and logic described in pseudocode to a working program that has been tested and compiled.
Ensure that a comment header (based on the template provided under Learning Resources) is included at the top of your .cpp file and that descriptive in-line comments that follow conventions described in the reading are used throughout your code. This is the comment header template:
/* —————————————————————————
** I attest that this following code represents my own work and is subject to
** the plagiarism policy found in the course syllabus.
**
** Class: CSC 242
** Assignment: Lesson #
** File: source.cpp
** Description: Enter brief project description here.
**
** Author: Student Name
** Date: Create Date
** ————————————————————————-*/
Create a single zip file containing your Visual Studio project folder and pseudocode document. Name the zip file using the following convention – LastNameFirstNameAssignmentNumber. Example: SmithJohnAssignment5
Last name: Jumah First Name: Maryam so Zip file should be: JumahMaryamAssignment5
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.