C++ task. -- 2

Job ID: 32927598

Budget: $10 – $30 CAD

Define a struct or class that has the following member variables:
a std::string object for the purpose of storing a name (the string will never have whitespace characters in it) (referred to as name below),
an int object for the purpose of storing an integer identifier (referred to as id below), and,
a double object for the purpose of storing a floating-point value (referred to as amount below).
Define an operator>>() overload capable of reading in record objects from a std::istream.
See Record Input Requirements below for more details.
Define an operator<<() overload capable of writing out record objects to a std::ostream.
See Record Output Requirements below for more details.
Define a function / function template so that code is not duplicated. (This is referred to as sort_and_output below.)
You need to sort and output the data three times --you are NOT permitted to copy-and-paste code.
You must write a function / function template so that such code only appears once and you pass values to this function each of the three times it is called changing the appropriate values