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.
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.
|