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;
}

```

Computer Science & Information Technology

You might also like to view...

Consider the data set shown in Table 7.4. Suppose we apply the fol- lowing discretization strategies to the continuous attributes of the data set.

D1: Partition the range of each continuous attribute into 3 equal-sized
bins.
D2: Partition the range of each continuous attribute into 3 bins; where
each bin contains an equal number of transactions
For each strategy, answer the following questions:
i. Construct a binarized version of the data set.
ii. Derive all the frequent itemsets having support ? 30%.

Computer Science & Information Technology

A primary mailing list for new vulnerabilities, called simply __________, provides time-sensitive coverage of emerging vulnerabilities, documenting how they are exploited and reporting on how to remediate them. Individuals can register for the flagship mailing list or any one of the entire family of its mailing lists.

A. Bugs B. Bugfix C. Buglist D. Bugtraq

Computer Science & Information Technology