Question

For part 1, you will NOT be writing anything in Python. You will be describing how...

For part 1, you will NOT be writing anything in Python. You will be describing how the program will work using words and illustrations if it helps.

Using a dictionary, make a text encrypter/decrypter.

In decrypt mode, if the user inputs “Y r u l8?”, the program should output “Why are you late?”, for example.

In encrypt mode, if the user inputs “See you later”, it should output “c u l8r”.

Obviously you can’t handle every possible phrase, but add as many as you can. Don’t bother with multiword shortcuts for now (LOL, BRB, etc.)

How would this work?

What do you need to do?

Make a written outline of how you would accomplish the task using english or flow diagrams. Do NOT use any Python instructions in your description.

Homework Answers

Answer #1

The projects has two parts one is database designing and the flow.

Instructions for the same .

1. Create a data base with these fields

  

ID Autoincrement primary key
word varchar unique
encryptedWord varchar

Second part.

1. writing a program

a. initialize a string variable.

b. prompt user for input.

c. as user hits enter, trim the input string and check the length of the string

if it is greater than 0 proceed

i. Now copy the string inot one more variable and string search(phase search) in a loop from data base such as we have stored {"id": 1, "word": "Lot's of laugh", "encrypt": "LOL"}

select * form tbl_encrypt_master

loop thrugh it.

if string matches with the word in the database

push it into another array(key as the phase and value as encripted value) and replace the matched with ""(empty string) now we have a smaller scentence,

exit

ii. Now the remainig string which did not matched with any of the string break the string with spaces and put the same into an array.

write a query for each of the word such as

select encrypt from tbl_encrypt_master where word="'+newStringVal[index]+'"

if result of it greater than zero store it into the key value array same as phase.

else also store the same into the array with empty string.

iii. now use the older string and the array where you can use find and replace of the string and phase.

else prompt for input

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a Python program to ask how many elements do users want to create in a...
Write a Python program to ask how many elements do users want to create in a list, then let the user create 2 lists with the number of elements previously entered. Then create and display all combinations of letters, selecting each letter from a different key in a dictionary. Example: How many elements? 2 List 1 = ['a', 'b'] List 2 = ['c', 'd'] Output: ac ad bc bd
Design a pseudocode program that loads an array with the following 7 values. Add one more...
Design a pseudocode program that loads an array with the following 7 values. Add one more word (of your own choosing) for a total of 8 words. biffcomelyfezmottleperukebedraggledquisling Be sure to use lowercase, as shown above. This will make the processing easier. • Ask the user to enter a word • Search through this array until you find a match with the word the user entered. • Once you find a match, output "Yes, that word is in the dictionary"....
Use python language please #One of the early common methods for encrypting text was the #Playfair...
Use python language please #One of the early common methods for encrypting text was the #Playfair cipher. You can read more about the Playfair cipher #here: https://en.wikipedia.org/wiki/Playfair_cipher # #The Playfair cipher starts with a 5x5 matrix of letters, #such as this one: # # D A V I O # Y N E R B # C F G H K # L M P Q S # T U W X Z # #To fit the 26-letter alphabet into...
Python: Simple Banking Application Project Solution: • Input file: The program starts with reading in all...
Python: Simple Banking Application Project Solution: • Input file: The program starts with reading in all user information from a given input file. The input file contains information of a user in following order: username, first name, last name, password, account number and account balance. Information is separated with ‘|’. o username is a unique information, so no two users will have same username. Sample input file: Username eaglebank has password 123456, account number of BB12 and balance of $1000....
Module 4 Assignment 1: Pseudocode & Python with Variable Scope Overview Module 4 Assignment 1 features...
Module 4 Assignment 1: Pseudocode & Python with Variable Scope Overview Module 4 Assignment 1 features the design of a calculator program using pseudocode and a Python program that uses a list and functions with variable scope to add, subtract, multiply, and divide. Open the M4Lab1ii.py program in IDLE and save it as M4Lab1ii.py with your initials instead of ii. Each lab asks you to write pseudocode that plans the program’s logic before you write the program in Python and...
Why will this not work to do a 3 rail encryption? How would I make it...
Why will this not work to do a 3 rail encryption? How would I make it work? Will it encrypt special characters? The program language Python. userString=input("What would you like to decrypt and encrypt?: ") def threeRailEncrypt(plainText): railOne="" railTwo="" railThree="" for i in range(0,len(plainText),3): railOne=railOne+plainText[i] for i in range(1,len(plainText),3): railTwo=railTwo+plainText[i] for i in range(2,len(plainText),3): railThree=railThree+plainText[i] return railThree+railTwo+railOne print() print("Encrypted version:") print(threeRailEncrypt(userString)) def threeRailDecrypt(cipherText): thirdLen=len(cipherText)//3 if len(cipherText)%3==2: x=1 else: x=0 railThree=cipherText[:thirdLen] railTwo=cipherText[thirdLen:2*thirdLen+x] railOne=cipherText[2*thirdLen+x:] plainText=""    for i in range(thirdLen): plainText+=railOne[i]+railTwo[i]+railThree[i] if...
How much money do you think you would earn in a period of 30 days if...
How much money do you think you would earn in a period of 30 days if you were paid as follows: one cent for the first day, two cents for the second day, four cents for the third day, eight cents for the fourth day, and so on (i.e. your salary doubles each day)? Do you think you would make very little money, just a few dollars, at the end of the 30-day period? Let us write a program to...
Python Regular Expressions problem: How do you get string data from file of say rows of...
Python Regular Expressions problem: How do you get string data from file of say rows of IP address and city location values obtained from re.finditer patterns to appear in the same dictionary? for example: text file has 100.200.10.255 New York City 10. 16. 25.254 Los Angeles segment of code includes for item in re.finditer(the_two_patterns, text_file, re.MULTILINE): print (item.groupdict()) result is below that I am getting {‘IP’: ‘100.200.10.255’, ‘city’: None} {‘IP’: None, ‘city’: ‘New York City’} {‘IP’: ‘10.16.25.254’, ‘city’: None} {IP’:...
Please do it in Python Write the simplest program that will demonstrate iteration vs recursion using...
Please do it in Python Write the simplest program that will demonstrate iteration vs recursion using the following guidelines - Write two primary helper functions - one iterative (IsArrayPrimeIter) and one recursive (IsArrayPrimeRecur) - each of which Take the array and its size as input params and return a bool. Print out a message "Entering <function_name>" as the first statement of each function. Perform the code to test whether every element of the array is a Prime number. Print out...
Write a python program that will perform text analysis on an input text using all of...
Write a python program that will perform text analysis on an input text using all of the following steps: 1. Take the name of an input file as a command line argument. For example, your program might be called using python3 freq.py example1 to direct you to process a plain text file called example. More information is given on how to do this below. 2. Read the contents of the file into your program and divide the text into a...