SHARING KNOWLEDGE EACH OTHERS!

Wednesday, December 31, 2008

scanner function(celsius convert to fahrenheit )


import java.util.Scanner;

public class TemperatureConverter2
{
//-----------------------------------------------------------------
// using scanner to give input
//-----------------------------------------------------------------
public static void main (String[] args)
{
double celsius;
Scanner scan = new Scanner (System.in);
System.out.println ("Enter celsius :");
celsius = scan.nextDouble();

double fahrenheit;
fahrenheit= (celsius * 9/5 + 32);

System.out.println ("fahrenheit is :" + fahrenheit);
}
}
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