Write a function that returns a number

Assignment Help C/C++ Programming
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.

Reference no: EM13808334

Questions Cloud

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

Reviews

Write a Review

C/C++ Programming Questions & Answers

  What is memory leakage

What are the main conceptual differences between object-oriented programming and the other programming techniques and what is the definition of reference variable? What are the differences between pass-by-value and pass-by-reference?

  The big picturethis assignment consists of two separate

the big picturethis assignment consists of two separate programming tasks.1. you will create a linked list module that

  Input parameters, and returns nothing

Write a function called ten2one(), that takes no input parameters, and returns nothing (void). The body of the function must include a loop that counts from 10 down to 1, printing the count value each time in the loop. The output should look like (no..

  Write a program to crypt its input accordingly

Write a program to crypt its input according to a specified transformation scheme

  Write functions which solve each of the following problems

write functions which solve each of the following problems. you must place all of your functions in one project. if you

  Create a text-based, menu-driven program

Create a text-based, menu-driven program that allows the user to choose whether to add, subtract, multiply or divide two numbers. The program should then input two double values from the use

  Make a program to play lottery

make a program to play lottery. The program randomly generates a Lottery of a three-digit number( any number from 100 to 999), prompts the user to enter a three-digit number, and determines

  A define a structure to store roll no name and marks of a

a define a structure to store roll no name and marks of a student.b using the structure of q2. a above write a c

  Write a count occurrences() function that accepts a string

Write a CountOccurrences() function that accepts a string to be searched and a sub-string to be found. The function should return the # of times the sub-string is found. Write a tester file that declares a secret sentence as a constant.

  Use numbers 0 through 23 to represent hours

Write a C function seconds_since_jan1() that takes the time as six integer arguments (year, month, day, hour,minute, and second) and returns the number of seconds since the beginning of the year. Use numbers 1 through 12 to represent months. Use numb..

  Write a program that converts each name

You are given a file consisting of students? names in the following form: lastName, firstName middleName. (Note that a student may not have a middle name.) Write a program that converts each name to the following form: firstName middleName lastNam..

  Multiply a set of complex numbers

Write a C program to multiply a set of complex numbers stored in an array (that has been dynamically allocated). Specifically, first prompt the user to enter how many complex numbers need to be multiplied, dynamically create an array to store the ..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd