Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #36000
| From | Rhino <no_offline_contact@example.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer, in |
| Subject | Re: COMPUTER PROJECT |
| Date | 2016-11-30 11:26 -0500 |
| Organization | A noiseless patient Spider |
| Message-ID | <o1mug9$eil$1@dont-email.me> (permalink) |
| References | <cb8d4dc5-d021-4fe4-ae28-d29c43f46372@googlegroups.com> |
Cross-posted to 2 groups.
On 2016-11-30 12:47 AM, naarayana.kumar@gmail.com wrote:
> import java.io.*;
> class Account1
> {
> static InputStreamReader x=new InputStreamReader(System.in);
> static BufferedReader y=new BufferedReader(x);
> public static void Account()throws IOException
> {
>
> System.out.println("\f");
> System.out.println("Enter your name");
> String aa=y.readLine();
> int l=aa.length();
> for(int i=0;i<l;i++)
> {
> char ch=aa.charAt(i);
> int p=(int)ch;
> while(p<67 ||p>122)
> {
> System.out.println("Error please retype");
> System.out.println("Enter your name");
> aa=y.readLine();
> }
> }
> System.out.println("Enter your age");
> int ab=Integer.parseInt(y.readLine());
>
> while(ab>120 || ab<=0)
> {
> System.out.println("You are either too young or old to use the compouter try again");
> ab=Integer.parseInt(y.readLine());
> }
>
> System.out.println("Enter 1 for male enter 2 for female");
> int ac=Integer.parseInt(y.readLine());
> while(ac>=1 && ac<=2)
> {
> System.out.println("Error there are only two options");
> System.out.println("Enter 1 for male enter 2 for female");
> ac=Integer.parseInt(y.readLine());
> }
>
> System.out.println("Enter your username(max 10 characters )");
> String aat=y.readLine();
> while(aat.length()>10)
> {
> System.out.println("Error retype");
> aat=y.readLine();
> }
>
> System.out.println("Enter password for account(max 10 charcters)");
> String ad=y.readLine();
> while(ad.length()>10)
> {
> System.out.println("Please enter correctly again");
> ad=y.readLine();
> }
>
> System.out.println("Confirm password");
> String ae=y.readLine();
> while(ae.equals(ad))
> {
> System.out.println("pls enter properly");
> ae=y.readLine();
> }
>
> System.out.println("Enter birthday dd mm yyyy separately please");
> System.out.println("Example day=2");
> System.out.println(" day=2");
> System.out.println(" month=2");
> System.out.println(" year=2001");
>
> int age=Integer.parseInt(y.readLine());
> while(age>31 && age<0)
> {
> System.out.println("Error!Enter agian");
> age=Integer.parseInt(y.readLine());
> }
> int month=Integer.parseInt(y.readLine());
> while(month<=12 && month>0)
> {
> System.out.println("errorenter agian");
> month=Integer.parseInt(y.readLine());
> }
> int year=Integer.parseInt(y.readLine());
> while(year<2016 && year>1915)
> {
> System.out.println("Error enter agian");
> year=Integer.parseInt(y.readLine());
> }
> System.out.println("Enter 8 digit landline number");
> long aaam=Long.parseLong(y.readLine());
> while(aaam<10000000 && aaam>99999999)
> {
>
> System.out.println("Error retype moblie number");
> aaam=Long.parseLong(y.readLine());
> }
>
> System.out.println("Your location is Perungudi");
>
>
> System.out.println("YOU HAVE CREATED YOUR ACCOUNT.ENTER ANY NUMBER TO PROCEED");
> int ak=Integer.parseInt(y.readLine());
>
> }
> }
>
>
>
> In this program if i enter wrong value it doesnt say ERROR BUT I PUT CORRECT STATEMENT it says error.Please help.
>
I don't know what tools you are using to develop your program but you
may want to consider something like Eclipse, which is free and includes
many tools to help you right better code. One of the most useful tools
in Eclipse - and many other development environments - is a debugger
which lets you execute your program one statement at a time and monitor
the values of the variables in the program. That would let you see how
the program actually behaves, as opposed to the way you *want* it to
behave. As you soon as you see the behaviour diverge from what you
wanted, you've found the problem in your code. (Or at least *one*
problem in your code; if you keep going through the code, you'll likely
find others.)
--
Rhino
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
COMPUTER PROJECT naarayana.kumar@gmail.com - 2016-11-29 21:47 -0800
Re: COMPUTER PROJECT Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-11-30 08:38 -0500
Re: COMPUTER PROJECT lewbloch@gmail.com - 2016-12-01 13:30 -0800
Re: COMPUTER PROJECT Andreas Leitgeb <avl@logic.at> - 2016-11-30 14:30 +0000
Re: COMPUTER PROJECT Rhino <no_offline_contact@example.com> - 2016-11-30 11:26 -0500
Re: COMPUTER PROJECT Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-11-30 12:03 -0500
Re: COMPUTER PROJECT Eric Douglas <e.d.programmer@gmail.com> - 2016-11-30 10:04 -0800
csiph-web