Hello all!
In the exercise that I'm working on it asks that I write an input statement that will allow the user to enter values for specific elements. here my code that lets users enter values for all elements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
int main()
{
// Constant Declarations
constint SIZE = 10;
// Variable Declarations
double prices[SIZE];
double total;
total = 0;
cout << fixed << setprecision(2);
// Allow the user to enter all prices:
for(int i = 0; i < SIZE; i++)
{
cout << "Enter the price of Product " << i + 1 << ": $";
cin >> prices[i];
}
My question is how can alter my code to let users change specific elements of the array. say I wanted to make it so can enter values for the first, seventh, and third elements?