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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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