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 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 but less than
If the user tries to set to a value outside of that range, set the value to be
the nearest valid value either or
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 mi
ALERT! FREEZING FOG!
OR
Weather Event Location: location
id: id
active: active
visibility: visibility mi
Particle class
o Must have 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 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
viceversa 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
