My problem here is I don\'t know how to insert a rule wherein if a user inputted a number on the string, it will cout a warning saying it\'s not valid, same wit
cout
you could use cin.fail() method! When cin fails it will be true and you could us a while loop to loop until the cin is true:
cin.fail()
cin
true
while
cin>>d; while(cin.fail()) { cout << "Error: Enter an integer number!"<> d; }