أدري إني طفشتكم ،،
بس هذا التصحيح حق سؤال التحويل من مئوي إلى فهرنهايت،،
كود PHP:
import java.util.*;
/
*
* @author deathpa1N
*/
public class CandF {
public static void main(String[] args) {
int option,degree,celsius,fahrenheit;
Scanner input = new Scanner( System.in );
option = 0;
while ( option != 3 ){
System.out.printf( "%s\n%s\n%s\n", "1 for Fahrenheit to Celsius","2 for Celsius to Fahrenheit", "3 to quit:" );
option = input.nextInt();
if (option==1){
System.out.println( "Enter the degrees in Fahrenheit: " );
degree = input.nextInt();
celsius = ( degree - 32 ) * 5 / 9;
System.out.println( "The temp in Celsius is "+celsius );}
else if (option==2){
System.out.println( "Enter the degrees in Celsius: " );
degree = input.nextInt();
fahrenheit = ( degree * 9 / 5 ) + 32;
System.out.println( "The temp in Fahrenheit is "+ fahrenheit );}
else {System.exit(0);}
}
}
}
بالتوفيق ،،