Review the two algorithms below. Explain the difference between the two algorithms in terms of the number of times the loop body may be executed. Convert_Feet_to_Yards 1 Response = Yes 2 While (response = Yes) do Steps 3 to 7 3      Get value for feet 4      Set value of yards to (feet / 3) 5      Print the value of yards 6      Print the message ‘Do you want to convert another measure?’ 7      Get a new value for response from the user 8 Stop Convert_Feet_to_Yards 1 Do Steps 2 to 6 2      Get value for feet 3      Set value of yards to (feet / 3) 4      Print the value of yards 5      Print the message ‘Do you want to convert another measure?’ 6      Get a new value for response from the user 7 While (response = Yes) 8 Stop

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section: Chapter Questions
Problem 14PP
icon
Related questions
Question

Review the two algorithms below. Explain the difference between the two algorithms in terms of the number of times the loop body may be executed.

Convert_Feet_to_Yards
1 Response = Yes
2 While (response = Yes) do Steps 3 to 7
3      Get value for feet
4      Set value of yards to (feet / 3)
5      Print the value of yards
6      Print the message ‘Do you want to convert another measure?’
7      Get a new value for response from the user
8 Stop

Convert_Feet_to_Yards
1 Do Steps 2 to 6
2      Get value for feet
3      Set value of yards to (feet / 3)
4      Print the value of yards
5      Print the message ‘Do you want to convert another measure?’
6      Get a new value for response from the user
7 While (response = Yes)
8 Stop

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Graphical User Interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT