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, 24.06.2019 13:00
Your mom wants to purchase a laptop computer. she said she wants her new computer to be able to play her dvds so she can listen to music and wants to know what type of optical drives will play her disk. which type of drive should she look for?
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
If you add the following to the query grid in an access query, what is it called? salestaxamt: [salestaxrate]*[totalsale] formula calculated field total calculation
Answers: 2
question
Computers and Technology, 24.06.2019 17:30
Looking at the electroscope, describe how you can cause the two leaves at the bottom to repel each other and stay that way
Answers: 3
question
Computers and Technology, 24.06.2019 17:40
Pseudocode pld #6, pg. 117 start// declarations// number numbertoguess// number myguess; numbertoguess = 92// while myguess ! = numbertoguess// output " guess an integer number between 1 and 100"// input myguess// if (myguess == numbertoguess)// output "you guessed the correct number"// else// output "the number you guessed was incorrect. try again! "// end if// end while// output " for playing the guessing game. have a great day! "// stop
Answers: 3
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
Social Studies, 29.10.2019 16:31
Questions on the website: 13722367