Friday, March 19, 2010

JAVA Program to Print the season of a given month

public class Season
{
public static void main(String[] args)
{
int month=4;
switch(month)
{
case 1:
case 2:
case 3:
System.out.println("Automn");
break;
case 4:
case 5:
case 6:
System.out.println("summer");
break;

case 7:
case 8:
case 9:
System.out.println("winter");
break;
case 10:
case 11:
case 12:
System.out.println("spring");
break;
default:
System.out.println("Wrong input");

}
}
}
Download this program Here

JAVA Program to to find whether the given number is Armstrong or not

class Armstrong
{
public static void main(String[] args)
{
int n=143,temp,a=0,i=1;
temp=n;
while(i>0)
{
i=n%10;
a=(i*i*i)+a;
n=n/10;
}
if(a==temp)
System.out.println("the given number is armstrong");
else
System.out.println("the given number is not armstrong");
}
}
Download this program Here

JAVA Program to Print he Default Values

class Defaultvalues
{
static int a;
static byte b;
static char c;
static short s;
static long l;
static float f;
static double d;
static boolean bl;
public static void main(String[] args)
{
 System.out.println("Default values of various data types");
  System.out.println("int: "+a);
System.out.println("byte: "+b);
System.out.println("char: "+c);
System.out.println("short: "+s);
System.out.println("long: "+l);
System.out.println("float: "+f);
System.out.println("double: "+d);
System.out.println("boolean: "+bl);
}
}
Download this program Here

Wednesday, March 3, 2010

‘A’ TO ‘Z’ OF STRESS MANAGEMENT

  • Always take time for yourself, at least30 minutes per day.
  • Be aware of your own stress meter:Know when to step back and cool down.
  • Concentrate on controlling your ownsituation, without controlling everybodyelse.
  • Daily exercise will burn off the stresschemicals.
  • Eat lots of fresh fruit, veggies, bread andwater, give your body the best for it toperform at its best.
  • Forgive others, don't hold grudges and betolerant -- not everyone is as capable as you.
  • Gain perspective on things, howimportant is the issue?
  • Hugs, kisses and laughter: Have fun anddon't be afraid to share your feelingswith others.
  • Identify stressors and plan to deal withthem better next time.
  • Judge your own performance realistically;don't set goals out of your own reach.
  • Keep a positive attitude, your outlook willinfluence outcomes and the way others treatyou.
  • Limit alcohol, drugs and other stimulants,they affect your perception and behaviour.
  • Manage money well, seek advice and save atleast 10 per cent of what you earn.
  • No is a word you need to learn to use withoutfeeling guilty.
  • Outdoor activities by yourself, or with friendsand family, can be a great way to relax.
  • Play your favourite music rather thanwatching television.
  • Quit bad habits.
  • Relationships: Nurture and enjoy them,learn to listen more and talk less.
  • Sleep well, with a firm mattress and asupportive pillow; don't overheat yourselfand allow plenty of ventilation.
  • Treat yourself once a week with a massage,dinner out, the movies: Moderation is the key.
  • Understand things from the other person'spoint of view.
  • Verify information from the sourcebefore exploding.
  • Worry less, it really does not get thingscompleted better or quicker.
  • Xpress: Make a regular retreat to yourfavourite space, make holidays part ofyour yearly plan and budget.
  • Yearly goal setting: Plan what you wantto achieve based on your priorities inyour career, relationships, etc.
  • Zest for life: Each day is a gift, smileand be thankful that you are a part ofthe bigger picture.