Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Sample 3: Display number row with conditional prefix

Image Added

Figure 8: Example input 3 in the Script property.

Code Block
languagejava
int rowNumber = index + 1;

int determinant = rowNumber % 2;

if (determinant == 0){
    return "Even " + rowNumber;
}
else if (determinant != 0){
    return "Odd " + rowNumber;
}
else{
    return "Error";
}

Image Added

Figure 9: Result from example input 3 shown in Figure 8.

...