write in c++ and use constructor, friend, const functions

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

write in c++ and use constructor, friend, const functions

Post by answerhappygod »

write in c++ and use constructor, friend, const functions
Write In C And Use Constructor Friend Const Functions 1
Write In C And Use Constructor Friend Const Functions 1 (76.46 KiB) Viewed 27 times
Write a C++ Program using constructor, friend and const functions to decrypt the ciphertext into plain text. This scheme of cipher uses a text string (say, a word) as a key, which is then used for doing a number of shifts on the plaintext. For example, let's assume the key is 'point'. Each alphabet of the key is converted to its respective numeric value: In this case, p - 16, o → 15, i → 9, n - 14, and t - 20. Thus, the key is: 16 15 9 14 20. The sender and the receiver decide on a key. Say 'point is the key. Numeric representation of this key is [16, 15, 9, 14, 20] The sender wants to decrypt the message, say 'pHBNVz'. He will arrange cipher test and numeric key to get the plain text as "Attack" (Toggle Case of each letter) p H B N V z p-16 0-15 i-9 n-14 t-20 P-16 A t t a с K He now left shifts each ciphertext by alphabet by the number written below it to create plain text as shown below: Note: Toggle the case of Plain text while decrypting Input PHBNVZ point Output [16, 15, 9, 14, 20, 16] Attack

Test Input Expected 1 PHBNVZ [16, 15, 9, 14, 20, 16] point Attack N 2 nkhkm [22, 9, 20, 22, 9] SCOPE VIT
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply