Evaluate and output the value in the given base

Assignment Help C/C++ Programming
Reference no: EM13685

Write C program that will input two values from the user (with a prompt !?) that are a Value and a Base with which you will evaluate and output the Value in the given Base.

The Base (B) will be anything from 1 to 16. Values could be non-negative.

Have a main() method and a sub-method (?) called DivAlg() whose prototype is 

    void DivAlg(int, int);
or
    void DivAlg(int Val, int Base);

A typical call might be DivAlg(-1, 16). The suggestion is that Value is first argument, Base is second.  

For your own survival you probably should check input for valid values (non-negative Value, Base in range). 

Demonstrate fabulosity by choosing fine reprsentative data including some error conditions. 

Recall the actual algorithm ** which simply produces digits IN REVERSE ORDER and thus, you will need to have some intermediate character buffer into which to put ascii characters corresponding to the digit values product.

Use a 'table lookup' to map numeric values to ascii characters. By this I mean that you will declare an array char TABLE[16] ={'0', '1', ... , '9', 'A', 'B' ... }; // for asciification ! You're welcome. and then you can map some digit D by simple array referece a la TABLE[D]

Code should be well documented because a human will read it. Documentation should include:

Initial Description of assignment including who, what when , how etc when due, how to use 
Use prototypes for any methods other than main. 
For any method provide documentation of input , output , and algorithm. 
Any possibly interesting segments of code should be narrated. 
For all methods, declare all variables before any executable code. Thus for (int i = ... ) ought not , and cannot be used.

Reference no: EM13685

Questions Cloud

Theory of the business : The Theory of the Business
Question on security infrastructure and protocols : Question on Security infrastructure and protocols
Small business administration : Identify the likely stage for each venture and describe the type of financing each venture is likely to be seeking and identify potential sources for that financing.
Modern symmetric encryption schemes : Pseudo-random generators, pseudo-random functions and pseudo-random permutations
Evaluate and output the value in the given base : Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.
Intermediate macroeconomics : Use the IS/LM model and the IS-PC-MR model to explain what monetary policy to pursue.
Prepare the bank reconciliation for company : Prepare the bank reconciliation for company.
What is the expected return on the market : What is the expected return on the market and What is the risk-free rate?
Describe the management process : Describe the management process and identify the skills required to manage business organizations.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Design a nested program

How many levels of nesting are there in this design?

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