1. A program’s function is to find the largest of three numbers. Devise white box test data for this section of program. The code is: int a, b, c; int largest; if (a >= b) { if (a >= c) { largest = a;...


1. A program’s function is to find the largest of three numbers. Devise white box test data for this section of program.


The code is:


int a, b, c;


int largest;


if (a >= b) {


if (a >= c) {


largest = a;


}


else {


largest = c;


}


}


else {


if (b >= c) {


largest = b;


}


else {


largest = c;


}


}


2. In a program to play the game of chess, the player specifies the destination for a move as a pair of integer indices, the row and column number. The program checks that the destination square is valid; that is, not outside the board. Devise white box test data to check that this part of the program is working correctly


The code for this part of the program is:


if ((row > 8) || (row <>


JOptionPane.showMessageDialog(null, "error");


}


if ((col > 8) || (col <>


JOptionPane.showMessageDialog(null, "error");


}




May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here