/*
2104 Lab #5 Section 3
Tuition Program
*/

#include <iostream>

using namespace std;

int main()
{
	char state, board;
	int price;


	cout << "Please input I if you are in-state or O if you are out-of-state:" << endl;
	cin >> state;
		while(state != 'i' && state != 'I' && state != 'o' && state != 'O')
		{
			cout << "Invalid Input.  Please enter I or O." << endl << endl;
			cout << "Please input I if you are in-state or O if you are out-of-state:" << endl;
			cin >> state;
		}
	cout << "Please input Y if you require room and board or N if you do not:" << endl;
	cin >> board;
		while(board != 'y' && board != 'Y' && board != 'n' && board != 'N')
		{
			cout << "Invalid Input.  Please enter Y or N" << endl << endl;
			cout << "Please input Y if you require room and board or N if you do not:" << endl;
			cin >> board;
		}
//Check/Change lower case input to uppercase for char - state 
if (state == 'i')
	state = 'I';
else if (state == 'o')
	state = 'O';

//Check/Change lower case input to uppercase for char - board
if (board == 'n')
	board = 'N';
else if (board == 'y')
	board = 'Y';

//Calculate price.
if (state == 'I' && board == 'Y')
	price = 5500;
else if (state =='O' && board == 'Y')
	price = 8000;
else if (state == 'I' && board == 'N')
	price = 3000;
else if (state == 'O' && board == 'N')
	price =4500;
cout << "Your total bill for this semester is $" << price << endl;
return 0;
}

