//https://app.pluralsight.com/course-player?clipId=9591b217-52b1-41d4-97d8-498731301073 //https://bit.ly/freePS2020 //RECOMMENDED: VS2019 COMMUNITY [FREE IDE] @ https://bit.ly/3mYgad3 //Different ways to utilize collections, specifically VECTOR //includes.h #include using std::cout; using std::cin; #include using std::string; #include using std::vector; using std::begin; using std::count; #include using std::sort; using std::count; //collections.cpp #include "includes.h" int main() { vector nums; for (int i = 0; i < 10; i++) { nums.push_back(i); } for (auto item : nums) { cout << item << " "; } cout << "\n"; vector words; cout << "Enter Three Words: " for (int i = 0; i < 3; i++) { string s; cin >> s; words.push_back(s); } for (auto item: words) { cout << item << " "; } cout << "\n"; cout << "int vector nums has " << nums.size() << " elements." << '\n\; nums[5] = 3; nums[6] = -1; nums[1] = 99; for (auto item: nums) { cout << item << " "; } cout << '\n'; for (unsigned int i = 0; i < nums.size(); i++) { cout << nums[i] << " "; } cout << "\n"; for (auto i = begin(nums); i != end(nums); i++) { cout << *i << " "; } cout << '\n'; sort(begin(words), end(words)); for (auto item : words) { cout << item << " "; } cout << '\n'; int threes = count(begin(nums), end(nums), 3); cout << "Vector of ints has " << threes << " elements with value 3" << '\n'; int tees = count(begin(words[0]), end(words[0]), 't'); cout << "first word has " << tees << " letter t's" << "\n"; return 0; }