Question: You will be required to write the following functions: / * * This one takes number that is in base and converts it to new
You will be required to write the following functions:
This one takes number that is in base and converts it to newbase
and returns the number in base
The variable number will be used both to input the number and to
"return" the result. The converted number will be stored in the array
on the right side. The array will be of the given size.
The bases will could be any base between and
number this is an array of characters that stores the number
to be converted. The index after the last character will be the
null terminated character For example, if were stored in
the array then numbers would be numbers would be and
numbers would be
This array will also be use to store the converted number. It will
start on the right. If the array is indices, then number will
still be If the result of the conversion is the number then
number will store and number will store
size this is how large the array is many digits are stored in the array.
base this is the base of the number that is stored in the array
newbase this is the desired new base for the number.
This function will return the number converted to base
uintt convertbases char number unsigned int size, uintt base, uintt newbase ;
This functions takes a number in base and converts it to
the new base
number this is the number you are converting
base this is the base you want to convert number into
result this is an array storing the result of converting the number into the
new base
It will
start on the right. The size is
If the result of the conversion is the number then
number will store and number will store
size this is the size of the array.
void converttobase uintt number, uintt base, char result unsigned int size ;
This one takes the number in the given base and converts it
to base
number this is an array that is storing the individual digits from
the input as characters. The index after the last character will be the
null terminated character For example, if were stored in
the array then numbers would be numbers would be and
numbers would be
numdigits This is how many digits are in the number array. For the
example, this would be
base this is the base for the given number
This returns the value of the number in base
uintt converttobaseten char number unsigned int numdigits, uintt base ;
This function takes i as an integer and returns the character version
of that integer, for example, returns returns When the
integer is greater than the letters AF are returned for
If the input is less than or greater than then is
returned
char tochar int i ;
This function take a character that represents a number and it returns
the integer version of that letter. For example, is and is
For the numbers in the range when their respective letter is
given, then their respective number is returned. For inputs AB
CDE or F then or are returned.
If something other than one of these inputs are given, then is
returned.
int toint char c ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
