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

  Define the class bankaccount

Define the class bankAccount to implement the basic properties of a bank account. An object of this class should store the following data: Account holder's name (string), account number (int), account type (string, checking/saving), balance (double),..

  What is a cell reference

What is a cell reference (also called a cell address) and what is the significance of being able to use them in spreadsheet formulas?

  Branching statements to control the flow of a program

The purpose of this exercise is to give you an opportunity to practice using cin to handle user keyboard inputs, use branching statements to control the flow of a program, and work on your C++ programming style

  Write a function called distance

Write a function called distance that takes two Points as arguments and returns the distance between them.

  You will implement a simplified version of the set class

you will implement a simplified version of the set class. you must implement all functions defined in the provided file

  Write a program that accepts as input a string variable

Write a program that accepts as input a string variable called strFirstName, then another string variable called strLastName, and an integer variable called intAge.

  Integer arguments representing feet

A constructor that will take a single integer argument representing a whole number of feet • A constructor that will take two integer arguments representing feet and inches respectively • A constructor that will take three integer arguments represent..

  Prepare program to check the syntax of the english language

Determine the form of the output dependent on the coefficients being input. Print and evaluate with peers in class."

  Calculate the total of a purchase from a farmer''s market

You will develop a program that can calculate the total of a purchase from a farmer's market that sells apples, bananas, and oranges. At this particular market, apples are $1.99/lb., bananas are $0.99/lb., and oranges are $1.50/lb. Users should be..

  Write a program that reads ten numbers

Write a program that reads ten numbers from input and prints them in reverse order.

  Write fibonacci function that calculates the nth number

The Fibonnacci numbers begin with the numbers 0 and 1 and have the property that each succeeding number is the sum of the two preceding numbers. For xample: 0,1,1,2,3,5,8,13,21,...etc. Write Fibonacci() function that calculates the n'th Fibonacci ..

  We wish to process survey results

Suppose we wish to process survey results that are stored in a file. This exercise requires twoseparate programs. First, create a program that prompts the user for survey responses and outputseach response to a file

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