Question: help me with this in java Fog class o Must have 1 field: a boolean called freezingFog This field must have a getter and a

help me with this in java
Fog class
o Must have 1 field: a boolean called freezingFog
This field must have a getter and a setter.
This field is keeping track of if the fog is freezing or not.
o It must only feature an overloaded constructor which takes in the location, if the
Fog is active, its visibility, and if it is a freezing fog. The freeze status is set as
appropriate, but the location, activity status, and visibility must be passed to the
super class constructor.
o An override to setVisibility(). A Fogs visibility must be greater than 0 but less than 5.
If the user tries to set to a value outside of that range, set the value to be
the nearest valid value (either 1 or 4).
Fogs are characterized by their severe lack of visibility, hence the heavy
restriction on visibility.
o It must overload the toString() method of its super class to add information to it. If the Fog is freezing, add ALERT! FREEZING FOG!. Otherwise, add nothing.
Weather Event Location: {location}
id: {id}
active: {active}
visibility: {visibility}/8 mi
ALERT! FREEZING FOG!
OR
Weather Event Location: {location}
id: {id}
active: {active}
visibility: {visibility}/8 mi
Particle class
o Must have 1 field: a string called particleType
This field must have a getter and a setter. This field must have only one
of the following values:
Dust
Sand
Ash
Any value thats not one of the above should be set as Other.
This field is keeping track of what the Obscurant is made of
o It must only feature an overloaded constructor which takes in the location, if the
Particle event is active, its visibility, and its particle type. The particle type is set as
appropriate, but the location, activity status, and visibility must be passed to the
super class constructor.
o It must overload the toString() method of its super class to add information to it.
The information added is the Obscurations particle type.
Weather Event Location: {location}
id: {id}
active: {active}
visibility: {visibility}/8 mi
Particle type: {particleType}
OR
Weather Event Location: {location}
id: {id}
active: {active}
visibility: Normal
Particle type: {particleType}
In the Driver:
o Create and Arraylist of WeatherEvents
o In a loop, prompt the user for the following options:
Add weather event: Prompt the user for what type of WeatherEvent they
wish to create (Rain, Snow, Fog, Particle), then prompt them for the
necessary information to create said event, adding it to the arraylist. Print
an error message if the user picks a type of WeatherEvent that doesnt
exist.
Update location: Prompt the user for the ID of a WeatherEvent. If said ID
exists, prompt the user for the new location of said WeatherEvent and
update it. Otherwise, print an error message that no such WeatherEvent
exists.
Update active: Prompt the user for the ID of a WeatherEvent. If said ID
exists, invert the activity status of that weather event (from true to false and
vice-versa). Otherwise, print an error message that no such WeatherEvent
exists.
View all events: Calls the toString() of all WeatherEvents in the arraylist.
Quit: Terminate the program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!