开发者

Java Program using Loops and Jump Statement

I need to create a program that will ask a password three times. But at the third time, having incorrect password, it will just ask for your name. We are asked to use loops on this and jump statements. Ple开发者_开发知识库ase help. ;)


It's general algoritm,

for (int i = 0; i < 3; i++)
{
   if (i == 2 and password != true_password)
      ask_name();
}

But for more you can give your code.

p.s. declare i in the loop, thank you @glowcoder for remark.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