Table Row Helper
mediumQuestion 633Write a function void printRow(ostream& out, const string& name, int qty, double price) that writes one table row to out and ends it with a newline. The row has three columns with no separator characters between them:
1. name left-aligned in 8 columns
2. qty right-aligned in 4 columns
3. price right-aligned in 8 columns, always with exactly 2 decimal places
Output of printRow(cout, "apple", 5, 1.25):
apple 5 1.25
Do NOT write a main function.
Expected output
apple 5 1.25 banana 12 0.50 kiwi 100 12.50
= newline. The output ends with a newline, so print one after the last line.
Hints3 available
Sign in to use hintsTopics
Streamsostream
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.