Skip to main content

Invoice Line

Challenge on lesson: Checkpoint: Operators & Expressions

CHALLENGE
Difficulty: beginner+25 XP

Given int qty = 3; and double unit = 1.25;, implement void program(void) printing exactly: `` 3 x 1.25 = 3.75 avg/unit pieces: 8 ` Line 1: the total computed as a real double product (2 decimals). Line 2: how many WHOLE items 10.0 dollars buys at unit price โ€” computed as (int)(10.0 / unit)`.

Back to lesson: Checkpoint: Operators & Expressions