cin>>price
Becomes cin>>price[k];
and cin>>part;
Becomes cin>>part[j];
Because both part and price are ARRAYS. If you don't tell in which item of the array you want to store your cin'ned value, it will fail. totalCost=price[SIZE];
Complete fail.
1. It's a segfault, it will crash.
2. You should add every value by hand. system {"pause"};
Completely wrong.
1. it's system ("pause");
2. it's recognized as a virus. Use getch();
I gave you the corrections...
Think in a restrictive way of doing things...
Stay to those rules... [code]"And use code tags, LOL"[/code]
Well, try this:
1 2 3 4 5
totalCost = 0;
for(int i = 0; i < SIZE; i++)
{
totalCost += price[/* SECRET, Discover this by yourself, have fun! */];
}
Did you remove it?
OMG totalCost += price[0+1+2+3+4+5];
That is not the way to do it!
It will become totalCost += price[15]; which is wrong!
Use the FOR loop i posted above!
k did that it complied and now there is a logic error it just keeps asking me for the part number and not asking me for the price or even outputting the price. which i know how to fix the second part lol