#include <iostream>
#include <string>
using namespace std;

char capitalize(char x){
	// cout << "passed in character: " << x << endl;
	int y = static_cast<int>(x);
	// make sure the character can be capitalized
	if ( y >= 97 && y <= 122 ){
		// convert the char to an int and then subtract 32
		// cout << "convert to integer: " << static_cast<int>(x) << endl;
		// cout << "subtract 32: " << static_cast<int>(x)-32 << endl;
		return static_cast<char>(static_cast<int>(x)-32);
	}else{
		return x;
	}
}


int main(){

	char thing = '3';
	cout << "Capitalizing a(n): " << thing << '\t'; 
	cout << capitalize(thing) << endl;
	cout << "Here's the original char: " << thing << endl;

	string greeting = "hello!";

	for(int x = 0; x < greeting.size(); x++){
		cout << capitalize(greeting[x]);
	}
	cout << endl;

	return 0;
}
