Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Could you solve this code for me please.and if you can write some explanation using 2 D array please not a vecor Thank you Question
Could you solve this code for me please.and if you can write some explanation using D array please not a vecor
Thank you
Question : Write a CPP program that solves the following problem:
Problem:
A computer science professor designed an algorithm, the algorithm is used to encrypt or decrypt a message. The algorithm uses a matrix of size as shown in figure below:
tableABFGTVWYZ
Algorithm:
Input InputMessage
Get length of InputMessage
Loop from to length
a Capitalize InputMessagei character if alphapet lower case, a lower case character is converted to upper case by subtracting from it
b Search for character InputMessagei in matrix to get its location
c If character found in matrixRowCol then, take the corresponding character in matrixColRow and insert into OuputMessage.
d If character not found then insert space character into OutputMessage
Print the outputMessage
End.
Di:
In
The user should input a string as an InputMessage to encrypt or decrypt
Page of
Output:
The program should print the encrypted or decrypted message
Sample Program Execution:
Sample:
Enter a message to encrypt or decrypt
My Name is Marwan ElHaj,I am years old
Message after Encrypting or Decrypting is:
CE IACY ND CAAI YHAT N AC LQ EYAD S
Sample:
Enter a message to encrypt or decrypt CE IACY ND CAAI YHAT N AC LQ EYAD S
Message after Encrypting or Decrypting is:
MY NAME IS MARWAN ELHAJ I AM YEARS OLD
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started