// ~cs35/array_2.cpp

#include "CS35files.h"

int main ()
{
	double price_1, price_2, price_3;
	int number, changit;
	cout << "How many prices will you enter (1 - 3) ? ";
	cin >> number;
	cout << "Enter price 1: ";
	cin  >> price_1;
	if (number >= 2)
	{
		cout << "Enter price 2: ";
		cin  >> price_2;
	}
	if (number >= 3)
	{
		cout << "Enter price 3: ";
		cin  >> price_3;
	}
	cout << "You entered ";
	set_decimal(2);
	cout << setw(8)<<price_1;
	if (number >= 2)  cout << setw(8)<<price_2;
	if (number >= 3)  cout << setw(8)<<price_3;
	cout << endl<<endl;
	
	cout << "You may change one price. Enter an integer from 1 to ";
	cout << number<<" (0 for no change): ";
	cin >> changit;
	if (changit == 1)
	{
		cout << "Price 1 was $"<<price_1<<" what should it be: ";
		cin  >> price_1;
	}
	if (changit == 2)
	{
		cout << "Price 2 was $"<<price_2<<" what should it be: ";
		cin  >> price_2;
	}
	if (changit == 3)
	{
		cout << "Price 3 was $"<<price_3<<" what should it be: ";
		cin  >> price_3;
	}
	cout <<"Now your prices are ";
	cout << setw(8)<<price_1;
	if (number >= 2)  cout << setw(8)<<price_2;
	if (number >= 3)  cout << setw(8)<<price_3;
	cout << endl<<endl;

	return 0;
}	
	
		
