Regular Expressions - Furniture - Java Fundamentals
Здравейте, колеги!
Явно имам проблем с настройкте на Ij по принтенето. Може ли малко помощ с тази задача:
Furniture
Write a program to calculate the total cost of different types of furniture. You will be given some lines of input until you receive the line "Purchase". For the line to be valid it should be in the following format:
">>{furniture name}<<{price}!{quantity}"
The price can be a floating-point number or a whole number. Store the names of the furniture and the total price. At the end print each bought furniture on a separate line in the format:
"Bought furniture:
{1st name}
{2nd name}
…"
And on the last line print the following: "Total money spend: {spend money}" formatted to the second decimal point.
Examples
Input |
Output |
Comment |
>>Sofa<<312.23!3 >>TV<<300!5 >Invalid<<!5 Purchase |
Bought furniture: Sofa TV Total money spend: 2436.69 |
Only the Sofa and the TV are valid, for each of them we multiply the price by the quantity and print the result
|
ето го и моят код:
https://pastebin.com/Er5xaW35
Здравей!
Благодаря за отговора, но аз все още имам същия проблем. Не иска да ми принти нищо на конзолата. Грешката ми е в принтенето, но незнам дали това не е до настройки