In this exercise I am using Visual Studio Community 2017 and the header file "std_lib_facilities.h" which can be found here:
http://www.stroustrup.com/Programming/PPP2code/std_lib_facilities.h
http://www.stroustrup.com/Programming/PPP2code/std_lib_facilities.h
Chapter 10 // Exercise 3
Write a program that reads the data from raw_temps.txt created in exercise 2 into a vector and then calculates the mean and median temperatures in your data set. Call this program temp_stats.cpp
GitHub: https://github.com/l-paz91/principles-practice/blob/master/Chapter%2010/Exercise%203
GitHub: https://github.com/l-paz91/principles-practice/blob/master/Chapter%2010/Exercise%203
I initially had the median messed up when I first uploaded it (as you can see in the file history...I should've done GitHub sooner). I always forget how to code the median.
These programs may seem a little confusing as I bundled them all into one to read/write/create raw_temps.txt based on what you want to do.
This though is officially the first new exercise I've done since September 2019 (and restarting the entire book). It was actually a little scary when I realised that there were no more exercises for me to compare against anymore, everything from here on out is new territory. I will say though that it's been eye opening. I remember spending 6+ hours on one exercise from Chapter 4 when I first started this book back in 2016. Now I can do entire chapters in 1 day.
No comments:
Post a Comment