temps.cpp - File temps.cpp Created by Synopsis Take degrees...

This preview shows page 1 - 2 out of 4 pages.

/* File: temps.cpp Created by: Synopsis: Take degrees and time and convert and display stats */ #include <iostream> #include <cstdlib> #include <fstream> #include <string> #include <vector> #include <cmath> using namespace std; class MilTime { private: int hour; int minutes; public: int getHour() const; int getMin() const; void setHour(const int h); void setMin(const int m); void write_out(ofstream & fout); }; class Celsius { private: double degree; MilTime time; public: // member functions double getTemp() const; MilTime getTime() const; double getFahrenheit() const; void setTemp(const double temp); void setTime(const int h, const int m); }; // FUNCTION PROTOTYPES GO HERE: string read_filename(const string prompt); int read_num_samples(const string prompt); Celsius read_sample(const int k); void write_to_file(const string filename, const vector<Celsius> & samples); double average_temp(const vector<Celsius> samples); double hottest_temp(const vector<Celsius> samples); MilTime first_sample(const vector<Celsius> samples); int main() { // Define local variables string fname; // Output file name

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture