Fehler: expected identifier before '(' token
Auf dem if-Anweisungen, Sie hält mir den Fehler:
erwartet identifier before '(' token
War ich-banking auf diesem zu arbeiten.
void setup()
{
Serial.begin(9600);
Serial.println("We will be calculating whether or not ");
Serial.println("you are underweight, normal, overweight, or obese. ");
}
void loop()
{
float weight;
float height;
float BMI = (703 * weight) /(height * height);
Serial.println("Please input your weight (pounds)");
while (Serial.available() <= 0);
weight = Serial.parseInt();
Serial.println("Please input your height (inches)");
while (Serial.available() <= 0);
height = Serial.parseInt();
if ( BMI < 18.5 )
{
Serial.println("Your body mass index is:");
Serial.println(BMI);
Serial.println("please wait while I calculate your weight status");
Serial.println("...");
delay(500);
Serial.println("You are underweight, please go eat.");
}
if ( BMI >= 18.5 ) && (BMI <= 24.9)
{
Serial.println("Your body mass index is:");
Serial.println(BMI);
Serial.println("please wait while I calculate your weight status");
Serial.println("...");
delay(500);
Serial.println("Congratulations! You are a normal");
Serial.println("... kind of.");
}
if (BMI >= 25.0) && (BMI <= 29.9)
{
Serial.println("Your body mass index is:");
Serial.println(BMI);
Serial.println("please wait while I calculate your weight status");
Serial.println("...");
delay(500);
Serial.println("You are Overweight");
Serial.println("I suggest a jog");
}
if ( BMI >= 30.0)
{
Serial.println("Your body mass index is:");
Serial.println(BMI);
Serial.println("please wait while I calculate your weight status");
Serial.println("...");
delay(500);
Serial.println("You are OBESE.");
Serial.println("You have no hope.);
}
}
Du musst angemeldet sein, um einen Kommentar abzugeben.
Werden sollte, dass eine einfache Befestigung.
Sollte dein Problem leicht behoben, wenn Sie diese Zeilen zu ändern:
auf die richtige form ist
Ihre if-Anweisung sollte nur noch ein paar () um Ihre Bedingungen 🙂