Please put comments so I understand the code. Don\'t try to use any loops when w
ID: 3666903 • Letter: P
Question
Please put comments so I understand the code.
Don't try to use any loops when writing a recursive function. If you do, there's a very good chance your function won't be truly recursive. You are free to use helper methods on either of the projects.
Write two recursive functions - one should take as a parameter a C++ string of '1's and '0's that are the binary representation of a positive integer, and return the equivalent int value; the other should take as a parameter a positive int value, and return a C++ string of '1's and '0's that are the binary representation of that number (no leading zeros). The functions should be named binToDec and decToBin. Do not use any number base conversion functionality that is built into C++. The file must be named: converter.cpp
Explanation / Answer
Output:
The binary form is 1010
Output:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.