Hi the problem in the code is at the end finalResult[index]= mark; code, mark gives error. It says cannot convert int to string. How can i fix it ?
System.out.println("Please choose a criteria (2-7) ?");
topic = in.nextInt();
System.out.println("Please enter a mark :");
int mark = in.nextInt();
final int size = cols.length;
String[] finalResult = new String[size];
int index = 0;
while(index<finalResult.length ) {
if (index==topic) {
finalResult[index]= mark;
} else {
finalResult[index]=cols[index];
}
index++;
}
}
finalResult[index]= mark + "";