Created
October 21, 2014 17:03
-
-
Save enricllagostera/e5031248d862511943c5 to your computer and use it in GitHub Desktop.
Faça um programa que leia do Inspector uma temperatura em Fahrenheit, converta-a para graus Celsius e escreva o novo valor na tela. A fórmula de conversão de Fahrenheit (F) para Celsius é C = ( ( F - 32 ) * 5 ) / 9. Exemplo: 100 Fahrenheit = 37,77 Celsius.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class ConversorFahrenheit : MonoBehaviour | |
{ | |
public float tempF; | |
void Start () { | |
float tempC = (tempF - 32) * 5 / 9; | |
print("A temperatura em Celsius é " + tempC); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment