subject

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)]

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:30, jonquil201
Where would you click to edit the chart data?
Answers: 1
image
Computers and Technology, 22.06.2019 21:30, sunshinekisses
After you clean an engine with hot water spray, it seems to stall; when it doesn't stall, it's idling noisily. technician a says to check for loose bolts on the flex plate near the torque converter. technician b says to wipe down the spark plug wires and the distributor cap. who is correct? a. technician a b. both technicians a and b c. technician b
Answers: 1
image
Computers and Technology, 23.06.2019 13:30, mads000
Drag the tiles to the correct boxes to complete the pairs. match the errors with their definitions. #name #value #ref when a formula produces output that is too lengthy to fit in the spreadsheet cell arrowright when you enter an invalid cell reference in a formula arrowright when you type text in cells that accept numeric data arrowright when you type in a cell reference that doesn’t exist arrowright reset next
Answers: 1
image
Computers and Technology, 23.06.2019 14:30, naomi20044
Select the correct answer. andy received a potentially infected email that was advertising products. andy is at risk of which type of security threat? a. spoofing b. sniffing c. spamming d. phishing e. typo-squatting
Answers: 2
You know the right answer?
Suppose you are building a robot (drone) capable of delivering e-commerce packages to customers' hom...

Questions in other subjects: