Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #35994

COMPUTER PROJECT

Newsgroups comp.lang.java.programmer
Date 2016-11-29 21:47 -0800
Message-ID <cb8d4dc5-d021-4fe4-ae28-d29c43f46372@googlegroups.com> (permalink)
Subject COMPUTER PROJECT
From naarayana.kumar@gmail.com

Show all headers | View raw


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.

Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


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