Menu
support@nursinghomework.org
+1 714-215-3097

(Solved) : Write Java Program Tracks State Water Implementing Using Umi Temperature String Passed Con Q35543877

Write a java program which tracks the state of water byimplementing it using this umI:

WaterState <<enumeration>> MatterState -waterTemperature : double -isCelcius: boolean +WaterState(temperature String) +getSta

The temperature String passed to the constructor will besomething like “100C” for 100 degrees Centigrade or “-20F” forminus 20 degrees Fahrenheight. You need to take that String and setyour instance variables in the constructor.

The getState method returns one of the MatterState enumeratedtypes. In UML, the values of the enumerated types are given by theattributes. You don’t need to use the text<<enumeration>> at all in your Javacode. It is just a way of indicating that the diagram represents anenumerated type.

  • You might want to use the substring method of the Stringobject.
  • You can print the MatterState enumerated type directly.
  • Enumerated types, also called enum, have a template undereclipse like when you create a class.
  • The enumerated type will have a separate source file.

WaterState <<enumeration>> MatterState -waterTemperature : double -isCelcius: boolean +WaterState(temperature String) +getState0MatterState GAS LIQUID SOLID VS Main +main args: Stringl): void Show transcribed image text WaterState MatterState -waterTemperature : double -isCelcius: boolean +WaterState(temperature String) +getState0MatterState GAS LIQUID SOLID VS Main +main args: Stringl): void

Leave a Reply

Your email address will not be published. Required fields are marked *