Write a mars program that can perform conversions

Assignment Help Other Subject
Reference no: EM132084391

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

Reference no: EM132084391

Questions Cloud

Centralized organization structure-decentralized one : What are the advantages of a centralized organization structure vs. a decentralized one? What are the disadvantages?
Current price of mummeball common stock : If the required rate of return on this stock (ks) is 12%, what is the current price of Mummeball's common stock?
How many positive 4-digit elegant numbers exist : How many positive 4-digit elegant numbers exist? Some numbers to include are 1345, 5999, 6554, and 7828.
Should i accept or reject the project : Accept or reject decision base? rejected the return is less than risk based or accept the return is greater thank risk based?
Write a mars program that can perform conversions : Write a MARS program that can perform conversions between binary, decimal, and hexadecimal representations for positive integers (under 32 bits).
What earnings before interest and tax : What earnings before interest and tax (EBIT) must the firm have if it were to provide $1 per share to the shareholders? Assume perfect markets.
How to convert the ebit to free cash flow : How to convert the EBIT to free cash flow for the next 12 years?
Cash flow of the loan from the borrower perspective : Calculate (a) The cash flow of the loan from the borrower's perspective (b) The amount of the annual principal repayment (c) The stream of interest payments
Create a simple number guessing game : Create a simple number guessing game. Before the game starts, your program will randomly select a number between one and ten.

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd