I am a newbie and having some trouble with my logic. Can someone take a look?
I am to write three values as arguments. Return the first argument if it is between the second and third or a -1.0 if the number is not within the range of the second and third numbers.
Also what should i put on lines 55 and 60 after my returns? This is what I have:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
48 float check_valid_input(float check, float low, float high)
49 {
50 float neg = -1.0;
51
52 if(check >= low && check <= high)
53 {
54 cout << "middle" << endl;
55 return check;//unsure where to return too
56 }
57 else (check < low || check > high);
58 {
59 cout << neg << endl;
60 return neg;//unsure where i should return to
61 }
62 }