You are on page 1of 2

#include<vector>

#include <cstdlib>

#include <windows.h>

#include <conio.h>

#include <thread>

#include <iomanip>

int getInput(string str)

int val;

do {

cout << "Enter Your " << str << ": ";

cin >> val;

if (val >= 0)

break;

else

cout << "\t INVALID INPUT" << endl;

} while (1);

return val;

float getTime (string str)

float val;

do {

cout << "Enter " << str << ": ";

cin >> val;

if (val >= 0)

{
break;

else

cout << "\t INVALID INPUT" << endl;

} while (1);

return val;

You might also like