Question: The MIX computer (Knuth, The Art of Computer Programming, Volume 1) has a 56 characters, with numeric values 0 .. 55 as in the following
The MIX computer (Knuth, The Art of Computer Programming, Volume 1) has a 56 characters, with numeric values 0 .. 55 as in the following table:


Write an application that encodes a 5 MIX-character string into a single int variable and decode an int value back into MIX-characters. Read the string from the user and print the encoded number and decoded string. The MIX-characters are restricted to the range from A to I (inclusive). As preparation, review the text Appendix B Number Systems (which includes base conversion). You may want to use 5 char variables, called c1, c2, c3, c4, c5 to hold the five characters.
Char Value Char Value Char Value Char Value 0 space 14 M 28 Y 42 1 A 15 IN 29 Z 43 2 B 16 O 30 0 44 + 3 C 17 31 1 45 4 D 18 Q 32 2 46 5 19 R 33 3 47 6 F 20 |34 4 48 7 G 21 11 35 5 49 8 H 22 S 36 6 50 9 23 T 37 7 51 10 U 38 8 52 @ J 25 V 39 9 53 Value Char Value Char Value Char Value Char 12 K 26 W 40 54 13 L 27 X 41 55 Char Value Char Value Char Value Char Value 0 space 14 M 28 Y 42 1 A 15 IN 29 Z 43 2 B 16 O 30 0 44 + 3 C 17 31 1 45 4 D 18 Q 32 2 46 5 19 R 33 3 47 6 F 20 |34 4 48 7 G 21 11 35 5 49 8 H 22 S 36 6 50 9 23 T 37 7 51 10 U 38 8 52 @ J 25 V 39 9 53 Value Char Value Char Value Char Value Char 12 K 26 W 40 54 13 L 27 X 41 55
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
