Assignment1C: Design a Passphrase. The computer science web comic XKCD provides an often-reposted illustration on password design: 0000000000000000 UNCOMMON (NON-GIBBERISH) BASE WORD Troub4dor &3 TT CAPS? COMMON SUBSTITUTIONS 000 (YOU CAN ADD A FEA MORE BITS TO ACCOUNT FOR THE FACT THAT THIS IS ONLY ONE OF A FEW COMMON FORMATS) ORDER UNKNOWN 00000 الال correct horse battery staple NUMERAL 000 PUNCTUATION 0000 000000000000 900000 900000 DOOOD 00000 00000 FOUR RANDOM COMMON WORDS ~28 BITS OF ENTROPY SHA00000 DOD 0000 D 000 2¹ = 3 DAYS AT 1000 GUESSES/SEC (PLAUSIBLE PITACK ON A WEAK REMOTE WEB SERVICE. YES, CRACKING A STOKEN HASH IS FAS BUT ITS NOT AT THE NEME USER SHOULDERRY ABOUT) DIFFICULTY TO GUESS: EASY ~44 BITS OF ENTROPY 00000000000 00000000000 00000000000 00000000000 2™=550 YEARS AT 1000 GUESSES/SEC DIFFICULTY TO GUESS: HARD WAS IT TROMBONE? NO, TROUBADOR, AND ONE OF THE Os WAS A ZERO? AND THERE WAS SOME SYMBOL... DIFFICULTY TO REMEMBER: HARD THAT'S A BATTERY STAPLE CORRECT DIFFICULTY TO REMEMBER: YOU'VE ALREADY MEMORIZED IT THROUGH 20 YEARS OF EFFORT, WE'VE SUCCESSFULLY TRAINED EVERYONE TO USE PASSWORDS THAT ARE HARD FOR HUMANS TO REMEMBER, BUT EASY FOR COMPUTERS TO GUESS. We want to build a program that will help users create a passphrase based on the principles shown in this comic. You will start by prompting the user to enter four pieces of required information. You must then store those values in the most efficient variable data type possible. You will not receive full points if you use a variable type that is larger than necessary - consult the slides on data types to determine the best one for each value. Hint: Each of the four user-entered variables should have a different data type. Once the data has been entered and stored, you should concatenate the four values into one string value and print the results to the user. You will also display a few variations as shown in the sample output An example of the program's output is shown below. Your program's output must match this format, but it should work for any valid user input. Save your source code in a file called Assignment1C (with a file extension of .cpp, .cs or .java)
Assignment1C: Design a Passphrase. The computer science web comic XKCD provides an often-reposted illustration on password design: 0000000000000000 UNCOMMON (NON-GIBBERISH) BASE WORD Troub4dor &3 TT CAPS? COMMON SUBSTITUTIONS 000 (YOU CAN ADD A FEA MORE BITS TO ACCOUNT FOR THE FACT THAT THIS IS ONLY ONE OF A FEW COMMON FORMATS) ORDER UNKNOWN 00000 الال correct horse battery staple NUMERAL 000 PUNCTUATION 0000 000000000000 900000 900000 DOOOD 00000 00000 FOUR RANDOM COMMON WORDS ~28 BITS OF ENTROPY SHA00000 DOD 0000 D 000 2¹ = 3 DAYS AT 1000 GUESSES/SEC (PLAUSIBLE PITACK ON A WEAK REMOTE WEB SERVICE. YES, CRACKING A STOKEN HASH IS FAS BUT ITS NOT AT THE NEME USER SHOULDERRY ABOUT) DIFFICULTY TO GUESS: EASY ~44 BITS OF ENTROPY 00000000000 00000000000 00000000000 00000000000 2™=550 YEARS AT 1000 GUESSES/SEC DIFFICULTY TO GUESS: HARD WAS IT TROMBONE? NO, TROUBADOR, AND ONE OF THE Os WAS A ZERO? AND THERE WAS SOME SYMBOL... DIFFICULTY TO REMEMBER: HARD THAT'S A BATTERY STAPLE CORRECT DIFFICULTY TO REMEMBER: YOU'VE ALREADY MEMORIZED IT THROUGH 20 YEARS OF EFFORT, WE'VE SUCCESSFULLY TRAINED EVERYONE TO USE PASSWORDS THAT ARE HARD FOR HUMANS TO REMEMBER, BUT EASY FOR COMPUTERS TO GUESS. We want to build a program that will help users create a passphrase based on the principles shown in this comic. You will start by prompting the user to enter four pieces of required information. You must then store those values in the most efficient variable data type possible. You will not receive full points if you use a variable type that is larger than necessary - consult the slides on data types to determine the best one for each value. Hint: Each of the four user-entered variables should have a different data type. Once the data has been entered and stored, you should concatenate the four values into one string value and print the results to the user. You will also display a few variations as shown in the sample output An example of the program's output is shown below. Your program's output must match this format, but it should work for any valid user input. Save your source code in a file called Assignment1C (with a file extension of .cpp, .cs or .java)
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Please write the code in C++

