Receipts Numbered by a Static Counter
mediumQuestion 725Receipt is written for you with a friend declaration. Define ostream& operator<<(ostream& os, const Receipt& r) below the class so each call prints one line: Receipt N for CUSTOMER: AMOUNT followed by a newline, where AMOUNT has exactly two decimals and N counts the calls: 1 on the first call, 2 on the second, and so on, no matter which receipt is printed. Keep the counter in a static local variable inside the function; do not add a member to the class.
The hidden driver reads a count, then that many customer lines each followed by an amount line, prints every receipt once and then prints the FIRST receipt again. Write to os and return it.
For the input 2, Mina, 42.5, Omar, 7 the driver prints the output shown in Expected Output.
Do NOT write a main function.
Expected output
Receipt 1 for Mina: 42.50 Receipt 2 for Omar: 7.00 Receipt 3 for Mina: 42.50
= newline. The output ends with a newline, so print one after the last line.
Your output
Run your code to see the output here...