Answered step by step
Verified Expert Solution
Link Copied!

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 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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How To Build A Million Dollar Database

Authors: Michelle Bergquist

1st Edition

0615246842, 978-0615246840

More Books

Students also viewed these Databases questions

Question

Describe the characteristics of hate crime offenders.

Answered: 1 week ago