subject

8.25 Programming Assignment 3 Question 1 A certain robot can perform only 4 types of movement. It can move either up or down or left or right. The movements are represented by β€˜U’, β€˜D’, β€˜L’, β€˜R’. Each movement is also associated with the number of steps the robot has taken. For example: "L 20" mean that the robot has taken 20 steps in the left direction. Write a function named theRoundTrip that takes all the movements the robot made in a day as input and output True of bool type if the robot returned to its starting position after its journey. Otherwise, return False. If the input is bad, print the message "bad input". Input string will be a comma-separated string of movements: "L 20, R 30, U 40" Explanation: This means that the robot has taken 20 steps to the left, 30 steps to the right and 40 steps in the upward direction in that specific order. The output should be: True OR False OR bad input Examples: Input: L 5, R 10, R 10, L 15 Output: True Input: L5, U 5 Output: False Input: L 5, R 10, P 10, X 2, K 5 Output: bad input

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:00
Create a word problem that involves calculating the volume and surface area of a three-dimensional object. cube: surface area 6 s2 , volume s3
Answers: 3
question
Computers and Technology, 23.06.2019 16:10
What is the ooh? a. omaha occupation handbook b. online occupational c. occupations online d. occupational outlook handbook select the best answer from the choices provided
Answers: 3
question
Computers and Technology, 24.06.2019 02:40
Has anyone seen my grandma shes been gone for 4 years already
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe what
Answers: 1
You know the right answer?
8.25 Programming Assignment 3 Question 1 A certain robot can perform only 4 types of movement. It ca...
Questions
question
Mathematics, 13.07.2020 23:01
question
Mathematics, 13.07.2020 23:01
question
Mathematics, 13.07.2020 23:01
question
Mathematics, 13.07.2020 23:01
question
Mathematics, 13.07.2020 23:01
question
Mathematics, 13.07.2020 23:01
Questions on the website: 13722363