Imagine you are creating the code for a grocery store self-checkout system. This grocery store is quite small, so they c
Posted: Mon Jul 11, 2022 9:55 am
Imagine you are creating the code for a grocery store self-checkout system. This grocery store is quite small, so they currently only have three fruits: Apples (of type ‘green’ and ‘red’), Watermelon (of size “small” and “large”), and Oranges. They also 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 would design your java code for this job (JUST the classes, they do not need methods for the self-checkout system yet), assuming that each individual item has its own price. This can either be in the format of Java code or pseudocode. You do not need to fill out every method’s functionality, just provide a comment of that that method should do (and return).
Using what you know about inheritance, demonstrate how you would design your java code for this job (JUST the classes, they do not need methods for the self-checkout system yet), assuming that each individual item has its own price. This can either be in the format of Java code or pseudocode. You do not need to fill out every method’s functionality, just provide a comment of that that method should do (and return).