//  Name:  McCabe, Micheal H.
//  Date:  February 11, 2009
// C++ code is to be written here as a note taking exercise

#include <iostream>
#include <string>

using namespace std;
int main ()
{
	char digit12[12]={'0','1','2','3','4','5','6','7','8','9','A','B'};
	string chrs_base12[3];
	int number10=0;
	int quotient=0;
	int dividend=0;
	int remainder=0;
	int place=0;
	int Newbase=12;
	int i=0;
	string str_base12="WHERE IS THIS GETTING MODIFIED?";

	cout << "Program to Convert Base 10 numbers to Base 12" << endl;
	cout << "Enter a base 10 value: ";
	cin >> number10;
	if (number10>9999)
		{
		cout << "Value too large to convert, try again." << endl;
		return 0;
		}
	cout << "Convert " << number10 << " (10) to Base ("<< Newbase << ")" << endl;

	place=3;

	for (i=place; i>=0; i--)
		{chrs_base12[i]="0";}

	quotient=0;
	remainder=0;
	dividend=number10;

	if (number10>=Newbase)
		{
		while (dividend>0)
			{
			quotient=dividend / Newbase;
			cout << "Quotient = " << quotient << endl;
			remainder=dividend % Newbase;
			cout << "Remainder = " << remainder << endl;
			chrs_base12[place]=digit12[remainder];
			dividend=quotient;
			place--;
			}
		}
	else
		{
		//chrs_base12[place]=digit12[dividend];
		}

	place=3;

	//for (i=0; i<=place; i++)
		//{
		//str_base12=str_base12+chrs_base12[i];
		//}

	cout << number10 << "(10)= " << str_base12 << "(12)" <<endl;
	cout << "End of conversion" << endl;
	return 0;
}



