Write c program that will input two values from the user

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

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: EM13346785

Questions Cloud

The theory of the businessin a thought-provoking article in : the theory of the businessin a thought-provoking article in the septemberoctober 1994 edition of the harvard business
Question security infrastructure and protocols a pki and : question security infrastructure and protocols a. pki and pgp are two methods for generating and managing public keys
Determine several resources available from the small : determine several resources available from the small business administration sba for entrepreneurs that might be useful
Question 1 let npq where pq are primes of the same length : question 1 let npq where pq are primes of the same length and let phi be eulers totient function. consider the
Write c program that will input two values from the user : write c program that will input two values from the user with a prompt ? that are a value and a base with which you
Question 1consider a government uses an expansionary fiscal : question 1consider a government uses an expansionary fiscal policy to get out of a recession. use the islm model and
The following information is available to reconcile clark : the following information is available to reconcile clark companys book balance of cash with its bank statement cash
Question if the beta of exxon mobil is 065 risk-free rate : question if the beta of exxon mobil is 0.65 risk-free rate is 4 and the market rate of return is 14 evaluate the
Describe the management process and identify the skills : describe the management process and identify the skills required to manage business organizations.explain the role of

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Translate than c source code

Why does Ada take so much more time to translate than C source code? What phase of the Ada translation takes the longest?

  Write code in a client program

prompt use to enter a name and read it from the standard input device.

  Whitewater high school has contracted

Whitewater High School has contracted you to write a program that will read a file of student names and test scores in the formation FIRST NAME LAST NAME: SCORE1 SCORE2 SCORE3, where each of the scores is an integer

  Attribute information about an array of floating point

Write a program that contains a main function and three other functions that will return various attribute information about an array of floating point

  Write a for loop that displays the following set of numbers

Write a for loop that displays the following set of numbers 0, 5, 10, 15, 20, 25 ...... 500.

  Write a program using for loops t

Write a program using for loops to produce the following output. Please read carefully the entire specification!

  Write a program to print the permutation

Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation.

  Generate a two-dimensional array

Generate a two-dimensional array of integers of 10 rows by 10 columns that contains 100 random numbers between 0 and 9. Print out the array (well formatted) and do the following computations

  Display the array, the average and the number of days above

Write a program that stores the daily temperatures for the month of April in an array name dailytemp. Calculate the average temperature for the month and the count the number of days that the daily temperature was above the average.

  Change this code to read in strings from a text file

code takes in a string from a user, checks if the paranthesis are ballanced (as defined by my class) and also returns the variable from my line (also from my class). All like to change this code to read in strings from a text file (each line is a str..

  Create a bar chart showing the average monthly mean temperat

Write a ++ program to create a bar chart showing the average monthly mean temperature for College Station from 2004 to 2013. The point of the exercise is to compute the sie and location of the rectangles rather than explicitely hardcode that informat..

  Write a method named negative sum

Write a method named negativeSum that accepts a Scanner as a parameter reading input from a file containing a series of integers, and determine whether the sum starting from the first number is ever negative

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