Write the definition of a public class WeatherForecast that provides the following behavior (methods):A method called setSkies that has one

Question

Write the definition of a public class WeatherForecast that provides the following behavior (methods):A method called setSkies that has one parameter, a String.A method called setHigh that has one parameter, an int.A method called setLow that has one parameter, an int.A method called getSkies that has no parameters and that returns the value that was last used as an argument in setSkies.A method called getHigh that has no parameters and that returns the value that was last used as an argument in setHigh.A method called getLow that has no parameters and that returns the value that was last used as an argument in setLow.No constructor need be defined. Be sure to define instance variables as needed by your “getter”/”setter” methods—initialize all numeric variables to 0 and any String variables to the empty string.

in progress 0
Clara 2 days 2021-10-11T12:59:40+00:00 1 Answer 0

Answers ( )

    0
    2021-10-11T13:00:49+00:00

    Answer:

    public class WeatherForecast {

    //Instance variables initialized to default values

    private String skies = “”;

    private int high = 0;

    private int low = 0;

    //Getters and Setters

    public void setSkies(String value) {

    skies = value;

    }

    public void setHigh(int value) {

    high = value;

    }

    public void setLow(int value) {

    low = value;

    }

    public String getSkies() {

    return skies;

    }

    public int getHigh() {

    return high;

    }

    public int getLow() {

    return low;

    }

    }

Leave an answer

45:7+7-4:2-5:5*4+35:2 =? ( )