// Example from "Introduction to Probability and Statistics For Engineers and Scientists"
// by Sheldon M. Ross


#include <iostream.h>
#include "hyptest.h"

int main()
{
	cout << "A public health official claims that the mean home water use is 350" << endl
		<< "gallons a day.  To verify this claim, a study of 4 randomly selected" << endl
		<< "homes was instigated with the results of the average daily water use" << endl
		<< "stored in the file 'water.dat'.  Does the data contradict the official's" << endl
		<< "claim?" << endl << endl;
	cout << "> UnknVarData<double> wateruse('water.dat',4);" << endl
		<< "Constructing an instance of the class UnknVarData..." << endl << endl;
	UnknVarData<double>  wateruse("water.dat",4);
	cout << "> for (int i=0;i<wateruse.size();i++)" << endl
		<< ">      cout << wateruse[i]" << endl
		<< "Outputing data..." << endl;
	for (int i=0;i<wateruse.size();i++)
		cout << wateruse[i] << endl;
	cout << endl << "< wateruse.meantest(350);" << endl
		<< "Testing hypothesis - Calculating probability of Type I error..."<< endl
		<< wateruse.meantest(350) << endl << endl;
	cout << "Since there is a greater than 5% chance of Type I error, the hypothesis" << endl
		<< "should not be rejected.  The data is consistent with the official's claim." << endl;
	return 0;
}

