isplay base 10 positive integers in any base >10 (recursive)
What will be an ideal response?
```
int main()
{
int decimalNumber, // decimal number to convert
base; // base to convert to
char another, // loop control
skipChar; // input error character
bool error; // input error flag
cout << endl;
do {
cout << "Base to convert to => ";
cin >> base;
if (cin.fail()){
cin.clear();
error = true;
cin >> skipChar;
} else {
error = false;
}
} while (error || (base < 2) || (base >= 10)); // check for valid base (2-9)
do {
do {
cout << "Positive integer to convert => ";
cin >> decimalNumber;
if (cin.fail()){
cin.clear();
error = true;
cin >> skipChar;
} else {
error = false;
}
} while (error || (decimalNumber < 0)); // check for positive integer
cout << decimalNumber << " in base " << base << " is ";
displayInBase(decimalNumber, base);
cout << endl << "Convert another? (Y/N) => ";
cin >> another;
} while ((another == 'Y') || (another == 'y'));
cout << endl << endl;
return 0;
}
```
You might also like to view...
On an activity diagram, what is used to show parallel activities?
A) an arrow B) a synchronization bar C) a swim lane D) a diamond
In the ________ view for a form, a user can view, create, edit and delete a record
Fill in the blank(s) with correct word
_________ provides the highest level of wireless networking authentication security
a. WEP b. WPA2-Enterprise c. 802.11 d. TCP/IP
Which of the following is NOT a desktop operating system?
A. Windows B. Google Android C. OS X D. Chrome OS