I am trying to limit the user from overfeeding a virtual cat by making it only if health level is less than 60 they can feed it.Also if user attempts to feed cat when health is over 60 then happiness decreases by 2 for option 1. I tried health < 60;
but it gives me an error.This is different because it is limiting not comparing strings. different question not even sure why it's marked.
int food = 20;
int health = 30;
int happiness = 80;
String option;
System.out.println("pick an option ");
System.out.println(" Option 1 feed cat ");
System.out.println(" Option 2 play with cat");
System.out.println(" Option 3 give cat bath");
option = input.nextLine();
if(option == 1) {
food += 10;
happiness -= 15
health < 60;
happiness -=2;
} else if (option == 2) {
happiness += 12;
health += 25;
}