Zero-Padded Id and a Dotted Name
easyQuestion 723The 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, so print one after the last line.
Your output
Run your code to see the output here...