In a simple approach, you get the two integers (numerator and denominator) from the user and use them to create the float.
For example (error handling lefts as exercise)
int n,d;
char sep;
cout << "enter a fraction <int>/<int>" << endl;
cin >> n >> sep >> d;
float f = (float)n/d;