Imagine you are creating the code for a grocery storeself-checkout system. This grocery store is quite small, so theycurrently only have three fruits: Apples (of type ‘green’ and‘red’), Watermelon (of size “small” and “large”), and Oranges. Theyalso have Vegetables of type ‘tomato’ and ‘corn’. On top of this,they sell tee shirts and gift cards.
Using what you know about inheritance, demonstrate how you woulddesign your java code for this job (JUST the classes, they do notneed methods for the self-checkout system yet), assuming that eachindividual item has its own price. This can either be in the formatof Java code or pseudocode. You do not need to fill out everymethod’s functionality, just provide a comment of that that methodshould do (and return).
Imagine you are creating the code for a grocery store self-checkout system. This grocery store is quite small, so they c
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am