Java - Fahrenheit to Celsius (and vice versa) Tutorial! Temperature Calculator in Java and Eclipse!

preview_player
Показать описание
Making a temperature conversion program in Java! Fahrenheit to Celsius and Celsius to Fahrenheit! I will also show how to use a Scanner in java to take in user input as well! Enjoy! If this helped you out, leave a like and subscribe! This also works on IntelliJ or any other Java IDE, as long as you have the same code + utils imported!

Skype: rafa.v35

Twitter: vicunarafael864

instagram: vicunarafael86 #linuxtutorialvideos #ubuntututorialvideos #ubuntulearningtutorial #centostutorialvideos #centosadministrationtutorial #learninghowtoprogramgames #learningunityprogramming #simplecodingtutorial #easycodingtutorials #veryeasycodingtutorials #unityeasygametutorial
Рекомендации по теме
Комментарии
Автор

Thank you! You explained it very well!

adns-
Автор

import java.util.Scanner;

public class fahrenheit {

static double celsius;
static double fahrenheit;


public static void main(String[] args) {

Scanner scan = new Scanner(System.in);
to celsius (1) OR Celsius to Fahrenheit (2) ");
int result= scan.nextInt();

if(result == 1) {
//calculate fahrenheit to celsius

System.out.println("You have chosen FAHRENHEIT to CELCIUS!");
System.out.println("Enter Fahrenheit Value:");
double value = scan.nextDouble();
double valueFinal = (value-32)*5/9;



}else if(result == 2 ) {
// calculate celsius to fahrenheit

System.out.println("You have chosen CELCIUS to FAHRENHEIT! ");
System.out.println("Enter Celcius value: ");
double value2 = scan.nextDouble();
double finalResult = value2 * 1.8 +32;

is:"+fahrenheit);


}else {
// Any numbe that is not 1 or 2
System.out.println("Not a valid choice!");

}

}

}

kostasgoggakhs
Автор

Salamat talaga HAHAHA kanina pa ako hanap ng hanap ng tutorial

FrinceHerlPastrana
Автор

i get an exception error if i print out this programm

baohuycfalcon