Question: C++ write 4 functions (but you should write more) functions that do the following: convert_other_base_to_decimal: this function takes a number and its base. It should
C++ write 4 functions (but you should write more) functions that do the following:
convert_other_base_to_decimal: this function takes a number and its base. It should return that same number in decimal. Example: convert_other_base_to_decimal(104, 8) == 68
convert_decimal_to_other_base: this function takes a decimal number and the desired base to convert it to. It should return the number in that other base. Example: convert_decimal_to_other_base(68, 8) == 104
math_in_other_base: this function takes two numbers, their base, and a character representing the mathematical operation to perform. It should return the result (in the specified base). The character can be one of +-*/%
main: the main function should read from standard input the 4 parameters needed for the math_in_other_base function and print the result of calling that function.
To make things a bit easier on you, all numbers will be positive integers and you can assume all numbers are valid (e.g. 19 is not a valid base 8 number). Only bases 1-9 (and decimal) are used. All of the numbers used will fit comfortably in an int.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
