SHARING KNOWLEDGE EACH OTHERS!

Wednesday, December 31, 2008

Using Scanner in java(convert metre into centimeter)


import java.util.Scanner;

public class calculation
{
//-----------------------------------------------------------------
// HOW CALCULATE INPUT
//-----------------------------------------------------------------
public static void main (String[] args)
{
int meter;
int centimeter;

Scanner scan = new Scanner (System.in);

System.out.print ("Enter meter : ");
meter = scan.nextInt();

centimeter = meter* 100;

System.out.println ("centimeter is : " + centimeter);
}
}
GO TO CHAPTER 3

Stumble
Delicious
Technorati
Twitter
Facebook

0 Comments:

Post a Comment

Enter your email address:

 

SOFTWARES AND PLATFORMS Copyright © 2010 LKart Theme is Designed by Lasantha