//File: main.cpp
//Main program that uses the functions implemented in useful.h

#include <iostream>
#include "useful.h"

using std::cout;
using std::endl;
using namespace RohnA;

int main()
{

/*
-	GetInteger, GetDouble (both versions), and GetChar
-	Ask (the one that was on the test)
-	A function to display money amounts (you'll pass it a double representing a dollar amount, and it'll output it in the form $12.00)
-	A function to calculate the distance between two points (Cartesian coordinates)
-	A template swap function
*/

	int choice = 0;
	char ch1, ch2;
	int seconds = 0;
	double x1, y1, x2, y2;
	double distance;

	for(;;)
	{
		cout << "\n\nWhat would you like to do?\n"
			 << "1. Swap two characters\n"
			 << "2. Find out how much it would cost to stretch a golden wire that costs $1 per unit between two points\n";

		choice = GetInteger("Choose an option", 1, 3);

		switch(choice)
		{
		case 1:	ch1 = GetChar("Enter the first character");
				ch2 = GetChar("Enter the second character");
				Swap(ch1, ch2);
				cout << "The characters, in reverse order, are " << ch1 << " " << ch2;
				break;
		
		case 2: x1 = GetDouble("First x-coordinate");
				y1 = GetDouble("First y-coordinate");
				x2 = GetDouble("Second x-coordinate");
				y2 = GetDouble("Second y-coordinate");
				distance = Distance(x1, y1, x2, y2);
				cout << "That would cost ";
				DisplayDollar(distance);
				break;
		
		default: break;
		}
		cout << "\n\n";

		if(Ask("Would you like to quit")) break;
	}

	
	return 0;
}