[Bluej-discuss] please remove the error and send me back the working code

Amit talreja amittalreja1992 at gmail.com
Wed Dec 26 17:39:18 GMT 2007


import java.awt.*;
import java.applet.*;
import java.io.*;

public class amittalreja
{
public static int heart()throws IOException
{
BufferedReader obj=new BufferedReader(new InputStreamReader(
System.in<http://system.in/>
));
System.out.println ("Enter your full name as used in day to day
conversation:");
String g1=obj.readLine();
int g= Integer.parseInt(g1);
double l=g.length();System.out.println("+length"+l);
char buff[]=new char[l];
g.getChars(O,l,buf,0);
int s=0,r,sum=0;
for(int i=0;i<l;i++)
{
if(buf[i]=='A'||buf[i]=='a')
s=s+1;
if(buf[i]=='E'||buf[i]=='e')
s=s+5;
if(buf[i]=='O'||buf[i]=='o')
s=s+6;
if(buf[i]=='I'||buf[i]=='i')
s=s+9;
if(buf[i]=='U'||buf[i]=='u')
s=s+3;
}
do
{
if(s>9 && s!=11&& s!=10&& s!=22)
{
int q=1;
for(;q!=0;)
{
r=s%10;
sum=sum+r;
q=s/10;s=q;
}
s=sum;
    }
}
while(s>9 && s!=10&& s!=11&& s!=22);
return s;
    }
static int outer()throws IOException
{
BufferedReader buf2=new BufferedReader(new InputStreamReader(
System.in<http://system.in/>
));
char
a1[][]={{'A','B','C','D','E','F','G','H','I'},{'J','K','L','M','N','O','P','Q','R'},{'S','T','U','V','W','X','Y','Z'}};

char
a2[][]={{'a','b','c','d','e','f','g','h','i'},{'j','k','l','m','n','o','p',
'q','r'},{'s','t','u','v','w', 'x','y','z'}};
System.out.println("Enter your first name as used in day to day
conversation:");
String g=buf2.readLine();
for(int x=0;x<3;x++)
{
for(int y=0;y<9;y++)
{
System.out.println();
}
int l=g.length();
System.out.println("length "+l);
int l2=l+1;
char buf[]=new char[l2];
g.getChars(O,l,buf,0);
int hh=0,s=0,r,sum=0;
for(int bb=0;bb<l;bb++)
{
System.out.println(buf[bb]);
}
for(int num=0;num<=l-1;num++)
{
hh++;
if((buf[num]!='A')&&(buf[num]!='E')&&(buf[num]!='I')&&(buf[num]!='O')
&&(buf[num]!='O')&&(buf[num]!='U')&&(buf[num]!='a')&&(buf[num]!='i')
&&(buf[num]!='o')&&(buf[num]!='e')&&(buf[num]!='u'))
{for(int il=0;il<3;i++)
{
for(int j=0;j<9;j++)
{
for(int j=0;j<9;j++)
{
if(buf[num]==a1[i1][j]){s=s+(j+l);System.out.println(s);}
else
if(buf[num]==a2[il][j]){s=s+(j+l);System.out.println(s);}
}
}
}
}
do
{
if(s<9&&s!=11&&s!=10&&s!=22)
{
int q=l;
for(;q!=0;)
{
r=s%10;
sum=sum+r;
q=s/10;s=q;
}
s=sum;
   }
}
while(s>9&&s!=10&&s!=11&&s!=22);
return s;
}
class ii
{
static int soul()throws IOException
{
BufferedReader obj=new BufferedReader(new InputStreamReader(
System.in<http://system.in/>
));
System.out.println("Enter your first name as used in day to day
conversation:");
String g= obj.readLine();
intl=g.length();System.out.println("+length"+l);
char buff[]=new char[l];
g.getChars(O,l,buf,0);
int s=0,r,sum=0;
for(int i=0;i<l;i++)
{
if(buf[i]=='A'||buf[i]=='a')
s=s+1;
if(buf[i]=='E'||buf[i]=='e')
s=s+5;
if(buf[i]=='O'||buf[i]=='o')
s=s+6;
if(buf[i]=='I'||buf[i]=='i')
s=s+9;
if(buf[i]=='U'||buf[i]=='u')
s=s+3;
}
do
{
if(s>9 && s!=11&& s!=10&& s!=22)
{
int q=1;
for(;q!=0;)
{
r=s%10;
sum=sum+r;
q=s/10;s=q;
}
s=sum;
    }
}
while(s>9 && s!=10&& s!=11&& s!=22);
return s;
    }
static int life()throws IOException
{
BufferedReader buf2=new BufferedReader(new
InputStreamReader(System.in<http://system.in/>
));

int q=l,rl,sl=0,r2,s2=0,sum=0,r3,s3=0;
System.out.println("Enter the month no.of your birth e.g
.,jan=1,feb=2...dec=12");
String x=objl.readLine();
int m=Integer.parseInt(x);
System.out.println("Enter your birth date(only date e.g.,for 14/09/2000
enter 14)");
String a=objl.readLine();
int d=Integer.parseInt(a);
System.out.println("Enter the birth year(e.g.,;as in the above case enter
2000)");
String b=objl.readLine();
int y=Integer.parseInt(b);
if(m!=11&&m>9)
{
for(;q!=0;)
{
r=m%10;
s=s+r;
q=m/10;m=q;
    }
}
else s=m;
System.out.println("mouth sum; "+s);
do
{
q=l;sl=0;
}
while(s=m);
System.out.println("month sum: "+s);
do
{
q=1;s1=0;
if(d>9&&d!=11&&d!=22)
{
for(;q!=0;)
{
r1=d%10;
s1=s1+r1;
q=d/10;d=q;
}
d=s1;
}
else s1=d;
}
while(s1>9&&s1!=11&&s1!=22);
System.out.println("date sum:"+sl);
do
{
q=1;s2=0;
if(y>9&&y!=11&&y!=22)
{
for(;q!=0;)
{
r2=y%10;
s2=y/10;y=q;
}
y=s2;
}
else s2=y;
}
while(s2>9&&s2!=11&&s2!=22);
System.out.println("year sum: "+s2);
sum=s+s1+s2;
System.out.println("sum"+sum);
do
{
if(sum>9&&sum!=11&&sum!=22)
{
s3=0;
q=1;
for(;q!=0;)
{
r3=sum%10;
s3=s3+r3;
q=sum/10;sum=q;
}
sum=s3;
}
else s3=sum;
}
while(sum>9&&sum!=11&&sum!=22);
return s3;
}
static void display(int var)throws IOException
{
if(var==0)
{
System.out.println("CHARATER TRAITS :Empty yet whole.Essence of all
things,acceptingg and creative.");
System.out.println ("NEGATIVE TENDENCIES :Without form,shapeless.Lack of
detail,unorganized.");
}
else
if(var==1)
{
System.out.println("CHARATER TRAITS :Exeptionally powerfull and dominating
personality.Individualisticand intensely creative and original.An inspired
and inspiring leader and a prioneer.Effecient and determine and good at
initiating new projects.");
System.out.println ("NEGATIVE TENDENCIES :Stobburn and
contrary.Resentingauthority,rarely seeking advice or follow
it.Single Minded,wilful,impatient and possibly quick
tempered.Obstinatelyproud and possibly difficult to deal with.");
}
else
if(var==2)
{
System.out.println ("CHARATER TRAITS :Good at comforting others,inclined to
make up fads.Co operative and good natured,symphathetic and
understanding,helpful and good at keeping a secret.May be shy and timid.");
System.out.println ("NEGATIVE TENDENCIES :Unambitious, lacks self
confidence,insecure and restless.");
}
else
if(var==3)
{
System.out.println("CHARACTER TRAITS:Enjoys being the center of attention
tends to show off and loves to be");
System.out.println("admired, but is quite more sensitive then the exterior
suggests.Has a tendency to");
System.out.println("expand energies wastefull in too many directions.With a
love of pleasure also may be");
System.out.println("wasteful with money");
System.out.println("NEGATIVE TENDENCIES:vain, gossipy and superficial");
}
else
if(var==4)
{
System.out.println("CHARACTER TRAITS:Steady and reliable.Practical and
sensible,calm.Good at managing");
System.out.println("and saving money.Courageous and honest and ethical in
all that they do.Responsible");
System.out.println("reliable and extemely dependable.");
System.out.println("NEGATIVE TENDENCIES:Slow, plodding.Over cautious, too
conservative.Suspicious of");
System.out.println("innovative and strangers.Quick and violent temper");
}
else
if(var==5)
{
System.out.println("CHARACTER TRAITS:Versatile and resourceful,clever and
amusing.Good");
System.out.println("with words optimistic.Lively,inquiring and
utgoing.Someone who makes friends and");
System.out.println("money easily.Lives for exitement and
sensation.Lovesadventure and travel,change");
System.out.println("and anything new.Hates to be tied down, impatient with
rules, laws and conventions");
System.out.println("Attrcted by everything, an opportunist and
sensualist.Erratic,irritabke,untidy,not punctual.Jack of all trade,master of
none-good at many things but not real good at
anything.Boastful,sarastic,rebellious.");

}
else
if(var==6)
{
System.out.println("CHARACTER TRAITS:Equilibrium with others.Enjoys peace
between people.Values");
System.out.println("comfort and ease and enjoys beautiful thing.A negotiator
and peace maker.");
System.out.println("NEGATIVE TENDENCIES:Gossipy,limited outlook,obstinate
and unreasonable.Excessive");
System.out.println("worrying(especially about family members)");
}
else
if(var==7)
{
System.out.println("CHARACTER TRAITS:The
mystic,philosopher.Introspectivethoughtful and somewhat");
System.out.println("aloof.Quiet intuitive and meditative with global
prospective.");
System.out.println("NEGATIVE TENDENCIES:Aloof,isolated,solitary.May be
sensitive but not");
System.out.println("openly and sometimes pessimistic.");
}
else
if(var==8)
{
System.out.println ("CHARACTER TRAITS:Ambitious for power,status,money and
success.May lead to great");
System.out.println("success or sudden failure.Busy with world
affairs.Intrested in the materialization of");
System.out.println ("their dream and desires(into the physical world).This
person may lead to a life of");
System.out.println("constant effort trying to achieve their success in all
matters and therefore avoid");
System.out.println ("responsiblity in their private lives");
System.out.println("NEGATIVE TENDENCIES:Demands recognisation,
selfish,chases material wealth,self-");
System.out.println("centered, thoughtless");
}
else
if(var==9)
{
System.out.println("A true humanitarian, a strong desire to serve your fello
man.Many intrest and sympathies.");
System.out.println("High minded and idealistic, and able to fall in and out
of love with ease and frquency.");
System.out.println("A lover of beauty in all things.May have a difficult
early life, but will succeed through");
System.out.println("determination and resourcefulness.Impressionable,
intuitive and quite independent");
System.out.println("NEGATIVE TENDENCIES:Egoistical and conceited in deal
with individuals.Easily hurt.");
System.out.println("and not much emotional stability, may be
quick-tempered.");
}
else
if(var==10)
{
System.out.println("CHARACTER TRAITS:Exceptionally powerful and dominating
personality.Individualistic");
System.out.println("and intensively original and creative.An inspired and
inspiring leader and pionee.Efficient and determined and good at initiating
new projects.");
System.out.println("NEGATIVE TENDENCIES:Stubborn,rigid especially about
their own ideas.Depressed if");
System.out.println("cought up in the small details of life.May be
jealous.");
}
else
if(var==11)
{
System.out.println("CHARACTER TRAITS:Idealistic,intuitive and
visionary.Highly sensitive and emotional.Very determined in completing
tasks.");
System.out.println("Determined and aware of what others
think.Intuitiverather than rational and may not be");
System.out.println("good in business because the clarity of rational
thinking is more important in that realm");
System.out.println("Good at comforting others,Co-operative and
good-natured,sympathetic and");
System.out.println("understanding, helpful and good at keeping a secret.");
System.out.println("NEGATIVE TENDENCIES:Loving ideals more than fellow
men,providing universal remedies");
System.out.println("without appreciating human needs.May be a dreemer rather
than a doer.");
}
else
if(var==12)
{
System.out.println("CHARACTER  TRAITS:Idealistic,detached,suspended between
the spiritual and physical world.Highly sensitive and emotional.");
System.out.println("Very determining in completing tasks.Good at comforting
other,Co-operated and");
System.out.println("good natured,sympathetic and understanding,helpful and
good at keeping a secret.");
System.out.println("Get along with others.");
System.out.println("NEGATIVE TENDENCIES:Perfectionist.Feeling of being an
outcast,in limbo.A great need");
System.out.println("to find the spiritual within the physical to the point
of matrydm");
}
else
if(var==22)
{
System.out.println("CHARACTER TRAITS:A lover of world peace.Excellent common
sense,practical and");
System.out.println("organizational abilities.Ambitious and full of
ideas.Unconventional in thought and action.");
System.out.println("NEGATIVE TENDENCIES:Lacks faith in others leading to
trying to control people and manipulate them.Could become excessive.May go
to extremes.");
    }
}
public static void main(String args[])throws IOException
{
System.out.println("Enter 1-->HEART'S DESIRE");
System.out.println("Enter 2-->OUTER EXPRESSION");
System.out.println ("Enter 3-->SOUL URGE");
System.out.println("Enter 4-->LIFE PATH");
System.out.println();
System.out.println("Please enter your choice:");
BufferedReader br = new BufferedReader(new InputStreamReader(
System.in<http://system.in/>
));
String hh=obj.readLine();
int c=Integer.parseInt(hh);
int dd;
switch(c)
{
case 1:dd=heart();
       display(dd);
       break;
case 2:dd=Outer();
       display(dd);
       break;
case 3:dd=soul();
       display(dd);
       break;
case 4:dd=life();
       display(dd);
       break;
    default:System.out.println("Invalid Choice");
}
    }
}
    }
}
    }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bluej.org/pipermail/bluej-discuss/attachments/20071226/f8cfd423/attachment.html 


More information about the bluej-discuss mailing list