Write the pseudo-code of Q1 using C++ language supposing  that you have the following variables and functions already defined: A1: the distance from target A2: the angle to target MOVEFORWARD: to move forward TURN(VAL): to turn right or left. If the parameter is positive it turns to the right, else to the left

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Q2

Write the pseudo-code of Q1 using C++ language supposing  that you have the following variables and functions already defined:

  1. A1: the distance from target
  2. A2: the angle to target
  3. MOVEFORWARD: to move forward
  4. TURN(VAL): to turn right or left. If the parameter is positive it turns to the right, else to the left.
Q1
Draw the flowchart representing the following pseudo-code.
Repeat
Read distance from target
Read angle to target
if distance from target larger than 40
if angle to target is larger than 0
else
End
if angle to target is less than 20
Tum Right(50)
Tum Right(100)
if angle to target is larger than -20
Tum Left(50)
Tum Left(100)
else
else
Move Forward
Transcribed Image Text:Q1 Draw the flowchart representing the following pseudo-code. Repeat Read distance from target Read angle to target if distance from target larger than 40 if angle to target is larger than 0 else End if angle to target is less than 20 Tum Right(50) Tum Right(100) if angle to target is larger than -20 Tum Left(50) Tum Left(100) else else Move Forward
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Reference Types in Function
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education