Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DataSet myDataSet = new DataSet();
- String input;
- int numInput = 0;
- input = JOptionPane.showInputDialog("Enter your first value (integer input Only): ");
- numInput = Integer.parseInt(input);
- myDataSet.addValue(numInput);
- input = JOptionPane.showInputDialog("Enter your second value (integer input Only): ");
- numInput = Integer.parseInt(input);
- myDataSet.addValue(numInput);
- input = JOptionPane.showInputDialog("Enter your third value (integer input Only): ");
- numInput = Integer.parseInt(input);
- myDataSet.addValue(numInput);
- input = JOptionPane.showInputDialog("Enter your fourth value (integer input Only): ");
- numInput = Integer.parseInt(input);
- myDataSet.addValue(numInput);
- System.out.println("The Sum of all the values is: " + myDataSet.getSum());
- System.out.println("The Average of all the values is: " + myDataSet.getAverage());
- System.out.println("The Maximum value of all the values is: " + myDataSet.getMax());
- System.out.println("The Minimum value of all the values is: " + myDataSet.getMin());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement