Reference no: EM132238621
Imagine that a local radio station is holding a contest to give away a free golfing vacation in the Bahamas to one lucky winner.
To win the contest, you must meet the following criteria:
- You must be caller 7
- You must play one of the following sports: tennis, golf
- You must be between the ages of 21 and 75.
Which of the following test conditions will correctly determine the winner of the contest?
if (numCaller == 7
&& (sport == "Golf") || sport == "Tennis")
&& (age >= 21 && age <= 75)) {
System.out.println("You are the winner!");
}
if (numCaller == 7
|| (sport.equals("Golf") || sport.equals("Tennis"))
|| (age >= 21 && age <= 75)) {
System.out.println("You are the winner!");
}
if (numCaller = 7
&& (sport.equals("Golf") || sport.equals("Tennis"))
&& (age >= 21 && age <= 75)) {
System.out.println("You are the winner!");
}
if (numCaller == 7
&& (sport.equals("Golf") || sport.equals("Tennis"))
&& (age >= 21 && age <= 75)) {
System.out.println("You are the winner!");
}
if (numCaller = 7
&& (sport = "Golf") || sport = "Tennis")
&& (age >= 21 && age <= 75)) {
System.out.println("You are the winner!");
}
if (numCaller == 7
&& (sport.equals("Golf") && sport.equals("Tennis"))
&& (age >= 21 && age <= 75)) {
System.out.println("You are the winner!");
}