Question
Write a java program which tracks the state of water by implementing it using this umI: The temperature String passed to the constructor will be
Write a java program which tracks the state of water by implementing it using this umI:
The temperature String passed to the constructor will be something like "100C" for 100 degrees Centigrade or "-20F" for minus 20 degrees Fahrenheight. You need to take that String and set your instance variables in the constructor.
The getState method returns one of the MatterState enumerated types. In UML, the values of the enumerated types are given by the attributes. You don't need to use the text > at all in your Java code. It is just a way of indicating that the diagram represents an enumerated type.
- You might want to use the substring method of the String object.
- You can print the MatterState enumerated type directly.
- Enumerated types, also called enum, have a template under eclipse like when you create a class.
- The enumerated type will have a separate source file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started