In method normalize we found the largest value in the sound. Write a method that will find the smallest value in the sound and print it out.

What will be an ideal response?


```
public int find Smallest ( )
{
SoundSample [ ] sampleArray = this.getSamples ( ) ;
SoundSample sample = null ;
int smallest = sampleArray [ 0 ] . getValue ( ) ;
int value = 0 ;
// loop through all the samples in the ar ray
for ( int i = 1 ; i < sampleArray . leng h ; i++)
{
sample = sampleArray [ i ] ;
value = sample . getValue ( ) ;
i f ( value < smallest)
{
smallest = value ;
}
}
System . out . println ( "The smallest value i s " + smallest ) ;
return smallest ;
}
```

Computer Science & Information Technology

You might also like to view...

A(n) ________ is a group of data packets that are sent together

Fill in the blank(s) with correct word

Computer Science & Information Technology

Is it possible to change the spelling and grammar checker default settings in Office 2010?

A) Yes, by clicking the File tab and clicking the Options button. B) Yes, but the setting changes are only active for the current document upon which you are working. C) Yes, by clicking the Review tab and the Spelling & Grammar button. D) No, the settings cannot be changed.

Computer Science & Information Technology

Which category of UTP cabling is used for 10 Gigabit Ethernet? (Select all that apply.)

A) Category 6a B) Category 6 C) Category 10 D) Category 5e

Computer Science & Information Technology

____________________ operations involve comparing one data item with another to determine whether the first item is greater than, equal to, or less than the other item.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology