(Solved) : Write Class Encryptablestring Private Member String Str Initialized Constructor String Ent Q42712461 . . .

Write a class EncryptableString that that has aprivate member string str that is initialized by the constructorfrom the string entered by the user.
The EncryptableString class also has a private string enstr thatcontains the encrypted string.
The EncryptableString class has a member function voidencrypt()
This function encrypts the string str contained in the object andstores the result in string enstr by replacing each letter with itssuccessor in the ASCII ordering. For example, the string baa wouldbe encrypted to cbb. Assume that all characters that are part ofthis string are letters a..z and A..Z.
Also assume that the successor of z is a and the successor of Z isA.
The EncryptableString class also has a member function voiddisplay() that displays the original and encrypted stringsaccording to the sample run results below.
Test your class by having a main program that asks the user toenter a string. The program uses the string to initialize aEncryptableString object, calls encrypt(), and then callsdisplay().

6816 9 & a EncryptableString object, calls encrypt(), and then calls display. /* SAMPLE RUN RESULTS RUN 1: This is an encrypt

6816 9 & a EncryptableString object, calls encrypt(), and then calls display. /* SAMPLE RUN RESULTS RUN 1: This is an encryption program. Enter a string to encrypt: madam The original string was madam and the encrypted string is nben. RUN 2: This is an encryption program. Enter a string to encrypt: ZAZB The original string was ZAZB and the encrypted string is ABAC. RUN 3: This is an encryption program. Enter a string to encrypt: zYyzaB The original string was zYyzaB and the encrypted string is aZzAbc. RUN 4: This is an encryption program Enter a string to encrypt: zebra The original string was zebra and the encrypted string is afcsb. Page Break Show transcribed image text 6816 9 & a EncryptableString object, calls encrypt(), and then calls display. /* SAMPLE RUN RESULTS RUN 1: This is an encryption program. Enter a string to encrypt: madam The original string was madam and the encrypted string is nben. RUN 2: This is an encryption program. Enter a string to encrypt: ZAZB The original string was ZAZB and the encrypted string is ABAC. RUN 3: This is an encryption program. Enter a string to encrypt: zYyzaB The original string was zYyzaB and the encrypted string is aZzAbc. RUN 4: This is an encryption program Enter a string to encrypt: zebra The original string was zebra and the encrypted string is afcsb. Page Break

Expert Answer


Answer to Write a class EncryptableString that that has a private member string str that is initialized by the constructor from th…

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?