Question: Write a program to prompt a user to enter a number. Then display a menu of choices for the user to select as follows: Please

Write a program to prompt a user to enter a number. Then display a menu of choices for the user to select as follows:

Please choose one of the following options:

1.Print the number in binary separating each nibble with a space.

2.Same as option #1, but with leading zeros removed.

3.Print the number in binary in reverse order.

4.Print one particular nibble

5.Enter in a new number

6.Quit the program

If the user selects option #4, then prompt them to select the nibble (0 7). After displaying the results based on their choice, repeat the menu, unless option #6 was chosen.

Note: A nibble is 4 binary bits. So, a 32-bit number consists of 8 nibbles. For example, if a register holds the value 0x12345678, then nibble 0 holds the value 8.

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!