# A set of constants, each representing a list index for station informat ID = 0 NAME LATITUDE = 2 LONGITUDE = 3 САРАСІТY - 4 BIKES_AVAILABLE = 5 1 %3D DOCKS_AVAILABLE 6 NO_KIOSK = 'SMART' # For use in the get_lat_lon_distance helper function EARTH_RADIUS = 6371 # SAMPLE DATA TO USE IN DOCSTRING EXAMPLES SAMPLE_STATIONS [7090, 'Danforth Ave / Lamb Ave', 43.681991, -79.329455, 15, 4, 10], [7486, 'Gerrard St E / Ted Reeve Dr', 43.684261, -79.299332, 24, 5, 19], [7571, 'Highfield Rd / Gerrard St E 43.671685, -79.325176, 19, 14, 5]] SMART', HANDOUT_STATIONS [7000, 'Ft. York / Capreol Crt.', 43.639832, -79.395954, 31, 20, 11], [7001, 'Lower Jarvis St SMART / The Esplanade', 43.647992, -79.370907, 15, 5, 10]]

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

complete the docstring using the information provided:

# A set of constants, each representing a list index for station information.
ID = 0
NAME = 1
LATITUDE
2
LONGITUDE = 3
САРАСІTY 3D 4
BIKES_AVAILABLE
= 5
DOCKS_AVAILABLE = 6
NO_KIOSK = 'SMART'
# For use in the get_lat_lon_distance helper function
EARTH_RADIUS = 6371
# SAMPLE DATA TO USE IN DOCSTRING EXAMPLES
SAMPLE_STATIONS
[7090, 'Danforth Ave / Lamb Ave',
43.681991, -79.329455, 15, 4, 10],
[7486, 'Gerrard St E / Ted Reeve Dr',
43.684261, -79.299332, 24, 5, 19],
[7571, 'Highfield Rd / Gerrard St E
43.671685, -79.325176, 19, 14, 5]]
SMART',
HANDOUT_STATIONS
[7000, 'Ft. York / Capreol Crt.',
43.639832, -79.395954, 31, 20, 11],
[7001, 'Lower Jarvis St SMART / The Esplanade',
43.647992, -79.370907, 15, 5, 10]]
Transcribed Image Text:# A set of constants, each representing a list index for station information. ID = 0 NAME = 1 LATITUDE 2 LONGITUDE = 3 САРАСІTY 3D 4 BIKES_AVAILABLE = 5 DOCKS_AVAILABLE = 6 NO_KIOSK = 'SMART' # For use in the get_lat_lon_distance helper function EARTH_RADIUS = 6371 # SAMPLE DATA TO USE IN DOCSTRING EXAMPLES SAMPLE_STATIONS [7090, 'Danforth Ave / Lamb Ave', 43.681991, -79.329455, 15, 4, 10], [7486, 'Gerrard St E / Ted Reeve Dr', 43.684261, -79.299332, 24, 5, 19], [7571, 'Highfield Rd / Gerrard St E 43.671685, -79.325176, 19, 14, 5]] SMART', HANDOUT_STATIONS [7000, 'Ft. York / Capreol Crt.', 43.639832, -79.395954, 31, 20, 11], [7001, 'Lower Jarvis St SMART / The Esplanade', 43.647992, -79.370907, 15, 5, 10]]
def upgrade_stations(threshold: int, num_bikes: int,
stations: List["Station"]) -> int:
"""Modify each station in stations that has a capacity that is less than
threshold by adding num_bikes to the capacity and bikes available counts.
Modify each station at most once.
Return the total number of bikes that were added to the bike share network.
Precondition: num_bikes >= 0
>> handout_copy = [HANDOUT_STATIONS[0][:], HANDOUT_STATIONS[1][:]]
>> upgrade_stations(25, 5, handout_copy)
5
>>> handout_copy[0]
HANDOUT_STATIONS[Ø]
==
True
>>> handout_copy[1]
[7001, 'Lower Jarvis St SMART / The Esplanade', \
43.647992, -79.370907, 20, 10, 10]
True
Transcribed Image Text:def upgrade_stations(threshold: int, num_bikes: int, stations: List["Station"]) -> int: """Modify each station in stations that has a capacity that is less than threshold by adding num_bikes to the capacity and bikes available counts. Modify each station at most once. Return the total number of bikes that were added to the bike share network. Precondition: num_bikes >= 0 >> handout_copy = [HANDOUT_STATIONS[0][:], HANDOUT_STATIONS[1][:]] >> upgrade_stations(25, 5, handout_copy) 5 >>> handout_copy[0] HANDOUT_STATIONS[Ø] == True >>> handout_copy[1] [7001, 'Lower Jarvis St SMART / The Esplanade', \ 43.647992, -79.370907, 20, 10, 10] True
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Lists
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education