C++

Laboratory 03: Fallout 3 HackingDownload the following files:Lab03Files.zipPassword.cppPassword.hPasswordDriver.cppbuild.bat //modified to use the library that you will createfallout.txtNamespacesFrequently different programmers use the same name for a class. This potential problem is addressed by C++ namespaces. Unzip Lab03Files.zip into a subdirectory called CSC2110. Take a look at a few of the unzipped header files. Notice the namespace braces around the class definition. Each of these classes is in the CSC2110 namespace making it possible to distinguish these classes from those of another programmer that happens to have the same class name (and a different namespace name). Add the CSC2110 namespace to ReadFile and WriteFile. You may need to use (in a few places):using CSC2110::String; //indicates that you will be using a particular class in a particular namespaceThis is the safest way (although it can be more cumbersome than using namespace CSC2110;) to indicate the classes that you wish to use in your program.Note that there is a file called Text.h. This is a header file for the CSC2110::String class. Unfortunately, this is necessary as using String.h as the header file creates an import conflict with the string.h that cannot be solved with namespaces (C++ is not case sensitive). This conflict appears when the String class is not located in the working directory.Run the unzipped build.bat in the CSC2110 directory. This compiles all of the unzipped files as usual and places the (compressed) .o files into a library called libCSC2110.a. To create the library, the last line of build.bat is: ar -r libCSC2110.a *.o (ar stands for archive). Now all that another programmer needs to use the classes in the CSC2110 folder is the library file you just created and the header files. They do not need the .cpp or the .o files.Take a look at build.bat for your working directory (the directory above CSC2110). Note how the compile steps specify the include directory (CSC2110) using the -I option. Further, note how the link step specifies the library directory (also CSC2110) using the -L option and the library to use is specified as -lCSC2110.Using a ListArrayIn Fallout 3, sometimes it is necessary to hack computers. When hacking is attempted (assuming your science skill is high enough to attempt the hack), you are given a list of possible passwords. Each time you try a password from the list, either it is the correct password and you are granted access to the computer, or you are told how many characters in the attempted word match characters in the actual password. The character and its position in the actual password must match to be counted as a character match. By a process of elimination, it is then possible to determine the actual password.Allow the user to specify possible passwords (Strings) from an inpute file (fallout.txt). Next, they will enter which word that they tried as the password, and the number of character matches reported by Fallout 3 (this information is provided external to your program). This information will eliminate several words as possible passwords. The updated list of possible passwords is displayed, and the user is then able to guess another password from the original list. If only one password remains, the program terminates. If no passwords remain, the program also terminates, but this indicates there was a user input error at some point.Your task is to write a Password class that stores the current list of possible passwords in a ListArray. You will need to store the list of original words, the list of possible passwords, and the length of the first word added to the original list to check for input errors.Note that the program also tells you the best word in the original list to guess! The result when guessing this word (if it is not the password) will eliminate the most passwords from the possible passwords list. This has been done for you.Include the following methods in Password:Write Password.h and Password.cpp using the following specification:Password() //constructor~Password() //destructor (there is work to do here, delete the individual words)void addWord(String* word) //add a word to the list of possible passwordsvoid guess(int try_password, int num_matches) //index of guessed word in the list of all words (1-based), number of matches reported by fallout 3, update viable passwords listint getNumberOfPasswordsLeft() //returns the number of possible passwords remainingvoid displayViableWords() //display the current list of possible passwordsint bestGuess() //the best word in the original list to guess next (done for you)String* getOriginalWord(int index) //get a word from the original list of all passwords, 1-basedYour public guess method should call at least one private helper method to count the number of character matches between two Strings. You should use theListArrayIterator rather than a for loop wherever appropriate.MakefileObtain: MakefileObtain: build_make.batEventually compiling everything every time a change is made will become too time consuming. You will use the make utility that is smart enough to recompile only those files that have been updated since the last compile. Now your build batch file (named build_make.bat in this lab) only sets the path and tells the make utility what the drive letter is. Most of the work is done in Makefile.Open Makefile. The FILES = line requests you to list the .o files that make needs to generate for linking. You need to compile Password.cpp and PasswordDriver.cpp, so complete this line with Password.o and PasswordDriver.o. In general, each .cpp file you have will need to be compiled into a .o file. Sometimes you will have only a .h file. Do not list these files.Fill in the EXECUTABLE = line with the name of your executable, including the .exe. PROJECT_PATH is the path to your working directory including the drive letter. This variable is obtained from the build_make batch file, so you don’t need to change it. Fill in the INC_DIRS = with the path to your CSC2110 folder -I$(PROJECT_PATH)/CSC2110/. This is where make will look for header files (i.e. files that you will #include) not in your working directory. Fill in theLIB_DIRS = with the path to your CSC2110 folder -L$(PROJECT_PATH)/CSC2110/. This is where make will look for archived .o files (libraries). Fill in the LIBS = with the name of your libraries (-lCSC2110 for libCSC2110.a). The COMPILE, LINK, and Project lines use previously defined text variables, so they will not need to change.Now you need to tell make how to create the .o files that you listed at the top. At the bottom of your file, type:Password.o:Password.h Password.cpp$(COMPILE) Password.cppThese lines tell make that if either Password.h or Password.cpp have been changed since the last make, the Password.cpp should be recompiled, creating Password.o. Note: tabs rather than spaces must be used to align the text! Repeat this for PasswordDriver.o.Use build_make.bat to compile your program (you still need to specify the drive letter as before). Make a small change (i.e. add a comment) to PasswordDriver.cpp. Recompile with build_make.bat. Notice that only PasswordDriver is recompiled.The below class interfaces are defined in the namespace CSC2110.String methodsString(const char* text) //constructorvoid displayString()int length()const char* getText()int a_to_i()float a_to_f()String* i_to_a(int number) //static methodString* f_to_a(float number) //static methodint find(char delimiter, int start) //find the index of a particular characterString* substr(int start, int end)int compare(String* other)char charAt(int index) //0-basedTokens methodsTokens(String* str, char delimiter) //destructor does not delete the individual tokensString* getToken(int index)int getNumTokens()void displayTokens()ReadFile methodsReadFile(const char* file_name)String* readLine()bool eof()void close()WriteFile methodsWriteLine(String* file_name)void writeLine(String* line)void close()Random methods (use getRandom first)static Random* getRandom()int getRandomInt(int lower, int upper)float getRandomFloat(float lower, float upper)Keyboard methods (use getKeyboard first)static Keyboard* getKeyboard() //call this firstint readInt(string prompt)int getValidatedInt(string prompt, int min, int max)double readDouble(string prompt)double getValidatedDouble(string prompt, double min, double max)String* readString(string prompt)Integer/Double methodsInteger(int val)/Double(double val)int getValue()/double getValue()CD methodsCD(String* artist, String* title, int year, int rating, int num_tracks)void displayCD() //display the current state of the CDString* getKey()void addSong(String* title, String* length)static int compare_items(CD* one, CD* two) //define how to compare CDs (in this case, by title)static int compare_keys(String* sk, CD* cd)static ListArray* readCDs(const char* file_name) //read in all of the CDs from a text fileSong methodsSong(String* title, String* length)void displaySong()

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
Calculate the price
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Upload your instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with Homework Mules
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
Testimonials
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
Business Studies
Great paper thanks!
Customer 452543, January 23rd, 2023
Political science
I like the way it is organized, summarizes the main point, and compare the two articles. Thank you!
Customer 452701, February 12th, 2023
Technology
Thank you for your work
Customer 452551, October 22nd, 2021
Accounting
Thank you for your help. I made a few minor adjustments to the paper but overall it was good.
Customer 452591, November 11th, 2021
Finance
Thank you very much!! I should definitely pass my class now. I appreciate you!!
Customer 452591, June 18th, 2022
Psychology
Thank you. I will forward critique once I receive it.
Customer 452467, July 25th, 2020
Education
Thank you so much, Reaserch writer. you are so helpfull. I appreciate all the hard works. See you.
Customer 452701, February 12th, 2023
Psychology
I requested a revision and it was returned in less than 24 hours. Great job!
Customer 452467, November 15th, 2020
Political science
Thank you!
Customer 452701, February 12th, 2023
11,595
Customer reviews in total
96%
Current satisfaction rate
3 pages
Average paper length
37%
Customers referred by a friend
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat
Show more
<
Live Chat 1 7633094299EmailWhatsApp

Order your essay today and save 15% with the discount code WELCOME