//Yousef Rabah      Asi. 12 Part 1       Nov. 27th, 2001   Drawer 1602

#include "CS35lib.h"

void bowling( int& times, int& game)
{
	int counter, count_av;
	double average, sum = 0;
	
	set_decimal(2);
	count_av = 0;
	for (counter=1; counter <times+1 ; counter++ )
	{
		cout<<"Score for game "<<counter<<"?";
		cin>>game;
	
		
		if (game > 150)
		{
			count_av++;
			sum = sum + game;
		}
	}
	average= sum / count_av;
	cout<<count_av<<" of your games were above 150."<<endl;
	cout<<"Your average on those "<<count_av<<" games is "<<average<<endl;
	return;
}


int main ()
{
	int counter, game, count_av;
	int times;
	double average;
	cout<<"How many games did you bowl? ";
	cin>>times;
	
	bowling (times, game);
	
	
	return 0;

}

/*
RUN:

How many games did you bowl? 6
Score for game 1?50
Score for game 2?250
Score for game 3?120
Score for game 4?180
Score for game 5?210
Score for game 6?200
4 of your games were above 150.
Your average on those 4 games is 210.00
[rabahyo@quark CS35]$

*/

