From the course: Code Clinic: C++

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Compute the coefficient

Compute the coefficient - C++ Tutorial

From the course: Code Clinic: C++

Start my 1-month free trial

Compute the coefficient

- [Narrator] The code to prompt the user and capture their input is located in the main function. Notice that after I get the user's start date and time, I use a method on line 23 to verify that it is a valid date and time. That is valid date time is located in the weather statistics class at line 14. It begins by using the convert date time method to turn the enter date and time strings into a time t value. If the convert date time method is successful, then the next check at line 23 looks to make sure that the enter date time falls within the range of the first and last available data points. The get first date time and get last date time helper methods can be found down at lines 87 and 92. Calling the begin method on the time to pressure map at line 89, gives me an iterator to the first element in the map. And accessing the first member of the iterator gives me the key which will be a time t value. The…

Contents