Question: HOMEWORK Problem for C++ Task 1: Operator overloading The task will involve the classes Message and Encryption, located in the given files message.h and encryption.cpp

HOMEWORK Problem for C++ Task 1: Operator overloading The task will involve the classes Message and Encryption, located in the given files message.h and encryption.cpp For this task you will implement the functions provided in the message.h and encryption.h files inside the message.cpp and encryption.cpp files. You are required to create your own makefile NOTE: the main.cpp provided to you is a very dumbed down version of the one used to test on , thus a working main file that matches the provided example output does not guarantee full marks, and as such it is up to you as the student to expand it and test for corner cases. The following functions are required to be implemented: Message Message() The default constructor for Message, it should set the char* message to "Hello World", and the message size to the relevant size for the message. Message(int message_size) Sets the messageSize to the number passed in and creates the message array set to the correct size. ~Message() Delete the message char* correctly. std::istream & operator>>(std::istream &in, Message & other) The overload for the istream operator, it should print out the words "Message size is: ", including the space after the :, followed by the current message size and a newline character. The function should then continue to take input for the size of the message array, and store each input within the message char*. If the user inputs the character #, the function should convert it to a space (thus a character) in the message array. Once all input has been accepted, the function should print out "Message complete", followed by a newline character. 2 Note: The function requires a change in the .h file to in the .h file to make it work std::ostream & operator

Upon completion, 1. Create a makefile that can be used to compile and run all of the respective files. 4 2. Upload your TAR archive containing message.cpp, encryption.cpp, message.h and makefile

Example of OUTPUTHOMEWORK Problem for C++ Task 1: Operator overloading The task will involve

Hello World Subscripl is less Lha using clusesL Subscript is larger than message, using closest Size of message is 11 Hellu Wurld Mes saqe size is: 17 King#in#the#north King in the north Decrypted mes saqes are: HelLo World End of mes sages Enc rypled mes saues are Khoor Zruoq End U Illes sages Dec rypted messages are: Hellu Wurlu King in the north End of mes sages Hello World Subscripl is less Lha using clusesL Subscript is larger than message, using closest Size of message is 11 Hellu Wurld Mes saqe size is: 17 King#in#the#north King in the north Decrypted mes saqes are: HelLo World End of mes sages Enc rypled mes saues are Khoor Zruoq End U Illes sages Dec rypted messages are: Hellu Wurlu King in the north End of mes sages

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!