You don't need to use int values. You can do arithmetic with the char values: 'A' and 'Z' directly.