You have the following variable defined: Based on attack, we want to figure out what type the
Question:
You have the following variable defined:
Based on attack, we want to figure out what type the attack is weak against and strong against. Create a series of if/else-if/else statements to print the following message on the command window:
Change the value of the variable attack to “Fire” and "Grass" to see what it will print out next. Here is the following relationship between the three attack types:
● Water: weak against grass, strong against fire
● Fire: weak against water, strong against grass
● Grass: weak against fire, strong against water
To compare two Strings, should we use == or equals()?
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Question Posted: