angelazhong12May 17, 2020public boolean only14(int[] numbers) { int index = 0; boolean only1or4 = true; while(index <= numbers.length - 1){ int a = numbers[index]; switch (a){ case 1: case 4: break; default: only1or4 = false; } index = index + 1; } if( only1or4 == true) return(true); else return(false); }
richardalexanderyuMay 22, 2020public boolean only14(int[] nums) { boolean isTrue = true; for (int i = 0; i < nums.length; i++) { if (nums.length[i] ? = 1; nums.length[i] ! = 4;) isTrue = false; } return isTrue; }
ce_xuMay 23, 2020public boolean only14(int[] nums) { for(int i=0; i<nums.length; i++){ if (nums[i]==1); else if (nums[i]==4); else return false; } return true;}
agnes.jw1286May 23, 2020public boolean only14(int[] nums) { for(int i = 0; i < nums.length; i++) { if(nums[i] == 1 && nums[i] == 4){ return true; } } else return false;}}
public boolean only14(int[] numbers) {
int index = 0;
boolean only1or4 = true;
while(index <= numbers.length - 1){
int a = numbers[index];
switch (a){
case 1:
case 4:
break;
default:
only1or4 = false;
}
index = index + 1;
}
if( only1or4 == true)
return(true);
else
return(false);
}
public boolean only14(int[] nums) {
boolean isTrue = true;
for (int i = 0; i < nums.length; i++) {
if (nums.length[i] ? = 1; nums.length[i] ! = 4;)
isTrue = false;
}
return isTrue;
}
it kinda works
stop copying me XD
public boolean only14(int[] nums) {
for(int i=0; i<nums.length; i++){
if (nums[i]==1);
else if (nums[i]==4);
else return false;
}
return true;
}
did u copy me lol
public boolean only14(int[] nums) {
for(int i = 0; i < nums.length; i++) {
if(nums[i] == 1 && nums[i] == 4){
return true;
}
}
else return false;
}
}