Write a mars program that can perform conversions between


Number Converter:

Write a MARS program that can perform conversions between binary, decimal, and hexadecimal representations for positive integers (under 32 bits).

Your program should accept a string that follows the following format -- invalid inputs or formats should be rejected.

Format: , where the input and output types can be one of "b", "d", "h". Hex inputs will start with 0x and use lower case letters.

You should then print the converted answer and prompt the user again (unless the user enters a string starting with e).

Here is an example run of this program:

What would you like to convert?
d b 33
100001
What would you like to convert?
b h 100010
0x22
What would you like to convert?
h d 0x23
35
What would you like to convert?
d b 4b
Sorry, invalid format.
What would you like to convert?
f g 43
Sorry, invalid format.
What would you like to convert?
e

Request for Solution File

Ask an Expert for Answer!!
Dissertation: Write a mars program that can perform conversions between
Reference No:- TGS02877850

Expected delivery within 24 Hours