Good evening, everyone. A basic question:
In the code below
class Conversora
{
double Oneknot = 1.852; // km/h
public void Conversor(){
Console.WriteLine("Informe a velocidade em nós: " );
int speed = Console.Read();
Console.WriteLine("A velocidade em km/h é de: " + Oneknot * speed);
Console.ReadKey();
}
The speed variable does not read as it was typed. Example: if I type 240 nodes, the variable receives only 50. Then the conversion of nodes to km / h leaves with the wrong result.
Does anyone give a help pro noob here? rs