So the program needs to prompt a user to enter a login(6 numbers that are mine)
ID: 3537549 • Letter: S
Question
So the program needs to prompt a user to enter a login(6 numbers that are mine) and a password(random 4 numbers) it should say login successful
then it should tell the user to change the password and it must be a different 4 numbers, if the user does so it will say successfully changed.
if they input the same password then it should tell the user to re enter(3 times max, after 3 it should say login failed)
and this is C programming so commands such as "printf" "scanf" NOT.... "cout cin"
THANKS FOR YOUR HELP
Explanation / Answer
#include #include #include #define MAX_ATTEMPT 3 #define ENTER 13 /* Password is Compared with veejava u can change & check with your password */ void main() { char pass; char password[30]; int x; int col=31; int count=0; int left = MAX_ATTEMPT; int flag=0; do { clrscr(); x=0; gotoxy(20,1); printf("================================"); gotoxy(30,2); printf("Login Program"); gotoxy(20,3); printf("================================"); gotoxy(60,2); printf("Attempt Left : %d",left); gotoxy(20,10); printf("Password : "); do { gotoxy(10,col++); pass = getch(); password[x] = pass; if(pass==ENTER) { break; } pass = '*'; putch(pass); x++; }while(pass != ENTER); password[x] = NULL; if(strcmpi(password,"veejava")==0) { flag=0; break; } else { gotoxy(20,16); printf("Your Password : "); puts(password); gotoxy(30,20); printf("Password is Invalid"); flag=1; getch(); } left--; count++; }while(count != MAX_ATTEMPT); if(flag==0) { gotoxy(20,16); printf("Your Password : "); puts(password); gotoxy(30,20); printf("Password is Valid"); } else { gotoxy(20,22); printf("Login Failed Try After 24 Hours"); } getch(); }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.