The c++ console application that I am building asks the user to enter a predefined time for input.The predefined times are **09:00AM OR 12:00PM OR 04:00PM**
I am letting the user enter one value,andthe value is stored in a text file as string.
I am already including validations in the back end,
cin >> resTime;
while (!(resTime == "09:00AM" || resTime == "12:00PM" || resTime == "04:00PM")) {
cout << "Invalid input.Read Instructions and enter valid type\n";
cin >> resTime;
}
The above code snippet shows the back end validation. Is there any way for me to make a front end validation?
For example, when the user hits the Down button on the keybord,the list of times available should be shown( 09:00AM OR 12:00PM OR 04:00PM)
I am running visual C++ in visual studio 2015,my OS is Microsoft Windows 10.