saykotislam

201-15-13993_1(c)

Apr 8th, 2021
49
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package lab.pkg4;
  2. import java.util.Scanner;
  3.  
  4. class Holiday{
  5.     Scanner x = new Scanner(System.in);
  6.  
  7. double avgDate()
  8. {
  9.     int sum=0,n;
  10.     n=x.nextInt();
  11.     int ar[] = new int[n];  
  12.     for(int i=0; i<n; i++){  
  13.             ar[i]=x.nextInt();
  14.             sum+=ar[i];
  15.     }  
  16.     double av=(sum/n);
  17.    
  18.     return av;
  19. }  
  20. }
  21.  
  22. public class Lab4 {
  23.     public static void main(String[] args) {
  24.            
  25.         Holiday hy=new Holiday();
  26.         System.out.println(hy.avgDate());  
  27.     }
  28.    
  29. }
RAW Paste Data