Create a new method that will half the volume of the positive values and double the volume of the negative values.
What will be an ideal response?
```
public void halvePosDoubleNeg ( )
{
SoundSample [ ] sampleArray = this . getSamples ( ) ;
int value = 0 ;
// loop through a l l the samples in the ar ray
for ( SoundSample sample : sampleArray )
{
value = sample . getValue ( ) ;
i f ( value >= 0)
sample . setValue ( value / 2 ) ;
else
sample . setValue ( value * 2 ) ;
}
}
```
You might also like to view...
When records have no unique value, the AutoNumber data type is a useful way to automatically create a unique number for each record
Indicate whether the statement is true or false
When giving a presentation, you can display hidden slides by pressing ________
A) P B) H C) Ctrl + P D) Ctrl + H
This vector function returns true if the vector has no elements.
a. has_no_elements b. null_size c. empty d. is_empty
Describe the proposed approach to designing a star schema in the Dimensional Modelling stage of Kimball’s Business Dimensional Lifecycle. Include the creation of a simple (maximum of four dimension tables and one fact table with maximum of six attributes per table) star schema to illustrate each step.
What will be an ideal response?