Question: 26) Code a function object class which can scale data to a desired maximum given the actual maximum and desired maximum. (Reminder: to scale value
26) Code a function object class which can scale data to a desired maximum given the actual maximum and desired maximum. (Reminder: to scale value a : a desired { actual .) Show its use in xing the following test scores. (What kind of loop would be most appropriate?) (Hint: What is the desired maximum of a typical test?) double scores[MAX] = { 42, 55.5, 82, 74.5, 62 };
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 operatorpq in this class.) class Maximum { }; For example, heres how you might use your class to nd the largest of a set of test scores. double scores[MAX] = { 42, 55.5, 82, 74.5, 62 }; size_t num_scores = 5 Maximum max; max.reset(scores[0]); for (size_t s = 1; s
27 through 31 please! 
Could you use the maximum finding function object you designed in #22 to help with processing the scores from #26? If so, how? If not, why not? How would you allow the user to place comments in a data file? Explain briefly. Recalling that 'x + y' can be rewritten as 'x.operator+(y)' (when x is an object of a class for which operator+ has been overloaded as a member function taking an argument of y's type), rewrite each of the following expressions as operator function calls. Use non-member operator versions only when necessary. Assume all variables are objects with appropriate overloading available. Assume all class operations return a class object - where reasonable. (And, yes, all of these operators exist and are overload-able.) x = y + 2 n > *q r += 1 0(42, t-u, r[h]) &lessthanorequalto a || b Write a two-line function to determine and return the length of a caller-specified input stream (measured in bytes). (Thought provoker: The line count would be five if you cleaned up after yourself.) (Thought-provoker: What should the return-type of your function be?) What is involved in a labeled data format? What problems could be involved if you try to use the stream translation/extraction with this format? How does this format give the end-user more freedom when creating/editing their data files
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
