Advertisement
Guest User

chicken

a guest
Nov 18th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. DataSet myDataSet = new DataSet();
  2. String input;
  3. int numInput = 0;
  4.  
  5. input = JOptionPane.showInputDialog("Enter your first value (integer input Only): ");
  6.  
  7. numInput = Integer.parseInt(input);
  8. myDataSet.addValue(numInput);
  9.  
  10.  
  11. input = JOptionPane.showInputDialog("Enter your second value (integer input Only): ");
  12.  
  13. numInput = Integer.parseInt(input);
  14. myDataSet.addValue(numInput);
  15.  
  16. input = JOptionPane.showInputDialog("Enter your third value (integer input Only): ");
  17.  
  18. numInput = Integer.parseInt(input);
  19. myDataSet.addValue(numInput);
  20.  
  21. input = JOptionPane.showInputDialog("Enter your fourth value (integer input Only): ");
  22.  
  23. numInput = Integer.parseInt(input);
  24. myDataSet.addValue(numInput);
  25.  
  26. System.out.println("The Sum of all the values is: " + myDataSet.getSum());
  27. System.out.println("The Average of all the values is: " + myDataSet.getAverage());
  28. System.out.println("The Maximum value of all the values is: " + myDataSet.getMax());
  29. System.out.println("The Minimum value of all the values is: " + myDataSet.getMin());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement