Can someone point me in the right direction on this...I'm just now learning arrays and am trying to figure out how to get a sum or difference of my array numbers. So far I can display all the numbers but is there a different way to perform math when it comes to arrays, different from plugging in floating point variables?
public class Merchandise
{
public static void main(
String[] args)
{
double[] salary = {5.25, 6.55, 10.25, 16.85};
System.out.println("Salaries one by one are:");
for(int x = 0; x < salary.length; ++x)
System.out.println(salary[x]);
}
}