hi i ave an assignment on point of sale terminal where i have to write a program so that it displays the product ID, amount of product , cost of each product and then the total cost.
the following code shows how i've started it. Could some one tell me if i'm doing it right and what's rong with the code because it's not executing.
i'll really appreciate your help. Thank you.
#include <iostream>
#include<iomanip>
using namespace std;
struct itemPrice // this is a global declaration
{
char id;
double price;
};
int main()
{
const int ITEMS= 2000; // maximum number of items
int i;
itemPrice list[ITEMS] ={
{ P010001 24.99},
{QX-35 19.99},
{DVD-player5 58.95},
{P010002 8.85},
{P010003 35.00}
};
cout<< endl; //start on a new line
cout<< setiosflags (ios: :left); //left justify the output
for(i=o; i < ITEMS; i++)
cout << set(7) << list.id
<< setw(15) << list.price
<<endl;
system ("pause");
return 0;
}