Question: C++ Program with 4 functions. 1. Hamming Functions Tester Write a function that displays a menu to test the functions from 2 - 4. You

C++ Program with 4 functions.

1. Hamming Functions Tester

Write a function that displays a menu to test the functions from 2 - 4. You must call the functions from 2 - 4 and cannot reimplement their functionality in this function. The menu is displayed as follows: 1) Enter a 4-bit message to encode into a 7-bit Hamming message. 2) Enter a 7-bit Hamming message to transmit through a noisy channel. 3) Enter a 7-bit Hamming message to receive and correct. 4) Quit.

If the user selects 1, the function from Problem 2 is used and so on. All requests for input from the user should be handled inside of this function, and all output to the screen should also be handled inside of this function. Use a while loop to implement the quitting mechanism.

2. Hamming Transmitter Write a function that takes as input a 4-bit string of 0s and 1s. Output the 7-bit encoded message. For example, if the passed parameter is 1011, the output should be 0110011.

3. Noisy Channel Write a function that models a noisy channel. It takes as input the original 7-bit hamming message. Using a random number generator, it randomly selects one of the 7 positions to flip. For example, if the original message is 0110011, the noisy channel randomly flips bit 3 causing the new message to become 0100011. As output, the function should return both the flipped message and the bit that was flipped (3 in this case).

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!