Question: 21) Given that a class object needs to read something from an input stream and print something to an output stream, pick the best signatures

21) Given that a class object needs to read something from an input stream and print something to an output stream, pick the best signatures of the methods which would perform the read and print actions A) read(const char * filename) ;/print(const char * filename) const; B) read(const string & filename) ;/print (const string & filename) const; C) read(ifstream & file);/print (ofstream & file) const; D) read(istream & file);/print(ostream & file) const; E) read(void);/print(void) const; 22) Create a function object class which will be used (perhaps in a for loop) to calculate and return the maximum value of a set of [numeric] data. (Hint: you may want more than one operator) in this class.) class Maximum r example, here's how you might use your class to find the largest of a set of test scores. double scores [MAX] size_t num-scores Maximum max; { 42, 55.5, 82, 74.5, 62 }; 5 max.reset (scores[0]) for (size-t s = 1; s
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
