jeudi 11 octobre 2018

How can I recreate the following table?

enter image description here

Hello everyone, I'm trying to re-create the table above for an assignment and I'm stuck due to errors concerning the && function. Note that we are not allowed to use arrays and are limited to "switch" and "If"

This is what I've got so far:

  if ((BEAK_MM == 1) && (CLAW_MM == 0) && (COLOR = "Grey")) {
System.out.println ("The type of bird is A.");}
 else if ((BEAK_MM == 2) && (CLAW_MM == 1) && (COLOR = "Grey")) 
System.out.println ("The type of bird is A.");}
  else if ((BEAK_MM == 3) && (CLAW_MM == 2) && (COLOR = "Grey")) 
System.out.println ("The type of bird is A.");}
  else if ((BEAK_MM == 4) && (CLAW_MM == 3) && (COLOR = "Grey")) 
System.out.println ("The type of bird is A.");}
 else if ((BEAK_MM <= 4.5) && (CLAW_MM == 4) && (COLOR = "Grey")) 
System.out.println ("The type of bird is A.");}

Aucun commentaire:

Enregistrer un commentaire