can i get help with this? I dont know what I might be missing or how to do it Write an if-else statement for the following: If userTickets is less than 5, execute numTickets = 1. Else, execute numTickets = userTickets. Ex: if userTickets is 3, then numTickets = 1.

can i get help with this? I dont know what I might be missing or how to do it

Write an if-else statement for the following: 
If userTickets is less than 5, execute numTickets = 1. Else, execute numTickets = userTickets. 
Ex: if userTickets is 3, then numTickets = 1. 

public class TicketCounter {
public static void main (String [] args) {
int numTickets = 0;
int userTickets = 3;


if (numTickets System.out.println(“numTickets”);
}
else {
System.out.println(“numTickets = userTickets”);
}

numTickets= userTickets;

System.out.println(numTickets);

return;
}
}


✖  Checking numTickets when userTickets = 3

Expected value:

1
Your value:3

Tests aborted.

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"