I'm getting this error: Exception in thread "main" java.lang.NoSuchMethodError: main I tried using public static void main(String[] args){ but that negates all of the methods that I try to write. I'm...

I'm getting this error: Exception in thread "main" java.lang.NoSuchMethodError: main I tried using public static void main(String[] args){ but that negates all of the methods that I try to write. I'm just trying to make it so that I can enter values. Thanks. Code below: import java.util.Scanner; public class DataSet2 { private double value; private double sum; private int count; public void add(double value){ System.out.println("Enter values, enter -1 to finish"); Scanner scan = new Scanner(System.in); value = scan.nextDouble(); while (value !=-1){ sum =+ value; if(count } } public void getAverage(){ while (sum >0){ count++; double average = sum/count; System.out.println("The average is: " + average); } } public void getLargest(){ double largest =0; if (value > largest) largest = value; System.out.println("The largest is: " + largest); } public void getSmallest(){ double smallest =0; if (value smallest= value; System.out.println("The smallest is: " + smallest); } } import java.util.Scanner; public class DataSet2 { private double value; private double sum; private int count; public void add(double value){ System.out.println("Enter values, enter -1 to finish"); Scanner scan = new Scanner(System.in); value = scan.nextDouble(); while (value !=-1){ sum =+ value; if(count } } public void getAverage(){ while (sum >0){ count++; double average = sum/count; System.out.println("The average is: " + average); } } public void getLargest(){ double largest =0; if (value > largest) largest = value; System.out.println("The largest is: " + largest); } public void getSmallest(){ double smallest =0; if (value smallest= value; System.out.println("The smallest is: " + smallest); } }
May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here