Професионална програма
Loading...
+ Нов въпрос
AlexanderF avatar AlexanderF 2 Точки

Regular Expressions - Furniture 0/100

https://pastebin.com/yKgcikZa

Мисля, че ползвам правилен regexp, но пак не ми мачва някои стрингове от input.

Условие:

1.Furniture

Write a function 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 floating point number or whole number. Store the names of the furniture and the total price. At the end print the each bought furniture on 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

 

0
JavaScript Fundamentals
mobdropc avatar mobdropc 1 Точки

Mobdro pc est une application de streaming en ligne gratuite, qui permet aux utilisateurs de regarder des vidéos, des films, des émissions de télévision, des sports et bien plus encore.

Êtes-vous à la recherche de l’une des applications de streaming de films et d’émissions de télévision en ligne les plus populaires? Ensuite, vous êtes au bon endroit.

0
onlinezoom avatar onlinezoom 5 Точки

The book of exodus is the second book in the old testament of the bible. It is the book of national redemption. It is also the second book of the Pentateuch.

0
ZOROBOY avatar ZOROBOY 6 Точки

Решението ти е Ок, с две малки корекции:

1 - махни глобалния флаг от RegEx pattern-a - така ще извлича по един резултат от дадена линия и няма да гърми.

2  - сложи на последния console.log(`Total money spend: ${totalMoney}`); едно форматиране до 2-я знак - ...totalMoney.toFixed(2)...

 

и взимаш 100/100 ;)

0
onlinezoom avatar onlinezoom 5 Точки

 The Australian squad is expected to arrive in England before travelling to Derbyshire. From there the team will be transferred to Ages Bowl in Southamptom after England’s last test match against Pakistan.

Australia vs england matches 2020

0
lucyengelman avatar lucyengelman 0 Точки

Subway is one of those eatery networks offering a wide scope of submarine sandwiches, doughnuts, Subway Wraps, newly heated biscuits and much more global.subway.com. Anyway, do you love to need sandwiches and plates of mixed greens at Subway? On the off chance that indeed, at that point Subway is giving you a superb chance to impart your insights and criticism.

0
StJimmyyy avatar StJimmyyy 3 Точки

Ето едно решение от мен. Не е най-доброто но се надявам да помогне. https://pastebin.com/KbrDDsZq

0
08/09/2020 18:20:31
onlinezoom avatar onlinezoom 5 Точки

The new GRIDCON ACF Active Harmonic Filter is based on a 3 level IGBT circuit with many benefits, including lower losses, higher efficiencies, higher power density, higher dielectric strength, and the ability to handle higher frequencies.

0
onlinezoom avatar onlinezoom 5 Точки

FirstRowSports has been one of the most popular sports streaming services that have become a craze among sports lovers. 

0
DBC_Corporation avatar DBC_Corporation 1 Точки

Diamonds Really Are A girl's most useful talent and also are the ideal present for a wedding or participation, among the absolute most valuable and precious stone of now. check updates for  Diamond Scanning.

0
onlinezoom avatar onlinezoom 5 Точки

fmusivJohn Cohen is best-known as an original member of the New Lost City Ramblers, founders of the modern old-time music movement, with whom he has sung and played string instruments since 1958. 

John Cohen – The Image Of American Music

0