Basically I'm trying to make an "account recovery" program that ask max of 3 questions in order to recover a user password, if user gets "question 1" wrong it'll display "You have been banned!", but if user gets "question 2" wrong it'll ask one more question before banning the user.
I want to know is using "switch" the best method, or is there a simpler way
I'm sorry if this question offends you, I'm obviously new to C++
First things first. Put prototype definitions for function above main and implementations for functions beneath main.
The logic of your program has you asking the first question in the main function (lines 77-80) but more questions are asked inside functions. I wold either put all input/output in the main or in other functions, but not mix the two (given the programs simplicity, I would put all input/output in the main).
Given your switch function has only two possibilities (right or wrong), it would make more since to use an if/else. If they fail the first test, then they will fall out of the loops and the program will end. Otherwise, if their answer is correct, another if/else can be used to determine the second question.
If you are hard set on using functions to make your main() prettier, then you might as well make everything you do in the main one large function, which is counter-intuitive for a simple program.