how do i create an array where I want there to be 8 values in an array but the user inputs them?
this is what i have so far
import javax.swing.JOptionPane;
public class Southside Report {
public static void main(String[] args) {
int FINAL MIN_STAFF = 7;
int total_staff = 0;
double[] num_students = 8;
you should declare your
array
as:And
int FINAL MIN_STAFF = 7;
should beFINAL int MIN_STAFF = 7;
Then you may assign the value using
JOptionPane
by doing:Take a look to JOptionPane. Option Panes are very customizable. Besides that your code not compile i think that you want the user to input 8 text only in one dialog and you can do it with optionPane with little customization like below example.
And output: