Bastun Programmering C#
Hej jag vill ha hjälp och tror nog att jag e den trögaste. Grejen är att jag vill att både if och else ska köras men det är bara "else if" och "to low" som kör. Vad gör jag för fel??
using System;
namespace BastuuppgiftFtoC
{
class bastunadrianaProgram
{
public static float FahrenheitToCelsisus(float fahrenheit)
{
float celsius = (fahrenheit - 32) * 5 / 9;
return celsius;
}
static void Main(string[] args)
{
float maxtemperaturefahr = 170.6f;
float correcttemperaturefahr = 167f;
float mintemperaturefahr = 163.4f;
float fahrenheit = 167;
Console.Write("Skriv in temp in Fahr: ");
string nr = Console.ReadLine();
float userinfahr = Convert.ToSingle(Console.ReadLine());
float celsius = FahrenheitToCelsisus(userinfahr);
Console.WriteLine(" The temperature in Fahr " + celsius + " grader i celsius");
string nr1 = Console.ReadLine();
do
{
if
(userinfahr > maxtemperaturefahr)
{
Console.WriteLine(" To High! Turn down");
}
else if (userinfahr < mintemperaturefahr)
{
Console.WriteLine(" To low! Turn up ");
Console.ReadLine();
}
}
while (userinfahr < mintemperaturefahr || userinfahr > mintemperaturefahr);
Console.Write(" yeppp");
Console.ReadLine();
}
}
}