THIS IS THE CLASS TEMPLATE BELOW:
#include <iostream> #include <vector> using namespace std; //Complete the code for NumberClass class here int main() { NumberClass<int> myNum({99,34,12,44,77,2,37,4,54,68, 44, 102, 5, 42}); cout << "Print the elements in the vector" << endl; myNum.printNumber(); cout << endl; cout << "Is 77 in the vector? : " << boolalpha<<myNum.isExist(77) << endl; cout << "Is 100 in the vector? : " << boolalpha<<myNum.isExist(100) << endl; cout << "The max value of the vector is " << myNum.findMax() <<endl; cout << "The min value of the vector is " << myNum.findMin() <<endl; cout << "The average value of the vector is " << myNum.findAvg() <<endl; cout << "The number of even numbers in the vector is " << myNum.countEven() <<endl; myNum.replaceNumber(100,5); cout << "Print the vector after one number is replaced." << endl; myNum.printNumber(); cout << endl; NumberClass<double> myDouble({100.3,32.78,12.12, 55.44}); cout << "Print the elements in the vector" << endl; myDouble.printNumber(); return 0; }
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |