Question: Instructions Write a simple program in C# that can be run on Windows Command prompt given the following specification: This program will be able to

 Instructions Write a simple program in C# that can be run

Instructions Write a simple program in C# that can be run on Windows Command prompt given the following specification: This program will be able to encode a message by inserting hamming bits and decode an encoded message to detect and fix a corrupt message. Name the program as as hamming.cs which will take two command line parameters (-encode or --decode) and message (as binary string). You must validate the input (-d, -de, -dec, -deco, etc. are all valid and similarly, -encode,-encod, -enco, -enc, etc. are all valid). The binary string must be validated to ensure that it contains only binary digits. The binary string can be at most 32 characters long (32 zeros and ones in the input string). The following are some sample input: C: harming -e 1001011 Given message 1001011 Encoded with Hamming bits: 10011010110 C:> hamming-d 10010111100 Single bit error detected at position 7 from left. Message corrected. Original message is: 1001111 You must use Regular Expression to validate the input. Display appropriate error messages for invalid input. Use methods named encode [public static string encode (string binstr) ] and decode [declaration: public static string decode (string binstr) ] for encoding and decoding the input messages. Use method named isValidAction[ public static bool isvalidAction (string actstr) ] to validate action string(-e or -d, etc Instructions Write a simple program in C# that can be run on Windows Command prompt given the following specification: This program will be able to encode a message by inserting hamming bits and decode an encoded message to detect and fix a corrupt message. Name the program as as hamming.cs which will take two command line parameters (-encode or --decode) and message (as binary string). You must validate the input (-d, -de, -dec, -deco, etc. are all valid and similarly, -encode,-encod, -enco, -enc, etc. are all valid). The binary string must be validated to ensure that it contains only binary digits. The binary string can be at most 32 characters long (32 zeros and ones in the input string). The following are some sample input: C: harming -e 1001011 Given message 1001011 Encoded with Hamming bits: 10011010110 C:> hamming-d 10010111100 Single bit error detected at position 7 from left. Message corrected. Original message is: 1001111 You must use Regular Expression to validate the input. Display appropriate error messages for invalid input. Use methods named encode [public static string encode (string binstr) ] and decode [declaration: public static string decode (string binstr) ] for encoding and decoding the input messages. Use method named isValidAction[ public static bool isvalidAction (string actstr) ] to validate action string(-e or -d, etc

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!