How do I make this program in C++? NOTE: THIS ASSIGNMENT SHOULD BE CREATED IN 2 FILES pass.txt: password.txt:

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

How do I make this program in C++? NOTE: THIS ASSIGNMENT SHOULD BE CREATED IN 2 FILES pass.txt: password.txt:

Post by answerhappygod »

How do I make this program in C++?
NOTE: THIS ASSIGNMENT SHOULD BE CREATED IN 2 FILES
How Do I Make This Program In C Note This Assignment Should Be Created In 2 Files Pass Txt Password Txt 1
How Do I Make This Program In C Note This Assignment Should Be Created In 2 Files Pass Txt Password Txt 1 (94.37 KiB) Viewed 49 times
pass.txt:
How Do I Make This Program In C Note This Assignment Should Be Created In 2 Files Pass Txt Password Txt 2
How Do I Make This Program In C Note This Assignment Should Be Created In 2 Files Pass Txt Password Txt 2 (3.03 KiB) Viewed 49 times
password.txt:
How Do I Make This Program In C Note This Assignment Should Be Created In 2 Files Pass Txt Password Txt 3
How Do I Make This Program In C Note This Assignment Should Be Created In 2 Files Pass Txt Password Txt 3 (3.04 KiB) Viewed 49 times
Write a C++ program that will simulate a Change Password Utility. Your program will contain: • One class, Password Manager, that will manage a single password for a given username. • A driver containing a main function that will allow the user to change their password Password Manager Class The Password Manager class should have two member variables (both strings): • a username • an encrypted password. Do not store the password (in the class or in a text file) unencrypted! The Password Manager class should have the following two internal member functions (not accessible outside of the class): encrypt: this takes a password (a string) and returns the encrypted form of the password. Note: there is no decrypt function (there is no need to decrypt passwords). We will use the following VERY simple encryption algorithm (a Caesar Cipher): For every character in the input string, add 37 to the ascii value of the character. The encrypted character's ascii value must stay in the range of printable, non-whitespace characters: 33 to 126. This can be enforced using this formula: strascii value of encrypted char = ((ascii value of ch - 33) + 37) $ 94 + 33 Store all the encrypted chars in a string and return it as the result of the function (hint: start with an empty string, use string.push_back(ch) to add each encrypted character). meets Criteria: this takes a string (a password) and returns true if it meets the following criteria: • it has at least 15 characters. • it contains at least three out of the following four types of characters: o uppercase (use isupper(ch) o lowercase (use islower(ch)) o numbers (use isdigit(ch)) o symbols (use ispunct(ch)) • If the criteria are not met, it returns false.
The Password Manager should have the following member functions that are accessible from outside of the class (from the driver) setUsername: (a setter function) takes a string and stores it in the proper member variable. getUsername: (a getter function) returns the value of the proper member variable. setEncryptedPassword: (a setter function takes a string (an already encrypted password) and stores it in the proper member variable. getEncryptedPassword: (a getter function) returns the value of the encrypted password stored in the proper member variable. setNewPassword: takes a string (a proposed, unencrypted, password). If it meets the criteria in meets Criteria, it encrypts the password and stores it in the member variable and returns true. Otherwise returns false. authenticate: takes a string (a password) and returns true if, once encrypted, it matches the encrypted string stored in the the member variable. Else returns false, Save the class declaration in Password Manager.h and save the member function definitions in Password Manager.cpp (do not inline the member function definitions) Don't change names, parameters or return values of these methods. Otherwise you won't be able to pass all tests.
Password Driver The main function should create an array of 4 instances of the Password Manager class. Your main function will ask for a filename to store the usernames and encrypted passwords in between executions of the program. This file simulates the stored encrypted passwords for users of a computer system. You can download a sample "passwords.txt" file from the Additional files' section of this assignment. When your main function starts, it should try to open the file with the filename you provided. If the file exists, you should assume it contains 4 usernames with encrypted passwords, and the program should use these to set the usernames and encrypted passwords in the password manager array. If the file doesn't exist, exit with an error message. Your program should ask the user to enter the filename, their netid, old password, and new password: Please enter the name of the input file: passwords.txt Please enter your netID: j_8108 Please enter your old password: abcdABCD1234!@#$ Please enter your new password: jjjhFdjdhyas 555 Your program should give one of the following responses: NetID is invalid, password not changed. old password is incorrect. New Password does not meet criteria. Password has been changed for netID: j_s108 If any of the input data is invalid or causes an error message, do NOT ask the user to re-enter the data. After outputting one of the above responses to the screen, the program should output the usernames and three encrypted passwords to the file "passwords.txt", one per line overwriting anything that was previously in the file), then exit. However in order to simplify the testing procedure, please output this data directly to the screen instead. There is a provided passwords.txt file with 4 sample usernames and encrypted password: (note that ()*+fghiVWXYFeHl is the encrypted version of abcdABCD1234!@#$).
NOTES: • Usernames and passwords do not contain any whitespace. When a user enters a password, assume a whitespace character indicates the end of the password. • Put a header comment at the top of each files • ALL of the input and output must be done by the driver. The password manager class should not do ANY input/output, not to the screen OR the file! • Useful functions: isupper(char), islower(char), isdigit(char), ispunct(ch), string.length
lj_s108 111/k+1+/@(:ZZZ fgh123 ()*+fghiVwXYFEHI ert789 ()*+fghiVwXYFEHI cat101 ()*+fghiVwXYFEHI
lj_s108 ()*+fghiVwXYFHI fgh123 ()*+fghiVwXYFEHI ert789 ()*+fghiVwXYFEHI cat101 ()*+fghiVWXYFHI
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply