Question: String inputWord is read from input and integer sumCounts is initialized with 0 . Write a while loop that iterates until inputWord is equal to

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.
Click here for example
Ex: If the input is Wardrobe 37 Cupboard 1 Cabinet 8 End, then the output is:
Wardrobe
Cupboard
Cabinet
46 items -(Please have the code in C++)-
 String inputWord is read from input and integer sumCounts is initialized

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!