We've seen a method that reverses a sound and a method that can process samples by index number.
Write a method called reverseLastHalf that reverses just the second half of the current sound. For example, if the sound said \MarkBark" the returned sound should say \MarkkraB."
```
public void reverseLastHalf ( )
{
Sound orig = new Sound ( this . getFi leName ( ) ) ;
int l ength = this . getLength ( ) ;
int half = length / 2 ;
// loop through the samples
for ( int t a r g e t Index = ha l f , sour c e Index = l ength - 1 ;
t a r g e t Index < l eng th && sour c e Index > 0 ;
t a r g e t Index++, sourceIndex --)
this . setSampleValueAt ( targe t Index ,
o r i g . getSampleValueAt ( sour c e Index ) ) ;
}
```
You might also like to view...
Describe the function of the Quick Access toolbar located within Windows File Explore.
What will be an ideal response?
?When a doctype is present, browsers will render the page in _____ mode, employing the most current specifications of Hypertext markup Language (HTML).
A. ?quirks B. ?standards C. ?supervisor D. ?protected
You can ____________________ your folders and files to change the order they are listed.
Fill in the blank(s) with the appropriate word(s).
Your department creates regular analytics reports from your company's log files All log data is collected in Amazon S3 and processed by daily Amazon Elastic MapReduce (EMR) jobs that generate daily PDF reports and aggregated tables in CSV format for an Amazon Redshift data warehouse. Your CFO requests that you optimize the cost structure for this system. Which of the following alternatives will lower costs without compromising average performance of the system or data integrity for the raw data?
A. Use reduced redundancy storage (RRS) for all data In S3. Use a combination of Spot Instances and Reserved Instances for Amazon EMR jobs. Use Reserved Instances for Amazon Redshift. B. Use reduced redundancy storage (RRS) for PDF and .csv data in S3. Add Spot Instances to EMR jobs. Use Spot Instances for Amazon Redshift. C. Use reduced redundancy storage (RRS) for PDF and .csv data In Amazon S3. Add Spot Instances to Amazon EMR jobs. Use Reserved Instances for Amazon Redshift. D. Use reduced redundancy storage (RRS) for all data in Amazon S3. Add Spot Instances to Amazon EMR jobs. Use Reserved Instances for Amazon Redshift.