Any tips?

Hey, I got this task to create a menu with several options. You should be able to add a city and the temperature in that city. Then you should be able to print, by the same menu, the temperature in all added cities, the average temperature and which city is the warmest/coldest.

What I need is inspiration from you guys, what possible ways are there to do this? :)

Regards
Last edited on
create a struct Weather(?) with an overloaded ctor:
1
2
3
4
5
6
7
8
struct Weather
{
    std::string m_city;
    double m_temp;

    Weather(const std::string& city, const double& temp)
        : m_city(city), m_temp(temp);
};


then in the main() program do something like:
1
2
std::vector<weather> vecW;
//create a switch to (a) add Weather objects, (b) print Weather objects off vecW; (c) exit 
Thank you, sir :)
sir? sure? ;)
Topic archived. No new replies allowed.