// Arup Guha
// 4/15/2019
// Framework for 2013 AP Comp Sci A FR Question 4: SkyView

import java.util.*;

public class SkyView {

	private double[][] view;
	
	/*** Fill in Solution for Part A here. ***/
	public SkyView(int numRows, int numCols, double[] scanned) {
		
	}
	
	// For testing.
	public String toString() {
		String res = "";
		for (int i=0; i<view.length; i++) {
			res = res + "[";
			for (int j=0; j<view[i].length; j++) {
				res = res + view[i][j];
				if (j <view[i].length-1) res = res + ", ";
			}
			res = res + "]\n";
		}
		return res;
	}
	
	/*** Fill in Solution for Part B here. ***/
	public double getAverage(int startRow, int endRow, int startCol, int endCol) {
		
	}
	
	public static void main(String[] args) {
		
		double[] vals = {.3, .7, .8, .4, 1.4, 1.1, .2, .5, .1, 1.6, .6, .9};
		
		// Test their way.
		SkyView sv = new SkyView(4, 3, vals);
		System.out.println(sv);
		System.out.println("Avg r12c01 = "+sv.getAverage(1, 2, 0, 1));
		System.out.println();
		
		// A different grid with the same numbers.
		sv = new SkyView(2, 6, vals);
		System.out.println(sv);
		System.out.println("Avg r01c24 = "+sv.getAverage(0, 1, 2, 4));

		System.out.println();	

		// A third view.
		sv = new SkyView(6, 2, vals);
		System.out.println(sv);
		System.out.println("Avg r35c01 = "+sv.getAverage(3, 5, 0, 1));
		System.out.println();		
	}


}