
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
write a function
is_valid_station(name) that returns if name is a valid station name
use python.

Transcribed Image Text:Boston Subway
The Boston Subway e has four different colored trains, some of which have multiple
routes. We have simplified the routes so that each train has a single route with the
following stations (in order from north to south) and that each colored line intersects
with another colored line at exactly one station.
• Red Line: Alewife, Davis, Porter, Harvard, Central, Kendall/MIT, Charles/MGH,
Downtown Crossing, South Station, Broadway, Andrew, JFK/UMass
• Orange Line: Oak Grove, Malden Center, Wellington, Assembly, Sullivan Square,
Community College, North Station, Haymarket, State, Downtown Crossing,
Chinatown, Tufts Medical Center, Back Bay, Mass Avenue, Ruggles, Roxbury
Crossing, Jackson Square, Stony Brook, Green Street, Forest Hills
• Blue Line: Wonderland, Revere Beach, Beachmont, Suffolk Downs, Orient Heights,
Wood Island, Airport, Maverick, Aquarium, State
• Green Line: Haymarket, Government Center, Park Street, Boylston, Arlington,
Copley, Haynes Convention Center, Kenmore, Blandford Street, Boston University
East, Boston University Central, Boston University West, Saint Paul Street,
Pleasant Street, Babcock Street, Packards Corner, Harvard Avenue, Griggs Street,
Allston Street, Warren Street, Washington Street, Sutherland Road, Chiswick Road,
Chestnut Hill Avenue, South Street, Boston College
Station names must match exactly (unforgiving about upper/lowercase and
abbreviations) with the exception of names that have a "/" in them. These stations can
be referred to be either one. For example, both "Kendall" and "MIT" refer to the same
station.
Note: The simplification of our train lines is such that each line intersects with other
lines in exactly one station. But not all lines intersect every other line.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 4 images

Knowledge Booster
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
- Can you use Python programming language to to this question? Thanksarrow_forwardwrite a function get_intersecting_station(line_one, line_two) where line_one and line_two are the colors of the lines. This function should return the name of the station where the two lines intersect. Recall from our simplification, there will be only one. If there is no intersecting station, return None use pythonarrow_forwardIn Python code: Write a function to convert a integer to hexidecimal. Do not use the Python hex function (i.e. hexnumber = hex(number)) to convert the number, instead write your own unique version (i.e. MYHEX: hexnumber = MYHEX(number)). Your function should not use any Python functions like hex, dec, oct, bin or any other Python functions or modules. Functions, like Python ORD, can be used to convert a string to a integer.arrow_forward
- In c++, Write a function that returns the greatest common divisor of 2 integers.arrow_forwardWrite a programmer defined function that calculates the volume of circular cone(see the below figure) using the following formula: volume t r² h Where, r is the radius and h is the height of the right circular cone. Give your function a suitable name and parameter list. Test your function by writing at least one function call with any appropriate values. Write the code at the space provided below. Optionally, upload your Python file at link below.arrow_forwardPlease only do rec_sum_digits function in python using only recursive and no looparrow_forward
- A header of a C-language function is: void recurs(int current_level, int max_level ) The keyword "void" here signifiesarrow_forwardCan you use Python programming language to to this question? Thanksarrow_forward*DONOT USE CHATGPT, please put comments so i can understand. It’s a C language program with algorithm.arrow_forward
- Using C++ Language In this program you will write a function of void return type named compare that accepts an integer parameter named guess. This function will compare the value of guess with a seeded randomly generated integer between 1 to 100, inclusive, and let the user know what the random number was as well as whether the guess was larger than, smaller than or equal to the random number. NOTE THAT: You will NOT generate a random number inside the compare function. Rather, you will write another function named getRandom of int return type to do it. You will need to call getRandom from compare, no parameters are necessary. Inside your main function, get the guess from user and pass it to the compare function. Code: #include <iostream>using namespace std; int getRandom(){ //generate seeded random num. //in between 1-100 inclusive //return random number } void compare(int guess){ //call getRandom //compare guess with random number //inform user what…arrow_forwardwrite a python code named get_total_cases() takes the a 2D-list (similar to database) and an integer x from this set {0, 1, 2} as input parameters. Here, 0 represents Case_Reported_Date, 1 represents Age_Group and 2 represents Client_Gender (these are the fields on the header row, the integer value represents the index of each of these fields on that row). This function computes the total number of reported cases for each instance of x in the text file, and it stores this information in a dictionary in this form {an_instance_of_x : total_case}. Finally, it returns the dictionary and the total number of all reported cases saved in this dictionary. (Suppose we want to know the total number of cases reported on each date, so use x = 0.) >>> result, total_cases = get_total_cases(database, 0) >>> display_dict(result) 2021-05-19: 8 2021-05-20: 2 2021-05-21: 1 2021-05-22: 1 >>> print(total_cases)arrow_forwardplease use python.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education