/* width2.cpp
	Purpose: to show the difference between integer and "double" division
*/

#include <iostream.h>
using namespace std;

int main ( )
{
	int top, bottom, kyles_answer;
	cout<<"Kyle...? ";
	cin >> kyles_answer;
	cout <<"This program divides integers. Enter a numerator: ";
	cin >> top;
	cout <<"Enter a denominator: ";
	cin >> bottom;
	
	cout << top << "/" << bottom << " is " << top / bottom << endl;
	cout << top << "/" << bottom << " is " 
		<< (1.0*top) / bottom<<endl;
	cout << top << "/" << bottom << " is " << double(top) / bottom<<endl;
	
	cout.setf(ios::fixed);
	cout.setf(ios::showpoint);
	cout.precision(kyles_answer);

//	Predict the output for these:
	cout << top << "/" <<bottom << " is " << (1.0*top) / bottom << endl;
	cout << top << "/" <<bottom << " is " << top / (1.0*bottom) << endl;
	
	cout.precision(2);
 	cout << top << "/" <<bottom << " is " << 1.0*top / bottom << endl;
	cout << top << "/" <<bottom << " is " <<  top / 1.0*bottom << endl;
	cout << top << "/" <<bottom << " is " <<  top /bottom *1.0<< endl;
	cout << top << "/" <<bottom << " is " <<  1.0*(top / bottom) << endl;

	return 0;
}
	
	

	

