Help on C++ Program that generate password

Please i am new here and a C++ beginner, also a student.
I was asked by my lecturer to write a C++ program that will generate password. Such that when a user enter a threee digit password the program would reject and tell user to enter their Four digit number or code to have access.
Do you want the code to show characters or hide them with ***?.

I believe you can use if statements, and generate a min length.
like:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>

int main(){

if(min.length =< 3){
std::cout << " Enter a four digit code please." >> endl;
}

if(min.length = 4){
std::cout<< " Thank you " >> endl;
}

return 0;
}


This code would not work, because you need to include strings, and keyboard inputs. But I would use this metode. I would suggest you, to read a little under the "C++ Tutorials"
Last edited on
Ok Neahle. Thanks, i will do that now.
Topic archived. No new replies allowed.