8:29 PM a instructure-uploads.s3.amazonaws.com .11 Sprint . [after $2.9] Loop te
ID: 3743405 • Letter: 8
Question
8:29 PM a instructure-uploads.s3.amazonaws.com .11 Sprint . [after $2.9] Loop termination by user-query method -flowchart Throughout the world, engineers have built locks that help boats to navigate between rivers and canals that are at different levels, For boats to travel through the lock, water is added or removed from the lock to raise or lower the water level. Draw a flowchart that keeps track of the water level for a series of water adjustments. Use a loop to repeatedly ask the user to enter water adjustment amounts. Within the loop, accumulate the current water level. If the requested adjustment value would cause the lock's water level to become negative (which is impossible), set the water level to 0. If the requested adjustment value would cause the lock to become empty, print a warning message. Below the loop, print the water level. Assume that all water values are in feet. Study the sample session below, so you know the required format for your flowchart's prompts, inputs, and final output. after $2.9] Loop termination by user-query method-pseudocode Provide a solution to the previous problem in the form of [after 2.91 Loop termination by sentinel-value method Write a pseudocode algorithm that level as described above. The difference is that this time, you should use a sentinel-value loop with a sentinel value of 0 for the water adjustment amount. that keeps track of a lock's waterExplanation / Answer
Pseudocode:
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.