⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 weatherprediction.h

📁 C++高级编程这本书所附的源代码
💻 H
字号:
// WeatherPrediction.h

/**
 * Predicts the weather using proven new-age
 * techniques given the current temperature
 * and the distance from Jupiter to Mars. If
 * these values are not provided, a guess is
 * still given but it's only 99% accurate.
 */
class WeatherPrediction
{
 public:
  virtual void setCurrentTempFahrenheit(int inTemp);
  virtual void setPositionOfJupiter(int inDistanceFromMars);

  /**
   * Gets the prediction for tomorrow's temperature.
   */
  virtual int getTomorrowTempFahrenheit();

  /**
   * Gets the probability of rain tomorrow. 1 means
   * definite rain. 0 means no chance of rain.
   */
  virtual double getChanceOfRain();

  /**
   * Displays the result to the user in this format:
   * Result: x.xx chance. Temp. xx
   */
  virtual void showResult();

 protected:
  int mCurrentTempFahrenheit;
  int mDistanceFromMars;
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -