String inputWord is read from input and integer sumCounts is initialized with 0. Write a while loop that iterates until inputWord is equal to "End". In each iteration of the loop: Read integer furnitureCount from input. Increase sumcounts by the value of furnitureCount. Output the value of inputWord, followed by a newline. Read string inputWord from input. Example: If the input is Wardrobe 37 Cupboard 1 Cabinet 8 End, then the output is: Wardrobe Cupboard Cabinet 46 items

String inputWord is read from input and integer sumCounts is initialized with 0. Write a while loop that iterates until inputWord is equal to “End”. In each iteration of the loop:

Read integer furnitureCount from input.
Increase sumcounts by the value of furnitureCount.
Output the value of inputWord, followed by a newline.
Read string inputWord from input.

Example: If the input is Wardrobe 37 Cupboard 1 Cabinet 8 End, then the output is:

Wardrobe
Cupboard
Cabinet
46 items

Leave a Comment

Comments

No comments yet. Why don’t you start the discussion?

    Comments