Skip to editor
File
New File Ctrl+N
New Folder

Save Ctrl+S
Upload File…
Download as ZIP

Delete File

Reset Files…
View
Toggle Sidebar Ctrl+B
Toggle Terminal Ctrl+`

Word Wrap Alt+Z

Exercise Info
Run
Run Code Ctrl+Enter
Save & Run F5

Clear Output
CS174: OOP - Drills - Array Min Index
Explorer
GitHub

Connect to GitHub to push and pull your project files to a repository.

On the page that opens, create a token with repo scope, copy it, then paste it below.

Paste the personal access token you created on GitHub with repo scope.

Click Refresh to load commit history
Exercise Info
← Prev

Goals

  1. To do proper array indexing
  2. To use loops in concert with arrays
  3. To keep track of multiple auxiliary variables in a loop
  4. To properly define methods

Instructions

Create a static method getMinIndex takes in an array of doubles and returns the index of the minimum element in the array. You must handle the following two special cases:
  1. If there are ties, it should return the lowest index among the ties
  2. If the array is empty, your program should return 0 without crashing


  3. The Ursinus-WebIDE by Chris Tralie (opens in new tab) and Bill Mongan (opens in new tab)

Your browser does not support WebGL. A graphical rendering canvas would appear here.


          
No suggestions. Code quality feedback will appear here.
Not logged in java
Ln 1, Col 1