Implemented Weather class fields, constructor and output

This commit is contained in:
2026-04-21 10:26:40 +03:00
parent 5621f19feb
commit 0aa3be643e
2 changed files with 34 additions and 0 deletions

15
Weather.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include "Weather.h"
Weather::Weather(const std::string& city, double lon, double lat, double temperature,
const std::string& weather, double windSpeed, int clouds)
: city(city), lon(lon), lat(lat), temperature(temperature),
weather(weather), windSpeed(windSpeed), clouds(clouds) {
}
void Weather::printWeather() const {
std::cout << "City: " << city << " (Lat: " << lat << ", Lon: " << lon << ")\n"
<< "Temperature: " << temperature << " deg. C\n"
<< "Weather: " << weather << "\n"
<< "Wind Speed: " << windSpeed << " m/s\n"
<< "Cloudness: " << clouds << " %\n";
}