//Xinnuo Wang                   CS1A                            chapter7 #1 
/*******************************************************************************
 * Display Largest and Smallest Array Value
 * _____________________________________________________________________________
 * The program accepts 10 values into an array and displays the largest and 
 * smallest values stored in the array
 * 
 * _____________________________________________________________________________
 * Input:
 *    num      : The accepted numbers in the array.
 * Output:
 *    Largest  : The largest value in the array.
 *    Smallest : The smallest value in the array.
 * 
 * ****************************************************************************/
#include <iostream>
using namespace std;

int main() 
{
	double num[10];
	double Largest;
	double Smallest;
	Largest = num[0];
	Smallest = num[0];
	for (int i = 0; i < 10; i++)
	{
		cout << "Enter the value: " << (i + 1) ;
		cin >> num[i];
		cout << num[i]<< endl;
	    if (Largest < num[i])
	    {
	        Largest = num[i];
	    	
	    }
	    if (Smallest > num[i])
	    {
	        Smallest = num[i];
	    	
	    }
	}
	cout << "The largest number is: "<< Largest << endl;
	cout << "The smallest number is: "<< Smallest << endl;
	
	
	return 0;
}