Computer Science, asked by pleasantcookies, 10 months ago

Write a program to accept the sales of each day of a week and print the total sales and average sales of the week. (Use Scanner class to get sales input)

Answers

Answered by anindyaadhikari13
18

Answer:

import java.util.*;

class Sales

{

static void main()

{

Scanner sc = new Scanner(System.in);

System.out.println("Enter the sales of the week.. ") ;

int s=0;

for(int i=1;i<=7;i++)

{

int a= sc.nextInt();

s+=a;

}

float av=s/7.00f;

System.out.println(" Total Sales: "+sum);

System.out.println("Average Sales: " + (int)av);

}

}

Explanation:

Hope it helps you...Please mark this answer as the brainliest.

10 thanks + follow = inbox ✌✌

Similar questions