suppose you own a soft drink distributor that sells Coca-Cola(ID number 1),Pepsi
ID: 3652690 • Letter: S
Question
suppose you own a soft drink distributor that sells Coca-Cola(ID number 1),Pepsi(ID number 2),Canada Dry(ID number 3), and Hires(ID number 4) by the case. white a program to do the following:
a. read in the case inventory for each brand at the start of the week
b. process all weekly sales and pruchase records for each brand
c. display the final inventory
Each trancsaction will consist of two data items. the first will be the brand identification number (an integer). the second will be the amount purchased ( a positive integer) or amount sold (a positive integer). you can assume that you always have sufficient foresight to prevent depletion of your inventory for any brand.
Explanation / Answer
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 > coca; cout > pepsi; cout > canada; coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.