CJCoding With Joseph
15free / daySign inCreate account

Total Cost of an Order

An 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
Topics:
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.