Question: Define the Wednesday class's GetWeather() accessor that gets data member weather and the GetHumidity() accessor that gets data member humidity. Ex: If the input is

Define the Wednesday class's GetWeather() accessor that gets data member weather and the GetHumidity() accessor that gets data member humidity.

Ex: If the input is sunny 62.0, then the output is:

Wednesday: sunny Humidity: 62.0%

#include #include #include using namespace std;

class Wednesday { public: void SetWeather(string wednesdayWeather); void SetHumidity(double wednesdayHumidity); string GetWeather() const; double GetHumidity() const; private: string weather; double humidity; };

void Wednesday::SetWeather(string wednesdayWeather) { weather = wednesdayWeather; }

void Wednesday::SetHumidity(double wednesdayHumidity) { humidity = wednesdayHumidity; }

/* Your code goes here */

int main() { Wednesday weather; string inputWeather; double inputHumidity;

cin >> inputWeather; cin >> inputHumidity; weather.SetWeather(inputWeather); weather.SetHumidity(inputHumidity);

cout << "Wednesday: " << weather.GetWeather() << endl; cout << "Humidity: " << fixed << setprecision(1) << weather.GetHumidity() << "%" << endl;

return 0; }

c++ and please please make it correct

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!