I'll give you a start.
You started by providing the ID's.
1-Coca-Cola
2-Pepsi
3-Canada Dry
4-Hires
Then you are told that each transactions had two parts to it. 1- Have the ID number of your soda be identified in a variable. 2- Have a amount purchased or sold of such said soda.
After that you assume you have infinite amounts of each brand( =D cool).
SOOOO Lets draw this out on a program.
You'll first need to declare your variables which will represent the sodas.
int coca, pepsi, canada, hires;
Then get the inventory.
1 2 3 4 5 6 7 8
|
cout << "Enter inventory for Coca-Cola: ";
cin >> coca;
cout << "Enter inventory for Pepsi: ";
cin >> pepsi;
cout << "Enter inventory for Canada: ";
cin >> canada;
cout << "Enter inventory for Hires: ";
cin<< hires;
|
Then make something that will be able to identify what soda is being used for the transaction. Maybe a switch statement could be nice?
1 2 3 4 5
|
switch(sodaID)
case: 1//coca
case: 2//pepsi
case: 3//canada
case: 4//hires
|
Then figure out a way to use those cases to modifying the values already given when the person inputted inventory amounts.
Then if you want you can loop the thing with a while loop or w.e. If you need more help then say so.
PS. I'm not quite sure how into c++ you already are so if you need an example with something that's not switch statements then just say so.