+ 1
Annual Revenue The given code declares an array that holds the monthly revenues for a company for a year. You need to calculate
Java
3 Antworten
+ 3
class program{
public static void main(String[] args){
double[] revenue={10000,12000,13500,9000,5600,6700,23000,7850,8900,10050,12050,13550};
double sum=0;
for(int i=0;i<revenue.length;i++){
sum=sum+revenue[i];
}
double result =sum/revenue.length;
System.out.println(result);
}
}
this code is not being accepted by the compiler
+ 1
D M D E V I Dissanayake-S22010030-622512534
If you're having trouble in code, share your code and describe what error message you're receiving.
+ 1
Please help to fix the code so it will run