Write a blue j program to accept sales of each day of the week and print total sales and average sales of the week.
Answers
Answered by
2
public class Ar2
{
public void salesprocess(float sales[ ])
{
int i;
float avg = 0 , total = 0;
for (i = 0 ; i<7 ; i++)
total+=sales[i] ;
avg = total/5;
System.out.println("Total sales = " +total);
System.out.println("average sales =" +avg);
}
}
_________________________________________________________
HOPE IT HELPS
{
public void salesprocess(float sales[ ])
{
int i;
float avg = 0 , total = 0;
for (i = 0 ; i<7 ; i++)
total+=sales[i] ;
avg = total/5;
System.out.println("Total sales = " +total);
System.out.println("average sales =" +avg);
}
}
_________________________________________________________
HOPE IT HELPS
Similar questions