[Solved]-Trying Create Overloaded Functions Using Class Sensorreading Sure Could Show Syntax Hpp C Q37197339


I am trying to create these overloaded functions using the classsensorReading, but am not sure how. If you could show the syntaxfor the .hpp and .cpp file that would be great. The four values foreach object are: time, pressure, windDirection, and windSpeed. I amusing c++.
The input file has the following format, the first line is apositive integer m. The file then has m lines after this first one,with each of these subsequent lines containing 8 values. The firstfour are the time, pressure, wind direction, and wind speed for oneobject. The remaining four are the time, pressure, wind direction,and wind speed for another object.
operatort: A member function that takes two sensor reading objects, and returns a new sensor reading object. Each data member value in the return object should be the sum of the corresponding member variables of the objects being added.2 operator A member function that compares two sensor reading objects and returns true if their time values are the same, their pressure values are the same, their wind direction values differ by no more than 0.1, and their wind speed values differ by no more than 0.01 operator>>: A friend function that reads in 4 values, and sets the time, pressure, wind direction, and wind speed to those respective values. The values should be able to be read in either from the terminal or from a file. Moreover, the function should be written so input can be chained, ie., cin >> obj 1 >> obj2; will work first for obj 1 and then for obj2 operator<<: A friend function that outputs the data for a sensor reading, with the time, pressure, wind direction, and wind speed printed in that order on a single line, separated by commas, ending with an endl, but with no other formatting. The output should be able to be sent either the terminal or to a file. Moreover, the function should be written so output can be chained, i.e., cout << obj1 << obj2; will output first obj 1 and then obj2. 4 2 5010 738.1 200.08 4.015 5000 738.1 200.05 4.021 3 5020 738.3 200.14 4.013 5010 738.3 200.01 4.022 4 5Θ3Θ 738 . 5 2ΘΘ.08 4.012 5Θ2Θ 738.6 199.99 4.012 5 5040 738.3 200.08 4.007 5030 738.3 199.94 4.001 Show transcribed image text operatort: A member function that takes two sensor reading objects, and returns a new sensor reading object. Each data member value in the return object should be the sum of the corresponding member variables of the objects being added.2 operator A member function that compares two sensor reading objects and returns true if their time values are the same, their pressure values are the same, their wind direction values differ by no more than 0.1, and their wind speed values differ by no more than 0.01 operator>>: A friend function that reads in 4 values, and sets the time, pressure, wind direction, and wind speed to those respective values. The values should be able to be read in either from the terminal or from a file. Moreover, the function should be written so input can be chained, ie., cin >> obj 1 >> obj2; will work first for obj 1 and then for obj2 operator
Expert Answer
Answer to I am trying to create these overloaded functions using the class sensorReading, but am not sure how. If you could show t… . . .
OR

