Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question 1

Polybius was an ancient Greek writer who first proposed a method of substituting different two-digit numbers for each letter. The alphabet is written inside a 5-by-5 square matrix which has numbered rows and columns:


1

2

3

4

5

1

A

B

C

D

E

2

F

G

H

I

J

3

K

L

M

N

O

4

P

Q

R

S

T

5

U

V

W

X

Y/Z

Note that Y and Z are written in the last cell to divide the letters evenly. The context of the message should make clear which of the two letters is intended.

To encode, substitute for each letter the numbers marking the row and column in which the letter appears. Always put the row number first. For example, the number J is 25. The number for J is 25.

The word WATERMELON would be encode as:

53114515433315323534

To decode, simply locate each letter indicate by the number. The number, 53, tells you to find the letter at the intersection of the fifth row and the third column.

Write two function encode and decode. Encode accepts a string of upper case letters and returns a string of digits. Decode accepts a string of digits and returns a string of upper case letters.

Write a function alphaSqueeze that accepts an arbitrary string and returns a string of upper case letters. alphaSqueeze, Write a function digitSqueeze that accepts an arbitrary string and returns a string of digits.

e.g. alphaSqueeze("Ralph124c41") returns "RALPHC" and digitSqueeze("Ralph124c41") returns "12441"

Write a program to thoroughly test the functions.

Question 2

Write a class, Polybius, that encrypts and decripts strings using the Polybius checker board. The class members are decode, encode, alphaSqueeze, digitSqueeze, and the 5 x 5 square matrix described in Polybius Checkerboard 1. The decode and encode are the only public members. alphaSqueeze, digitSqueeze and the matrix are private..

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92071905

Have any Question?


Related Questions in Computer Engineering

Submit a 2- to 3-page paper in which youidentify an

Submit a 2- to 3-page paper in which you: Identify an intercultural area Intercultural interaction with a person from a culture different from your own. Explain why you have selected this area. Describe your personal cul ...

What is the transmission type transmission form

What is the Transmission Type, Transmission Form, Transmission Speed, Address for Transmission and Collusion for hubs?

Question creating an interface please respond to the

Question: "Creating an Interface" Please respond to the following: • Imagine you are managing a design project that will create an interface for automobile mechanics. The interface would be used by the mechanics to look ...

Savings account balance write a program that calculates the

Savings Account Balance Write a program that calculates the balance of a savings account at the end of a period of time. It should ask the user for the annual interest rate, the starting balance, and the number of months ...

Can anyone please describe how the quicksort works

Can anyone please describe how the quicksort works including a discussion of the pivot. Also how it is selected, and why the pivot is important to the quicksort.

Question suppose there are 150 users sharing a

Question : Suppose there are 150 users sharing a communication link. Suppose each user transmits data only 12% of the time. Give the (compact) formula for finding the probability that at most 20 users are transmitting si ...

A mining company wishes to start up a new small gold mine

A mining company wishes to start up a new small gold mine. The initial cost will be $5m and it is expected to extract $3m a year in gold with incurring only $1.5m a year in costs for 5 years. Assume revenue and costs are ...

Suppose that we have a block cipher and want to use it as a

Suppose that we have a block cipher and want to use it as a hash function. Let X be a specified constant and let M be a message consisting of a single block, where the block size is the size of the key in the block ciphe ...

The newly elected president needs to decide the remaining 4

The newly elected president needs to decide the remaining 4 spots available in the cabinet he/she is appointing. If there are 13 eligible candidates for these positions (where rank matters), how many different ways can t ...

What is 4g and its benefits how fast is your internet

What is 4G and its benefits. How fast is your Internet service supposed to be for stationary users?

  • 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