Computers and Technology

Suppose you are building a robot (drone) capable of delivering e-commerce packages to customers' homes. As a developer, you are instructed to create a Python program to translate names on orders into locations (coordinates, represented as tuples) so the delivering team can program everything into the drones without any hassles of looking up an address book.
Suppose you are provided with following customer names and address pairs:

Customer Name Address
Alice (92617, 10, 1200)
Bob (92617, 10, 8320)
Cindy (92630, 15, 2550)
Wang (91250, 24, 3205)
Chang (91450, 61, 9982)
Lee (91750, 92, 6420)
Steve (91250, 89, 7102)
Turing (96250, 57, 8311)
Fourier (90318, 83, 9158)
McCulloch (94832, 29, 6204)
Tanaka (95623, 38, 4311)
Ichiro (93324, 13, 10056)
Shohei (90125, 24, 2309)

Note that address is encoded as a 3-tuple where the first element holds zip-code (int), the second entry holds an encoded number of street name (int), and the last entry is the street number (int).
Can you create a list of tuples when supplied with 5 customer names?

Program description
Task 1: Build a Customer Name/Address dictionary
From the Customer Name/Address table above, build a dictionary of key/value pairs as specified: The customer name is the key, and the value is the coordinate tuple.
Task 2: Build a List of Customer Tuples
Your program takes in 5 customer names from user input (with exact formatting as indicated below)
For each customer, add the coordinates into a list.
Print the list out with exact formatting as indicated below:
Sample print-out:
When input is:
Alice
Bob
Cindy
Wang
Chang
Standard output exactly matches

Enter customer 1's name:
Enter customer 2's name:
Enter customer 3's name:
Enter customer 4's name:
Enter customer 5's name:

Routing addresses are:
[(92617, 10, 1200), (92617, 10, 8320), (92630, 15, 2550), (91250, 24, 3205), (91450, 61, 9982)]

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 20:10, yqui8767
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
image
Computers and Technology, 23.06.2019 01:30, solikhalifeoy3j1r
In deadlock avoidance using banker’s algorithm, what would be the consequence(s) of: (i) a process declaring its maximum need as maximum possible for each resource. in other words, if a resource a has 5 instances, then each process declares its maximum need as 5. (ii) a process declaring its minimum needs as maximum needs. for example, a process may need 2-5 instances of resource a. but it declares its maximum need as 2.
Answers: 3
image
Computers and Technology, 23.06.2019 04:31, mona92
Which of the following is not a way in which trees benefit the environment? a. they remove a significant amount of carbon dioxide from the atmosphere. b. they remove a significant amount of oxygen from the atmosphere. c. their roots hold soil in place, reducing rates of erosion. d. they remove ozone and particulates from the atmosphere. select the best answer from the choices provided a b c d
Answers: 1
image
Computers and Technology, 23.06.2019 15:00, billlyyyyyyyyyy
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
Do you know the correct answer?
Suppose you are building a robot (drone) capable of delivering e-commerce packages to customers' hom...

Questions in other subjects:

Konu
Chemistry, 12.10.2020 09:01
Konu
History, 12.10.2020 09:01