How mmr-ta/greenest works
A small Java console application that asks which named plant to water, then displays its daily fluid amount and fluid type. Main owns the prompt and selection; plant subclasses provide the calculation and fluid type. The excerpts show no persistence or external integrations.
Main entry points: Main.java Prompt and selection · Plant.java Plant base type · Carnivorous.java Carnivorous plant · Cactus.java Cactus
Components 7
Console interaction
- Prompt and selection
src/Main.java
Plant model
- Plant base type
src/Plant.java - Carnivorous plant
src/Carnivorous.java - Cactus
src/Cactus.java - Watering contract
src/Watering.java - Fluid type
src/FluidType.java
Other components
- User
Connections 10
- User → Prompt and selection: chooses plant
src/Main.java - Prompt and selection → Carnivorous plant: creates instance
src/Main.java - Prompt and selection → Cactus: creates instance
src/Main.java - Prompt and selection → Plant base type: requests needs
src/Main.java - Prompt and selection → Plant base type: displays type
src/Main.java - Carnivorous plant → Plant base type: extends
src/Carnivorous.java - Cactus → Plant base type: extends
src/Cactus.java - Plant base type → Watering contract: implements
src/Plant.java - Carnivorous plant → Fluid type: returns type
src/Carnivorous.java - Cactus → Fluid type: returns type
src/Cactus.java