At a grocery store, certain categories of products sold have beenestablished and this information is to be
Fantastic news! We've Found the answer you've been seeking!
Question:
The data for each item consists of the item name (a string of lessthan 20 characters with no blanks), the unit cost in cents (aninteger), and a character indicating the product category ('M' formeat, 'P' for produce, 'D' for diary, 'C' for canned goods, and 'N'for nonfoods). The following additional data will depend on theproduct category.
Product Category Additional Data
1.Meats character indicating meat type ('R' for red meat, 'P' for poultry,'F' for fish)
date of packaging
expiration date
2.Produce character 'F' for fruit or 'V' for vegetable
date received
3.Dairy expiration date
4. Canned Goods expiration date (month and yearonly)
aisle number (an integer)
aisle side (letter 'A' or 'B')
5. Nonfoods character indicating category ('C' for cleaning product, 'P' forpharmacy, 'O' for other)
aisle number (an integer)
aisle side (letter 'A' or 'B')
Note: 'Q' for quit (end program)
Sample way to interact with your program follows with justtwo categories tested - make your input method and the outputmatch.
Enter product category (M,P,D,C,N,Q) -> M
Enter item name -> Chicks
Enter cost of item (in cents) -> 599
Enter meat type (R,P,F) -> P
Enter date of packaging (#-#-#) -> 12-02-2008
Enter date of expiration (#-#-#) -> 01-10-2009
Enter product category (M,P,D,C,N,Q) -> P
Enter item name -> RabbitFood
Enter cost of item (in cents) -> 49
Enter produce type (F,V) -> V
Enter date received (#-#-#) -> 12-01-2008
Enter product category (M,P,D,C,N, Q) -> Q
Here is our stock:
We have Chicks in our Poultry Dept. that costs 5.99per pound. It was packed on 12-02-2008 and will expire on01-10-2009.
We have RabbitFood in our Vegetable Dept. that costs49 cents per pound. It was received on 12-01-2009.
Related Book For
Posted Date: