Question: rrors can be syntax errors or logic errors ( the code works, but not as intended ) . Compare the user's guess to the lottery

rrors can be syntax errors or logic errors (the code works, but not as intended). Compare the user's guess to the lottery number and determine if they are equal. Which of the following statements contains an error?
else if( userBackPair.compareTo(lotteryBackPair)<0)
else if(!userFrontPair.equals(lotteryFrontPair))
else if( userPick == lotteryNum )
I onlyII onlyI and III onlyII and III onlyI, II, and III
Which of the following blocks of code determines that the numbers are equal numerically?
Example:
String phoneNum1="407-555-2207";
String phoneNum2="407-555-2207";
if(phoneNum1.compareTo(phoneNum2)>0){//phoneNum1 and phoneNum2 are equal }if(phoneNum1.compareTo(phoneNum2)==1){//phoneNum1 and phoneNum2 are equal }if(phoneNum1.compareTo(phoneNum2)==1){//phoneNum1 and phoneNum2 are equal }if(phoneNum1.compareTo(phoneNum2)<0){//phoneNum1 and phoneNum2 are equal }if(phoneNum1.compareTo(phoneNum2)==0){//phoneNum1 and phoneNum2 are equal }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!