Question: Help me in Java Requirements The features described below must be in your program. A total of eight classes: the driver, WeatherEvent, Precipitation, Obscuration, Rain,
Help me in Java
Requirements
The features described below must be in your program.
A total of eight classes: the driver, WeatherEvent, Precipitation, Obscuration, Rain, Snow, Fog, and Particle.
WeatherEvent class, the superclass of all other classes except the driver:
o Must be abstract
o Must have fields:
A string called location
A static integer called nextId initialized at
An integer called id
A boolean called active
o It must only feature an overloaded constructor, which assigns location and active
as appropriate, sets id with the value of nextId, and then increments nextId by
o It must have a getter for all fields except nextId
o It must have a setter for location and active
o It must have an override of toString This override must be in the following format:
Weather Event Location: location
id: id
active: active
Precipitation class, which is a superclass of Rain and Snow
o Must be abstract
o Must have field: a double called rateOfFall
This field must have a getter and a setter. Do not allow this field to be set
at a value below
This field is keeping track of how fast the Precipitation is happening,
measured in inchesh
o It must only feature an overloaded constructor which takes in the location, if the
Precipitation is active, and its rate of fall. The rate of fall is set as appropriate, but
the location and activity status 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 Precipitations rateOfFall and, in parenthesis, if the
rate is light, medium or heavy:
Light: less than inchesh
Medium: Between and inchesh inclusive
Heavy: Above inchesh
Weather Event Location: location
id: id
active: active
Rate of Fall: rateOfFall inh LightMediumHeavy
Obscuration class, a superclass of Fog and Particle:
o Must be abstract
o Must have field: an integer called visibility
This field must have a getter and a setter. Do not allow this field to be set
at a value below
This field is keeping track of how far away a person can see through the
Obscuration, measured in eights of a mile.
o It must only feature an overloaded constructor which takes in the location, if the
Obscuration is active, and its visibility. The visibility is set as appropriate, but the
location and activity status 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 visibility. If the visibility is at or above
the visibility is Normal Otherwise, the visibility should be displayed in eights
of a mile.
Weather Event Location: location
id: id
active: active
Visibility: visibility mi
OR
Weather Event Location: location
id: id
active: active
Visibility: Normal
Rain class
o Must have field: a double called dropSize
This field must have a getter and a setter. Do not allow this field to be set
at a value below
This field is keeping track of the diameter of the rain drops, measured in
inches.
o It must only feature an overloaded constructor which takes in the location, if the
Rain is active, its rate of fall, and the diameter of its raindrops. The drop size is set
as appropriate, but the location, activity status, and rate of fall 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 Rains drop size, as well as their classification. Drop
sizes as classified as:
Small: Less than inches
Medium: Between and inches inclusive
Large: Greater than inches
Weather Event Location: location
id: id
active: active
Rate of Fall: rateOfFall inh LightMediumHeavy
Drop size: dropSizeSmallMediumLarge
Snow class
o Must have field: a double called temperature
This field must have a getter and a setter. Do not allow this field to be set
at a value below or above
This field is keeping track of the temperature of the snowfall, measured in
Fahrenheit.
o It must only feature an overloaded constructor which takes in the location, if the
Snow is active, its rate of fall, and the temperature. The temperature is set as
appropriate, but the location, activity status, and rate of fall 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 temperature.
Weather Event Location: location
id: id
active: active
Rate of Fall: rateOfFall inh LightMediumHeavy
Temperature: temperature F
Fog class
o Must have field: a boolean called freezingFog
This field must have a getter and a
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
