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

  Develop a class airborne location

develop a class AirborneLocation that represents the location of airplanes with respect to a reference radar location. Each AirborneLocation object should include data member for aircraftID (integer),

  Represents the nth fibonacci number

Prove by induction that the number of nodes in the activation tree for the Fibonacci function is 2F(n + 1) - 1.

  Write a program with three functions

Write a program with three functions: upper, lower, and reverse.

  Write a program that reads in a list of integer numbers and

Write a program that reads in a list of integer numbers and print out the sum of all numbers, the average, the lowest and the highest value entered. The first input number indicates how many numbers the program is attempting to read. For example, if ..

  Write a program that finds the average time

Write a program that finds the average time spent programming by a student each day over a 3 day period.

  Ruby implement primitive types

How does Ruby implement primitive types, such as those for integer and floating-point data?  3-What is the single most important practical difference between Smalltalk and C++?

  Algorithm to be converted to c language

algorithm to be converted to c language

  Operating system and cpu scheduling

Operating System and CPU Scheduling

  Write a program to evaluate infix expressions

Write a program to evaluate infix expressions and summarize differences between array notation and pointer notation

  Variables should be private and the class functions public

All the class variables should be private and the class functions public. The class functions should be implemented in a file Inventory.cpp which should be linked with the inventory.hpp file.

  Lu decomposition with gauss elimination

The LU decomposition with Gauss elimination and what is the physical interpretation of the elements of ? Write C++ programs for steps 2, 3, and 4.

  Compute the average of each row

Write a program that prompts the user to enter 15 double numbers from the keyboard and save them into a 3 by 5 array in the main ( ). Then call a user-define function to compute the average of each row and print the original matrix and average of ..

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