Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double input_double_range()
- {
- bool valid_input = false;
- double n;
- do
- {
- std::cout << " (enter number between 0 and 24): ";
- std::cin >> n;
- if (0 <=n && n <=24 )
- {
- valid_input = true;
- }
- else // Error statement
- {
- valid_input = false;
- cout << "You have not entered a valid input" << endl
- << endl;
- }
- } while(valid_input == false);
- return n;
- }
Advertisement
Add Comment
Please, Sign In to add comment