**PYTHON*** I need a program written that can do the following: use the list of tuples given as a starting point for data. option 1 should print the full list of tuples, and the printing needs to be formatted so that the data lines up neatly. option 2 needs to work so that a user can enter the name, destination, and mileage for a new trip, and have that data be added as a tuple to the list. options 3 need to allow filtering the list by name option 4 just needs to allow the program to end if the user does not enter 1, 2, 3 or 4 as an option, you need to print an error message and have them re-enter their choice. there needs to be a main function that kicks things off, and you need to write a function to print the whole list, a function that allows inputting a new trip, and a function that filters by name and prints all the trips for that given name. These functions are called when the user types in a given option from the menu. if you add a new trip, everything should still work The menu options must be: Program Options. Display all trips Input new trip Display trips by Name Exit Each of the first 3 options should call a function to accomplish the proper task.   Tuples:   trips = [                (“alice”, ‘chicago’, 302),                (“bruce”, ‘chicago’, 309),                (“david”, ‘chicago’, 307),                (“carol”, ‘columbus’, 212),                (“alice”, ‘chicago’, 304),                (“bruce”, ‘chicago’, 301),                (“david”, ‘columbus’, 215),                (“alice”, ‘chicago’, 302),                (“carol”, ‘chicago’, 305),                (“bruce”, ‘chicago’, 304),                (“carol”, ‘columbus’, 218),                (“alice”, ‘columbus’, 217),                (“carol”, ‘chicago’, 309)                (“david”, columbus, 219)

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

***PYTHON*** I need a program written that can do the following:

  1. use the list of tuples given as a starting point for data.
  2. option 1 should print the full list of tuples, and the printing needs to be

    formatted so that the data lines up neatly.

  3. option 2 needs to work so that a user can enter the name, destination,

    and mileage for a new trip, and have that data be added as a tuple to the

    list.

  4. options 3 need to allow filtering the list by name

  5. option 4 just needs to allow the program to end
  6. if the user does not enter 1, 2, 3 or 4 as an option, you need to print an

    error message and have them re-enter their choice.

  7. there needs to be a main function that kicks things off, and you need to

    write a function to print the whole list, a function that allows inputting a

    new trip, and a function that filters by name and prints all the trips for

    that given name. These functions are called when the user types in a

    given option from the menu.

  8. if you add a new trip, everything should still work

The menu options must be:

Program Options.

  • Display all trips
  • Input new trip
  • Display trips by Name
  • Exit

Each of the first 3 options should call a function to accomplish the proper task.

 

Tuples:

 

trips = [

               (“alice”, ‘chicago’, 302),

               (“bruce”, ‘chicago’, 309),

               (“david”, ‘chicago’, 307),

               (“carol”, ‘columbus’, 212),

               (“alice”, ‘chicago’, 304),

               (“bruce”, ‘chicago’, 301),

               (“david”, ‘columbus’, 215),

               (“alice”, ‘chicago’, 302),

               (“carol”, ‘chicago’, 305),

               (“bruce”, ‘chicago’, 304),

               (“carol”, ‘columbus’, 218),

               (“alice”, ‘columbus’, 217),

               (“carol”, ‘chicago’, 309)

               (“david”, columbus, 219)

 

 

Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Linked List Representation
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