Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 cityname that should be assigned the string argument; An attribute airtemperature that should be assigned ; An attribute precipitation that should be assigned ; An attribute soilmoisture that should be assigned A method setairtemperature that accepts an argument and assigns it to airtemperature. A method setprecipitation that accepts an argument and assigns it to precipitation. A method setsoilmoisture that accepts an argument and assigns it to soilmoisture A method getcityname that returns the value of cityname; A method getairtemperature that returns the value of airtemperature; A method getprecipitation that returns the value of precipitation; And a method getsoilmoisture that returns the value of soilmoisture.
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 cityname that should be assigned the string argument;
An attribute airtemperature that should be assigned ;
An attribute precipitation that should be assigned ;
An attribute soilmoisture that should be assigned
A method setairtemperature that accepts an argument and assigns it to airtemperature.
A method setprecipitation that accepts an argument and assigns it to precipitation.
A method setsoilmoisture that accepts an argument and assigns it to soilmoisture
A method getcityname that returns the value of cityname;
A method getairtemperature that returns the value of airtemperature;
A method getprecipitation that returns the value of precipitation;
And a method getsoilmoisture that returns the value of soilmoisture.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started