Give the proper pre- and post- conditions for each of the following
void swapValue (ArrayList a)
// Pre :
// Post:
{
int n = a.size( );
Integer zero = new Integer(0);
for (int index = 0; index < n; index++)
if (a.get(index).equals(zero))
a.set(index, new Integer(1));
}
int findScore (ArrayList scores)
// Pre :
// Post:
{
int n = scores.size( );
Integer fifty = new Integer(50);
for (int index = 0; index < n; index++)
if (scores.get(index) < fifty )
return index;
return n;
}
void multiples ( )
// pre :
// post:
{
System.out.print("Of what number?");
int num = TextIO.getlnInt();
for (int j = 1; j <= 100; j++)
if (j % num == 0)
System.out.print(j + " ");
}