Question: import java.util.Scanner; public class CelsiusToFahrenheit { public static void main(String[] args) { //step 1: define required variables float Celsius = 0; float Fahrenheit = 0;

import java.util.Scanner;

public class CelsiusToFahrenheit

{

public static void main(String[] args)

{ //step 1: define required variables

float Celsius = 0;

float Fahrenheit = 0;

//step 2: Introduce scanner object

Scanner inputDevice = new Scanner(System.in);

// step 3: Get celsius value from user

// using scanner object

System.out.println("Enter the celsius value: ");

Celsius = inputDevice.nextFloat();

//step 4: Conversion formula

Fahrenheit = Celsius * (float)1.8 + (float)32;

//step 5: Print result

System.out.println(Celsius + "deg celsius " + Fahrenheit + " deg fahrenheit");

}

}

how can i get this problem to run in java net beans 12.0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!