Reference no: EM13808334
Programming Assignment: Assignment Overview
This assignment will give you some experience with dictionaries, as well as some more practice with file I/O.
Part 1: Phone keypads
The international standard letter/number mapping found on the telephone is shown below:
1
2 ABC
3 DEF
4 GHI
5 JKL
6 MNO
7 PQRS
8 TUV
9 WXYZ
0
Write a function that returns a number, given an uppercase letter, as follows:
def getNumber(uppercaseLetter):
Write a test program that prompts the user to enter a phone number as a string. The input number may contain letters. The program translates a letter (upper- or lowercase) to a digit and leaves all other characters intact.
Part 2: File Encryption and Decryption [75 points]
Write a program that uses a dictionary to assign "codes" to each letter of the alphabet.
For example:
codes = { ' A' : ' %' , ' a' : ' 9' , ' B' : ' @' , ' b' : ' #' , etc...}
Using this example, the letter A would be assigned the symbol %, the letter a would be assigned the number 9, the letter B would be assigned the symbol @, and so forth.
The program should open a specified text file, read its contents, and then use the dictionary to write an encrypted version of the file's contents to a second file. Each character in the second file should contain the code for the corresponding character in the first file.
What is the bonds new expected price-bonds duration
: An investor is considering purchasing a $1,000 Treasury bond with a 3- year maturity, a 6% coupon and an 8 % required rate of return. The bond pays interest semi annually. What is the bonds duration? What is the bonds modified duration? What is the b..
|
The sequence of a gene can result in changes
: Single nucleotide changes (point mutations) in the sequence of a gene can result in changes in the amino acid sequence of a protein produced from the mutated gene. One of the most well studied examples of the effects of a mutation on the sequence of ..
|
Energy entrepreneurship paper
: Energy Entrepreneurship Paper
|
Business certificate in leadership
: Success University (SU) is a medium sized undergraduate institution located in Southern California. SU offers Associates and Bachelors programs in Business, Psychology and Education at their San Moreno campus and online. SU has decided to launch ..
|
Write a function that returns a number
: Write a test program that prompts the user to enter a phone number as a string. The input number may contain letters. The program translates a letter (upper- or lowercase) to a digit and leaves all other characters intact
|
What is the operating cash flow for the project in year
: You are evaluating a project for The Tiff-any golf club, guaranteed to correct that nasty slice. You estimate the sales price of The Tiff-any to be $430 per unit and sales volume to be 1,000 units in year 1; 1,500 units in year 2; and 1,325 units in ..
|
There is no regional lymphadenopathy
: Tommy's past medical and family histories are normal. He has been febrile but is otherwise asymptomatic. The physical examination was unremarkable except for moderate, purulent rhinorrhea and 0.5- to 1-cm diameter weeping lesions around the nose and ..
|
Estimate for doubtful accounts
: What effect does lowering the estimate for doubtful accounts have on the income statement and balance sheet -
|
Productive and counterproductive behaviors
: Productive and Counterproductive Behaviors
|