Question: Goal: Learn to define classes with internal state, and getter and setter methods. Assignment: As part of the USCRN network, stations keep track of air

Goal: Learn to define classes with internal state, and getter and setter methods.
Assignment: As part of the USCRN network, stations keep track of air temperature, precipitation, and soil moisture. Write
the definition of a class named EnvironmentalStation that has the following methods:
An method that accepts a string argument and initializes the following attributes:
An attribute city_name that should be assigned the string argument;
An attribute air_temperature that should be assigned 0.0 ;
An attribute precipitation that should be assigned 0.0 ;
An attribute soil_moisture that should be assigned 0.0.
A method set_air_temperature that accepts an argument and assigns it to air_temperature.
A method set_precipitation that accepts an argument and assigns it to precipitation.
A method set_soil_moisture that accepts an argument and assigns it to soil_moisture
A method get_city_name that returns the value of city_name;
A method get_air_temperature that returns the value of air_temperature;
A method get_precipitation that returns the value of precipitation;
And a method get_soil_moisture that returns the value of soil_moisture.
 Goal: Learn to define classes with internal state, and getter and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is a Python class EnvironmentalStation based on your requirements class EnvironmentalStation de... View full answer

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 Databases Questions!