Final answer:
A C++ program is given which uses an array named 'prices' to store specified values and displays them using pointer notation, formatting the output in a table with 2 rows and 3 columns, utilizing the 'iomanip' library for formatting.
Step-by-step explanation:
The student has asked for a C++ program that stores specific values in an array named prices and displays these values using pointer notation with an I/O manipulator to format the output as a table with 2 rows and 3 columns.
Here is the C++ program that fulfills the requirement:
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
double prices[] = {17.61, 15.22, 19.53, 13.74, 10.25, 12.55};
double* ptr = prices;
cout << fixed << setprecision(2);
for (int i = 0; i < 6; ++i) {
if (i % 3 == 0 && i != 0) {
cout << endl;
}
cout << setw(8) << *(ptr + i) << ' ';
}
cout << endl;
return 0;
}
When the program is run, it will display the prices in the requested format. The use of setw from the iomanip library assists in setting the width for each value, ensuring the table format is maintained.