//************************************************************************************************************************************************************************************************************************************************************************************************
//*Assignment: 	Lesson 3:  To allow a user to input temperatures for a given week into an array and to arrange the data in the array properly
//*Assignment tag: ASG03-02-01	Arrays I Programming Assignment																																																															 *
//*Author:	Jonathan Rose	
//*Version:  1.0																																																												 *	
//*Teacher:	Brian Barnes																																																																		 *
//*Purpose:	General toying around with arrays... allows a user to input temperature for 7 days of a week.  It then orders them in a somewhat neat fashion.
//*Date started:		3/07/05																																																																		 *
//*Assistance:	Barnes' good programming example.  Examples on blackboard lesson 3, particularly the example program for arrays.
//*Input:  User inputs the temperatures for 7 days
//*Output:  Program outputs to chart.  Displays day array followed by temperature array.
//************************************************************************************************************************************************************************************************************************************************************************************************

#include <iostream> //allows input and output to stream

//preprocessor directives including library files.
#include <iostream>  //enables stream type commands
#include <string>  //enables for string use

using namespace std;    //use the std namespace.  Useful for arrays.

void displaychart(int[], string[]);  //displays the chart with the arrays.
int gettemp(int daytemp[], string weekday[], int count);  //gathering function to get information... namely the temperatures for each day of the week.

int main()  //main function
{
	//declare an array of six elements, type integer
	
	//variables declared
	int daytemp[7];
	string weekday[7];

	//weekday array set to follow days of the week
	weekday[0] = "Sunday";
	weekday[1] = "Monday";
	weekday[2] = "Tuesday";
	weekday[3] = "Wednesday";
	weekday[4] = "Thursday";
	weekday[5] = "Friday";
	weekday[6] = "Saturday";

	//sets count to 0 for use with input process and calling of input process
	int count = 0;

	for (count = 0; count < 7; count++)  //for statement which sets count to value
	
	{
	gettemp(daytemp, weekday, count); //calls gettemp process to set the array for temperatures
	}

	displaychart(daytemp, weekday); //displays the chart for the temperatures

	return 0; //end program


}//end main



//*********User Input to array Function************
int gettemp(int daytemp[], string weekday[], int count)  //process to enable user input of temperatures for each given day.
	
{
	cout << "What was the temperature for " << weekday[count] << "?" << endl;  //uses count variable from the for loop in the main function.  User sees day of the week he is supposed to give data for.
	cin >> daytemp[count];  //inputs the array value for daytemp[variable count number]
	return daytemp[count];  //returns the value for that array number.
}




//*******************Display Function***********************
void displaychart(int daytemp[], string weekday[])  //simple process to display the chart
{
	//let's print out the grades
	for (int count=0; count <7; count++)
	{
		cout << weekday[count] << ":   		" << daytemp[count] << endl;  //shows data as Weekday:			Temperature
	}
}
