I am currently stuck on a java question where i have no idea how to proceed.. really appreciate any help!
The question is:
Write a java method, the method receives an integer number indicating the number of accounts, the array that contains the login names and the corresponding passwords and index of the account to be removed. It deletes the name and password of the account if removeindex is within the acceptable range. The method returns the updated number of accounts.
removeIndex: the index of the account to be removed
*Assuming arraysize is already created at other methods.
public static int removeAccount(int count, String[] nameArr, String[] paswordArr, int removeIndex){
for(int i=0; i<count;i++){
String target = nameArr[removeIndex];
if(target != null){
// what should i do here?
}else{
System.out.println("id does not exist");
}
}
return count;
}