Write a method called randomInRange that accepts two integer parameters representing a range. The method should return a random integer in the specified range (inclusive). Assume that the first parameter is greater than the second.
What will be an ideal response?
```
public int randomInRange (int first, int second)
{
Random generator = new Random();
int range = second – first + 1;
return generator.nextInt(range) + first;
}
```
You might also like to view...
Which of the following is not true about creating speaker notes?
A) Speaker notes enable you to write the words you will say during the presentation and store them separate file that you can print prior to the presentation. B) Speaker notes are displayed in the Notes pane of the PowerPoint window. C) You can print the notes for reference during the presentation. D) If you are using a dual display screen system, or are projecting your presentation, you can show the audience the slides, while you view the notes in Presenter view.
Which characteristics are required of USB drives for use with Windows To Go?
a. The drive must be a USB 3.0 drive and have read/write performance specifications that support the demands of the Windows 8.1 operating system. b. The drive is tuned to ensure it boots and runs on any computer that has been certified for use with Windows 7 or Windows 8.1 . c. The drive has been manufactured to quality standards that ensure endurance under the typical demand for Windows To Go. This includes a manufacturer warranty for operation and reliability under normal use with a Windows To Go Workspace. d. All of the above.