Question: java Implement a class with the following requirements: The class name is Weather It has two instance variables temp and status The instance variable temp
java
Implement a class with the following requirements:
- The class name is "Weather"
- It has two instance variables "temp" and "status"
- The instance variable "temp" must be in the range of -50 to 70
- The instance variable "status" can have any value of ["sunny","cloudy","rainy","foggy"]
- Implement setters (mutators) for the temp and status instance variables. The setters must return true if the new value is valid, false otherwise.
- Implement a two-paramter constractor
- Implement a getter (accessor) for the temp instance varaible
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
