Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Convert Celsius to Fahrenheit
- */
- package lab1;
- import java.util.Scanner;
- /**
- *
- * @author CSE_IT
- */
- public class Lab1 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- System.out.print("Enter temprature in Celcius:");
- Scanner scan =new Scanner(System.in);
- double a;
- a = scan.nextDouble();
- Lab1 obj= new Lab1();
- double b= obj.converter(a);
- System.out.println(b);
- }
- double converter(double cel){
- double temp=((cel/5)*9)+32;
- return temp;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement