checking the user input | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

checking the user input

hi, i have something want to ask about my coding, this is my coding void StudentIN::display(){ cout << "Please enter your name: "; getline(cin,name); cout << "ID: "; getline(cin,noID); cout << " Which one you want to reserved? " << endl; cout << " 1 : Room and Lecturing Equipment" << endl; cout << " 2 : Room only" << endl; cout << " 3 : Lecturing Equipment" << endl; cout <<"Choice: "; getline(cin,roomReserved); cout <<"Please Enter Date(dd/mm/yy): "; getline(cin,date); cout <<"Please Enter Time( Start Time ):"; getline(cin,sTime); cout <<"Please Enter Time( End Time ):"; getline(cin,eTime); cout << "Your submission is SUCCESS. Please wait for our response" << endl; } how do we check the user key-in date/choice is valid or not?? sorry im beginner, thank you in advance (this program form .h file) and from class StudentIN.

1st Nov 2017, 7:41 PM
Rhithym SF
Rhithym SF - avatar
0 Answers