Lambda with a Capture
mediumQuestion 192Lambdas can capture variables from the surrounding scope. Complete addTax(int price, int taxPercent) so it defines a lambda that CAPTURES taxPercent and adds that percentage of tax to a given price, then return the lambda applied to price. For example addTax(100, 8) returns 108.
Do NOT write a main function.
Expected output
108 60
= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
Lambda Functions
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.