Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

Write a program in which you set up a douhly-subscripted array to store each character in the wit. Ube ;old loops, and the most efficient  statements to do it. Include documentation (comment stmts.) in your program.

522_Assignment.png

A secret (shhh!): the keyword is PARKING

Have your program read in a message from the text Ilk you will find in Blackboard (please do riot reitamt, thy file), and store its letters with no spaces or punctuation, in a singlyssubscripted array. Then have your plovion use the keyword to encrypt the message and show the encrypted message on the screen. liert is how the encryption works using pencil and paper: Above the letters of the plain text illeSsage, write the lc tern tht: keyWOrd, repeating as much as necessary, For example lithe message is: meet me at midnights you would
write:

1845_Assignmnet1.png

Then look ibr the row in the table that begins with P and find the column headed NI. Use the corresponding letter in the body of the table, which is B. This is the first letter of the encrypted message. Continuing. for the next letter, find the row in the table that begins with . and the column that is headed F. and the body of the table happens to give E. For the next letter, the row beginning with R and the column headed F giN es a your encrypted message starts BEV.... {Notice that frequency-of-occurrence cannot he used to break this code.)

Follow these specifications:

In main, set up an array to hold the 7 characters of the keyword. In this program. do not make an array that stores the keyword repetitively. That would be inefficient. Instead, you can manipulate subscripts.

Declare all your array variables in the main program. Assume the message you Nvill encode has 100 characters or fewer.

In main. open a file for input, and include a trap to make sure it opened correctly.

Call a function to read in the original message and store it in an array. Skip spaces and punctuation. Make your program general enough so it can be run with a different input file that has a different-length message.

Back in the main program. print out the number that says how many characters are stored.

Call a function to set up and store the 2-dimensional Vigenere Table.

Back in the main program. print out the numbers that say how many rows and how many columns were used. Call a function to do the encoding.

Back in the main program. print out to the screen the original message (without spaces or punctuation), and on the line below it, print out to the screen the encrypted message.

Make sure there aren't any extra characters or missing characters.

Check at least some of the results by hand.

Run the program again with the other file's input data, and check the results.
p
lA
A recommendation: to facilitate checking, try your program first with an input file containing just a short phrase - for example

THE MESSAGE.

For the Detailed Plan: The specifications above give a rough starting outline. In your Plan, decide on variable names, types of variables. and in particular, how information from main will be passed down into the functions, and how information from the functions will be passed back to main. Use generic names for the arguments in the functions, that is, different names from what you use in main. You also need to plan in detail what steps need to be carried out inside each function. Your Plan is not to be C++ code.

Before you hand in the (neatly) hand-written Plan, please make a copy for yourself, so you can start %Norking on writing the C--f-+ code.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M9905720
  • Price:- $70

Priced at Now at $70, Verified Solution

Have any Question?


Related Questions in C/C++

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As