CJCoding With Joseph
15free / daySign inCreate account

Zero-Padded Id and a Dotted Name

The starter already reads an item id, a name (which may contain spaces), a quantity and a unit price. Print ONE line in this layout:

- the word Item, a space, then the id right-aligned in 5 columns padded with 0
- :  then the name right-aligned in 12 columns padded with .
- a space, then the quantity right-aligned in 2 columns padded with spaces
-  @  then the unit price with exactly two decimals, right-aligned in 7 columns
-  =  then quantity times unit price with exactly two decimals, then a newline

Remember that setfill stays in force until you change it, so switch back to a space before the quantity.

For the input 42, Hammer, 3 12.5 the program prints the output shown in Expected Output.

Expected Output:

Item 00042: ......Hammer  3 @   12.50 = 37.50

= newline. The output ends with a newline — print one after the last line.

Hints4 available
Topics:
Printing
📥 Auto-Input:
42\nHammer\n3 12.5\n
This input is automatically fed to your program's stdin
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.