Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pleaase help I am no good with this yet. We use MobaXTerm, please help with coding required to make this password generator Spring 2021 CPE

image text in transcribedimage text in transcribedimage text in transcribedPleaase help I am no good with this yet. We use MobaXTerm, please help with coding required to make this password generator

Spring 2021 CPE 211 Project Assignment Project 4 Project 04 (20 points): string functions Submit Your Solution Using Canvas by 10PM on Friday, 02/12/21 (late submissions will be accepted on 02/12/21 from 10PM to 11:59PM) Obtaining Project 4 Input Order and Output Requirements: (By Using the Sample Solution and Comparison Script) To view the order and style of the input and output information for the project, run the provided solution by typing the following at a terminal window prompt. (Note: Input files must be present in the directory that the terminal window is currently in ) Sample Solution path /home/work/cpe211/Executables/Project_04/Project_04_solution Provided sample input files for redirected input are zipped in the file P4_in.zip Comparison Script Path /home/work/cpe211data/Project_04/Compare Solution.bash Project_04.cpp Project 4 Restrictions Only material from Chapters 1 through 4 and any extra code in this handout is allowed. You cannot use any C++ techniques that are covered in Chapters 6 and higher (loops, functions) You are not allowed to use any global variables. Global variables are declared above the int main() line in a program. Global constants can be used - the case studies code in the book uses global constants. In general, most constants are global constants, but until we leam about functions global constants are not necessary - any constants necessary can be declared in main Project 4 Directions: Open a terminal window and move (cd) into the Project_04 directory created in the CPE211_SPR21 directory (This is the directory structure created in project 1.) The command for this is: cd CPE211_SPR20/Project 01 (typing cd CPE211_SPR21/Project_04 works as well). You will need to modify the names as necessary to match your capitalization style for the two directories. Download all needed files from Canvas into this directory Using your favorite text editor (ie gedit) open the existing Project_01.cpp file (this is the header file created in Project 2) and add code to it to complete this project Once you have finished with the program and it compiles without syntax errors, run the executable and verify that the output for your program matches the output from the provided solution sxecutable . Once you are satisfied with your program results, submit your source code (Project_04.cpp) to the Project 4 assignment on Canvas Project 4 Description This program introduces concepts in Chapters 3 and 4. The goal of this project is to implement a simple password generation algorithm using the string class functions and operators introduced during lecture. Page 1 of 3 Spring 2021 CPE211 Project Assignment Project 4 The following procedure will be used to produce a password from the user's first and last names and the three words input by the user. The password generated is written using the following items together in the order listed (no commas between items). user's first initial, user's last initial, length of user's name including the space, first letter, last letter, and length of word, first letter, last letter and length of word2 first letter, last letter, and length of words The program is to prompt for, read in and echo print(look at sample solution echo print style) a users name and three words. The username must be read using the getline function(see the hints section). The words can be read using extraction. The program will then print out the three words entered in a column format showing the length of each word (see the slides and sample solution). The program then prints out the average word length and finally the password generated as described above. The output of your program shall match that of the sample solution. Read the slides and run the sample solution to see the full output requirements for this project. The average word length is stored in a floating point variable and it is to be output with 2 decimal places of precision as shown in the sample solution Your program should work for all provided input files (used with input redirection) Output shall be the same as that shown by the provided solution. . Read this handout; read the slides and run the sample solution. Output of your program shall match that of the sample solution Include the string header file and then use the statement: cout Note. if you copy and paste from a pdf file, the quole marks(single or double) may not copy correctly in gedit, you can tell by the coloration if the quote marks copied correctly if they did not copy correctly, you will have to edit your program and change them if you don't correct the quote marks and you compile your program, you will see errors like the following: Solution/Project_04_solution.cpp:157.1: error stray a 2008 in program Solution/Project_04_solution.cpp:157:1: errorstray 2318 in program Solution/Project_04_solution.cpp:157:1: error stray 1342 in program A Makefile has been provided for this project. The information in that file will be discussed in the lab. Read through the Makefile slides that are provided to get a better understanding This Makefile is the initial exposure to using a makefile for compiling a program. To compile your program, just type make at the command prompt - the file Makefile and your source code(named Project_04.cpp) must be in the directory you are running make in String functions used. These are located in the string header file. o Use Winclude length() or size() - function return value is the number of characters currently stored in the designated variable of type string. find(argument) - Locates the first occurrence of the argument substring in the designated string variable. The return value is the sub-string starting location relative to the position of first character. The lett-most character position is designated position 0. substr(argument, argumenta) return value is the sub-string copied from the designated string variable that begins at position argument and contains argument2 characters operand1 + operand2 string concatenation forms a new string whose value is the operand1 followed by operand2 Output manipulators Use #include and #include endl - ends current line of output fixed-forces the decimal notation output showpoint - forces printing of the decimal point even for whole floating point numbers setprecision(x) - . When fixed or scientific is invoked, setprecision sets the number of digits printed to the right of the decimal point to x for floating point values . When default mode is being used, setprecision sets the number of digits printed to x for floating point values setw(x) use x character positions for the field width of the next iter output. Justification in this field width is either left or right as specified by the user Page 3 of 3 Spring 2021 CPE 211 Project Assignment Project 4 Project 04 (20 points): string functions Submit Your Solution Using Canvas by 10PM on Friday, 02/12/21 (late submissions will be accepted on 02/12/21 from 10PM to 11:59PM) Obtaining Project 4 Input Order and Output Requirements: (By Using the Sample Solution and Comparison Script) To view the order and style of the input and output information for the project, run the provided solution by typing the following at a terminal window prompt. (Note: Input files must be present in the directory that the terminal window is currently in ) Sample Solution path /home/work/cpe211/Executables/Project_04/Project_04_solution Provided sample input files for redirected input are zipped in the file P4_in.zip Comparison Script Path /home/work/cpe211data/Project_04/Compare Solution.bash Project_04.cpp Project 4 Restrictions Only material from Chapters 1 through 4 and any extra code in this handout is allowed. You cannot use any C++ techniques that are covered in Chapters 6 and higher (loops, functions) You are not allowed to use any global variables. Global variables are declared above the int main() line in a program. Global constants can be used - the case studies code in the book uses global constants. In general, most constants are global constants, but until we leam about functions global constants are not necessary - any constants necessary can be declared in main Project 4 Directions: Open a terminal window and move (cd) into the Project_04 directory created in the CPE211_SPR21 directory (This is the directory structure created in project 1.) The command for this is: cd CPE211_SPR20/Project 01 (typing cd CPE211_SPR21/Project_04 works as well). You will need to modify the names as necessary to match your capitalization style for the two directories. Download all needed files from Canvas into this directory Using your favorite text editor (ie gedit) open the existing Project_01.cpp file (this is the header file created in Project 2) and add code to it to complete this project Once you have finished with the program and it compiles without syntax errors, run the executable and verify that the output for your program matches the output from the provided solution sxecutable . Once you are satisfied with your program results, submit your source code (Project_04.cpp) to the Project 4 assignment on Canvas Project 4 Description This program introduces concepts in Chapters 3 and 4. The goal of this project is to implement a simple password generation algorithm using the string class functions and operators introduced during lecture. Page 1 of 3 Spring 2021 CPE211 Project Assignment Project 4 The following procedure will be used to produce a password from the user's first and last names and the three words input by the user. The password generated is written using the following items together in the order listed (no commas between items). user's first initial, user's last initial, length of user's name including the space, first letter, last letter, and length of word, first letter, last letter and length of word2 first letter, last letter, and length of words The program is to prompt for, read in and echo print(look at sample solution echo print style) a users name and three words. The username must be read using the getline function(see the hints section). The words can be read using extraction. The program will then print out the three words entered in a column format showing the length of each word (see the slides and sample solution). The program then prints out the average word length and finally the password generated as described above. The output of your program shall match that of the sample solution. Read the slides and run the sample solution to see the full output requirements for this project. The average word length is stored in a floating point variable and it is to be output with 2 decimal places of precision as shown in the sample solution Your program should work for all provided input files (used with input redirection) Output shall be the same as that shown by the provided solution. . Read this handout; read the slides and run the sample solution. Output of your program shall match that of the sample solution Include the string header file and then use the statement: cout Note. if you copy and paste from a pdf file, the quole marks(single or double) may not copy correctly in gedit, you can tell by the coloration if the quote marks copied correctly if they did not copy correctly, you will have to edit your program and change them if you don't correct the quote marks and you compile your program, you will see errors like the following: Solution/Project_04_solution.cpp:157.1: error stray a 2008 in program Solution/Project_04_solution.cpp:157:1: errorstray 2318 in program Solution/Project_04_solution.cpp:157:1: error stray 1342 in program A Makefile has been provided for this project. The information in that file will be discussed in the lab. Read through the Makefile slides that are provided to get a better understanding This Makefile is the initial exposure to using a makefile for compiling a program. To compile your program, just type make at the command prompt - the file Makefile and your source code(named Project_04.cpp) must be in the directory you are running make in String functions used. These are located in the string header file. o Use Winclude length() or size() - function return value is the number of characters currently stored in the designated variable of type string. find(argument) - Locates the first occurrence of the argument substring in the designated string variable. The return value is the sub-string starting location relative to the position of first character. The lett-most character position is designated position 0. substr(argument, argumenta) return value is the sub-string copied from the designated string variable that begins at position argument and contains argument2 characters operand1 + operand2 string concatenation forms a new string whose value is the operand1 followed by operand2 Output manipulators Use #include and #include endl - ends current line of output fixed-forces the decimal notation output showpoint - forces printing of the decimal point even for whole floating point numbers setprecision(x) - . When fixed or scientific is invoked, setprecision sets the number of digits printed to the right of the decimal point to x for floating point values . When default mode is being used, setprecision sets the number of digits printed to x for floating point values setw(x) use x character positions for the field width of the next iter output. Justification in this field width is either left or right as specified by the user Page 3 of 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data And Hadoop Fundamentals Tools And Techniques For Data Driven Success

Authors: Mayank Bhushan

2nd Edition

9355516665, 978-9355516664

More Books

Students also viewed these Databases questions

Question

=+ Are these impediments deliberate?

Answered: 1 week ago

Question

Analyse the various techniques of training and learning.

Answered: 1 week ago