Question: Please help with question number 3 using the sentinel value loop. Please stick to the sample session when doing it, because if we do not

 Please help with question number 3 using the sentinel value loop.

Please stick to the sample session when doing it, because if we

Please help with question number 3 using the sentinel value loop. Please stick to the sample session when doing it, because if we do not we will lose points. I have tried to do this, but i have been having problems.. I provided a screenshot of an example of the sentinel value loop from the text. Thanks

(2) Microsoft Word non commercial use File Home InsertPege Layout ReferencesMailings Review View Cut Copy Format Painter Find Replace Paste, ! x x' . . : -.-. . H. Emphasis Heading 1 Heading 3 rNore al Strang Subtitle TTitle n No Spac Suttle Em Intense E Quote Change StylesSelect Edting Cipboared Font Paragraph Styles 3. Loop termination by sentinel-value method Paste All Write a pseudocode algorithm that calculates and prints the total cost for a series of purchases. Use a loop to repeatedly ask the user to enterthe price and quantity of itemspurchased. Within theloop, accumlate the total costof the purchases so far. Use a negative number for a sentinel value. More specifically, when the user enters a negative numberfor theprice, the loop shouldteminate. The algorithm should generate a display of prompts, inputs, and clck an item to paste ow.. that final output that looks like this: Enter price (negative number to quit): 5.00 Enter quantity: 3 Enter price (negative number to quit): 3 Total cost $15 Options. Page 2 ot 3 Words: 619 9:27 PM 2/13/2019 Figure 2.12 illustrates the algorithm solution for this problem. Note how the prompt messages say "(-1 to quit)." That is necessary because without it, the user wouldn't know how to quit. In general, always pro- vide enough prompting information so that the user knows what to do next and knows how to quit. totalScore-O count 0 print "Enter score (1 to quit):" nput score while score! totalScore

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!