Total Cost of an Order
mediumQuestion 416An array of three struct Item values each has a price and a qty. The items are {5, 2}, {3, 4}, and {10, 1}. Compute the order total by summing price * qty over all items and print it (see Expected Output).
That is 5*2 + 3*4 + 10*1 = 10 + 12 + 10 = 32. There is no trailing newline.
Expected output
32= newline. No newline after the last line.
Hints2 available
Sign in to use hintsTopics
Structs
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.