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 07:00
For all machines-not just hammers- the user applies force force to the machine to the machine over a certain distance. a. input b. output c. duo d. none of the above
Answers: 1
question
Computers and Technology, 22.06.2019 08:10
Ihave a music player on my phone. i can buy songs, add them to playlists and play them. obviously it would be redundant to store each song in each playlist; each playlist is just a list of pointers to the songs. for this lab you will simulate this behavior. your program will need to have options to: add songs to the system library (you will store the text of the first line of the song, rather than the audio) add playlists add songs to a playlist list playlists play a playlist list all of the songs in the library with a count of how many times each song has been played remove a song from a playlist remove a playlist remove a song from the library (and thus from all playlists that contain it) note that we will not be checking many error cases. in real programming this would be bad, you should usually try to recognize and respond to as many types of errors as you can. in the context of class we are trying to acquaint you with as many concepts as possible, so for the sake of educational efficiency we will not be checking most errors in this lab, you may assume that your user provides correct input. you may add all appropriate error testing if you wish, but we will not be testing for it.
Answers: 2
question
Computers and Technology, 22.06.2019 23:30
To check spelling errors in a document, the word application uses the to determine appropriate spelling. internet built-in dictionary user-defined words other text in the document
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
In which job role will you be creating e-papers, newsletters and preiodicals
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
History, 13.11.2020 02:20