Am i writing the correct pseudocode?
Im confuse in pseudocode for while statement.

Start
        declare variables;
        print “choose account types”;
        read choice;
        if choice = ‘a’ then
	
                  while n<=3
	          print userid and password;
                               read userid1 and password;
	          
	          a = strcmp(u,userid1);
	          b = strcmp(p,password);

                                if a = 0 and b = 0
                                        print Thanks for logging in;
	                    else
                                        print Wrong userid or password;
		                        n++;
                  endwhile
       endif


       if choice = ‘A’ then
                               perform login_form2();
       else
                               print error;
	          perform login_form();
       endif

End

Edited 7 Years Ago by DoEds: n/a

also why don't you use
and operator if(!strcmp(pw,pw)) && if(!strcmp(idid)) { excute following command}; also you should convert a to either upper or lower so you do better only 1 if statement

What are you going to do to the user after 3 tries?

After 3 tries, An error will display...Then the program will end.
Where should i put it?... Above the endwhile?

Edited 7 Years Ago by DoEds: n/a

no after while basically while means repeat code 3 times if he doesnt those 3 times do something then after 3 tries a error should be displayed

Should also exit the while loop if the user enters the correct name and password

This article has been dead for over six months. Start a new discussion instead.