troubleshooting Question

Arrays and methods

Avatar of lovemycomputers
lovemycomputers asked on
Java
14 Comments4 Solutions711 ViewsLast Modified:
I have to you’ll create an array of 20 values in dollars and cents format ($1.59). Then create four separate methods within the program to complete the listed tasks. The first method should create a total of all of the values listed in the array. The second should search the array, and return a listing of all values that are less than $5.00. The third should return the average of the values in the array. (Use the output from the first method.) Finally, display a list of all values in the array that are greater than the average value.

I keep getting these errors :  ----jGRASP exec: javac -g Prices.java

Prices.java:3: missing method body, or declare abstract
      public static void main(String[] args);
                         ^
Prices.java:32: operator + cannot be applied to double,double[]
   total +=prices;
         ^
Prices.java:41: operator < cannot be applied to double[],double
      if (prices < 5.00);
                 ^
Prices.java:46: incompatible types
found   : int
required: boolean
      if (i / 20)
            ^
Prices.java:50: operator > cannot be applied to double[],double
      if (prices > average)
                 ^
5 errors

 ----jGRASP wedge2: exit code for process is 1.
 ----jGRASP: operation complete.
 Prices.java
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 4 Answers and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros