Program to decode a secret message

Assignment Help C/C++ Programming
Reference no: EM13939210

For each the following programs, ensure you use the file names identified, comment in an appropriate manner, format your code appropriately (vertical and horizontal whitespace... aka. blank lines and tabs), and use good/appropriate variable names. You should expect the user to always type appropriate input (e.g., not words when a number is requested).

Decoding a secret message

Write a program that decodes a message that was encoded using a random key. These keys work similar to a magic decoder wheel (where 'A' encodes to 'F', 'B' encodes to 'G', 'C' encodes to 'H', etc)except there is a random mapping from one letter to another...

alphabet ABCDEFGHIJKLMNOPQRSTUVWXYZ
random key BDALJIFVKZEQRUXWYNTCMSGPOH

plain message encodded message
CRACKER ANBAEJN

You job is to read in a file named "encoded.txt" that contains 3 lines:

1. the random key (all uppercase)

2. the number of characters in the message (this will never be as high as 100, so an array of 100 characters will be a perfect variable to read the message into, one character at a time)

3. the encoded message (mixed case AND with punctuation and whitespace)

Your program should print the decoded message to the screen, but it should retain the upper or lower case-ness of each letter of the encoded message and print anything that isn't a letter as-is... that way the whitespace and punctuation are retained.

Here's an example encoded.txt for you to test with...
JHTIPBWNFRVDGUCZSLKYOEXQAM
82
Icu'y hp bccdpi ha ynp lctvk ynjy F wcy... F'g roky, F'g roky Jgck blcg ynp hdctv.

Reference no: EM13939210

Questions Cloud

Discuss in detail how this will affect the heart and lungs : Now consider what happens if Jake starts smoking. Discuss in detail how this will affect the heart and lungs. Think about how this habit might affect the homeostasis of the cardiovascular and respiratory system.
Coastal town of portmouthampton : The coastal town of Portmouthampton want to build a monument to celebrate their town's success. Having learned the lessons from the Spinnaker Tower, the council will not proceed with the project unless they have a project plan that can convince th..
Prepare a rate increase announcement : Your task. Prepare a rate increase announcement. Submit it along with memo explaining your rationale for the strategy you chose.
Write persuasive copy by sales letter for small business : This project allows students to demonstrate their ability to write persuasive copy by producing a sales letter for a small business.
Program to decode a secret message : Write a program that decodes a message that was encoded using a random key. These keys work similar to a magic decoder wheel (where 'A' encodes to 'F', 'B' encodes to 'G', 'C' encodes to 'H', etc)except there is a random mapping from one letter to..
A very experienced auditor takes a new auditor : Are they valid? Why or why not?Also, include whether you believe statistical methods are more favorable compared to non statistical samples. Why?
Business communication-self-reflection essay : In this task you are asked to write an essay based upon two significant communication incidents that you have experienced in the workplace.
Journal of experimental social psychology : Review. Read the Guidelines for Discussing Research Article, Part II. Review this week's article (Greitemeyer & Osswald, 2009, Prosocial video games reduce aggressive cognitions [Experiment 1]) using these guidelines (all items in the guidelines e..
Explain the causes of pelvic inflammatory disease : Why are infections of the upper respiratory tract milder as compared to the infections of the lower respiratory tract? Explain the difference between necrotizing ulcerative gingivitis and necrotizing ulcerative peridonitis.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a method that returns the number of digits

Write a method that returns the number of digits in an integer argument; for example, 23,498 has five digits.

  Program that generates 50,000 random integers from 1 to 6

Program that generates 50,000 random integers from 1 to 6 (inclusive). Count the number of times that each number occurs and output the totals

  C program to solve the quadratic equation of rocket launch

Write a C program to solve the quadratic equation of rocket launch by computing the roots (t1 and t2) of that quadratic equation: gt2 + vt + l = 0 (or) for simplicity ax2 + bx + c = 0. Get the values of g, v, and l from the user. The program should d..

  Objectivein this assignment you read a list of employees

objectivein this assignment you read a list of employees from a csv file and convert them into corresponding objects.

  Program to hack a simple account

it should entail how to get the password of such an account.

  Create a program that allows a user to create a bank account

Create a program that allows a user to choose one of the main menu items - If User enters an option other than C, L, or Q, the program does not do anything and shows a message wrong option and displays the menu again.

  Write program that user ask to enter floating point numbers

Write the following program: The user is asked to enter 2 floating point numbers (use doubles). The user is then asked to enter one of the following mathematical symbols: +, -, *, or /.

  Find the average of four 16-bit unsigned integers

Write a program (starting at address $4000) to find the average of four 16-bit unsigned integers stored at locations $5000, $5002, $5004 and $5006 and store the 16-bit result at location $5010.

  Write a program that grades an online quiz

write a program that grades an online quiz. The program asks the student to enter his/her answer to 10 multiple-choice questions. The program stores the student's responses in an array and then compares those responses to the correct answers to de..

  Loops and nested loops

Loops and Nested Loops- Suggest one (1) example of a problematic programming situation or scenario that nested loops could at least partially resolve. Justify your response

  Program of a class date which displays the date

Write a C++ program of a Class Date which displays the date. Use the subsequent requirements:

  Parallel implementations of sum-scan operation

Parallel Implementations of (sum-)Scan Operation and Its Applications - Data Parallel scan operations have the potential to reduce this requirement to O(lg n), thereby speeding up the process drastically for a large number of input elements.

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