One approach would be to have them enter the data as a string, and then search the string for a "slash" character. Everything before the slash is assumed to be the numerator, everything afterwards becomes the denominator. You'd then convert each to integers and do the math, storing the result in a double.
Error handling could be a bit tricky - you'd have to catch the jokers who enter stuff like "1/0", "2/-3", ".4/10", etc.
Chip H.