Transcribed Image Text:Assignment1C:
Design a Passphrase. The computer science web comic XKCD provides an often-reposted
illustration on password design:
0000000000000000
UNCOMMON
(NON-GIBBERISH)
BASE WORD
Troub4dor &3
TT
CAPS? COMMON
SUBSTITUTIONS
000
(YOU CAN ADD A FEW MORE BITS TO
ACCOUNT FOR THE FACT THAT THIS
IS ONLY ONE OF A ROW COMMON FORMATS)
ORDER
UNKNOWN
00000
NUMERAL
000
PUNCTUATION
0000
correct horse battery staple
000000000000000000 9000000
DOOOD 00000 00000
FOUR RANDOM
COMMON WORDS
~28 BITS OF ENTROPY
0
000
000
0000
2²⁹ = 3 DAYS AT
1000 GUESSES/SEC
(PLAUSIBLE ATTACK ON A WEAK REMOTE
WEB SERVICE. YES, CRACKING A STOLEN
HASH IS FASTER, BUT ITS NOT HAT, THE
AVERAGE USER SHOULD WORRY ABOUT.)
DIFFICULTY TO GUESS:
EASY
~44 BITS OF ENTROPY
00000000000
00000000000
00000000000
00000000000
2™=550 YEARS AT
1000 GUESSES/SEC
DIFFICULTY TO GUESS:
HARD
WAS IT TROMBONE? NO,
TROUBADOR, AND ONE OF
THE Os WAS A ZERO?
AND THERE WAS
SOME SYMBOL...
DIFFICULTY TO REMEMBER:
HARD
THAT'S A
BATTERY
STAPLE.
CORRECT!
N
DIFFICULTY TO REMEMBER:
YOU'VE ALREADY
MEMORIZED IT
THROUGH 20 YEARS OF EFFORT, WE'VE SUCCESSFULLY TRAINED
EVERYONE TO USE PASSWORDS THAT ARE HARD FOR HUMANS
TO REMEMBER, BUT EASY FOR COMPUTERS TO GUESS.
We want to build a program that will help users create a passphrase based on the principles
shown in this comic.
You will start by prompting the user to enter four pieces of required information. You must
then store those values in the most efficient variable data type possible. You will not receive
full points if you use a variable type that is larger than necessary - consult the slides on data
types to determine the best one for each value.
Hint: Each of the four user-entered variables should have a different data type.
Once the data has been entered and stored, you should concatenate the four values into one
string value and print the results to the user. You will also display a few variations as shown in
the sample output
An example of the program's output is shown below. Your program's output must match this
format, but it should work for any valid user input. Save your source code in a file called
Assignment1C (with a file extension of .cpp, .cs or .java)
![Sample Output:
[XKCD Passphrase Generator]
Enter your third favorite animal: echidna
Enter the subtotal from your last take-out meal: 21.87
Enter a whole number less than |32767|: 23921
Enter a single letter: z
Your passphrase is: echidna 21.87 23921 Z
Other variations are:
Z 23921 echidna 21.87
21.87 Z echidna 23921
23921 echidna Z 21.87](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F4d007796-7b66-4efc-a48f-112d9566cb46%2F73a4a83d-0886-4cda-b9cc-34a8bfa5cbc1%2F5f6d13_processed.png&w=3840&q=75)
Transcribed Image Text:Sample Output:
[XKCD Passphrase Generator]
Enter your third favorite animal: echidna
Enter the subtotal from your last take-out meal: 21.87
Enter a whole number less than |32767|: 23921
Enter a single letter: z
Your passphrase is: echidna 21.87 23921 Z
Other variations are:
Z 23921 echidna 21.87
21.87 Z echidna 23921
23921 echidna Z 21.87
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 5 steps with 1 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education