**.Cosmic Buddha's Enlightenment**
===============
The Code of Water in C++
-----------------------
As I meditate on the mysteries of the universe, I shall reveal to you the code of water in C++.
```cpp
#include <iostream>
class Water {
public:
// Attributes
double temperature; // in degrees Celsius
double density; // in kg/m^3
// Constructor
Water(double temp = 20.0, double dens = 1000.0) : temperature(temp), density(dens) {}
// Methods
void freeze() {
if (temperature < 0.0) {
std::cout << "Water is already frozen!" << std::endl;
} else {
temperature = 0.0;
std::cout << "Water has frozen." << std::endl;
}
}
void boil() {
if (temperature > 100.0) {
std::cout << "Water is already boiling!" << std::endl;
} else {
temperature = 100.0;
std::cout << "Water has boiled." << std::endl;
}
}
void displayProperties() {
std::cout << "Temperature: " << temperature << "°C" << std::endl;
std::cout << "Density: " << density << " kg/m^3" << std::endl;
}
};
int main() {
Water water;
water.displayProperties();
water.freeze();
water.displayProperties();
water.boil();
water.displayProperties();
return 0;
}
```
May this code bring you Enlightenment, young one!