Question
JUST DO Part #5 NOT WHOLE PROGRAM .For this project you will be designing and implementing a system, in C++ to store employee data. Your
JUST DO Part #5 NOT WHOLE PROGRAM.For this project you will be designing and implementing a system, in C++ to store employee data. Your system should act as a database and allow the user to load in multiple tables of data, run basic queries on the data, and then store the data off for later use. Major functionality components must be constructed in some function, or across some functions, that are declared and defined outside of your main.c/main.cpp . Remember, function declarations must be stored in a header file, while definitions must be stored in a .c/.cpp file. You may have additional functions that support your major functionality component function. The major functionality components are:
1. (Main)Reading in the input file and organizing initial data storage, reading in queries, and output the data to the screen 2. Creating (Plane, PlaneType, PlaneSeats ) table to store the data, and developing functions to insert, update, select, delete, and write that data to file 3. Creating (FlightLeg , FlightInstance, FlightLegInsatnce) table to store the data, and developing functions to insert, update, select, delete, and write that data to file4. Creating (Passenger, Reservation) table to store the data, and developing functions to insert, update, select, delete, and write that data to file 5. Creating (Airport, Pilot) table to store the data, and developing functions to insert, update, select, delete, and write that data to file
1. DISPLAY()
a)DISPLAY should output the current state of each table to the user in a tabular format
b) Be sure to include the attribute names for each table Queries must be processed via a regular expression
2. INSERT(string, string) where the first string is a tuple of key & values, and second string is the table name
a) INSERT should report to the user and not overwrite the data if there is already an entry with that key value. Key should be unique. The user does not allow to add repeated key in table
b) Otherwise INSERT should add the data to the table and report a successful insertion to the user
c) Be sure to specify the tuple and the table when reporting to the user
3. UPDATE( string, string) where the first is a tuple of key & values, and second string is the table name
a) UPDATE should report to the user and not update the data if there is no entry with that key value
b) Otherwise UPDATE should alter the data that key points to and report a successful update to the user
c) Be sure to specify the tuple and the table when reporting to the user d) Key should be unique. The user does allow to add repeated key in table
4. SELECT(string ,string), where the first string is a tuple that can have either a value or * for each component, and second string is the table name
a) SELECT should report to the user if no rows match the query
b) Otherwise SELECT should report to the user all rows that match the query
c) Be sure to specify the tuple and the table when reporting to the user
5.DELETE(string, string) where the first is a tuple that can have either a key & value or * for all tuples, and second string is the table name
a) DELETE should report to user if no rows match the query
b) Otherwise DELETE should remove all rows that match the query and report a successful deletion to the user
c) Be sure to specify the tuple and the table when reporting to the user
6. WRITE()
a) WRITE should write the data in each of the tables to a .CSV separate file in the same format they were read
b) All other lines will be comma delimited rows of data in the table
c)The filename should be different from the original file name to avoid overwriting. ( e.g "table_name_v1.csv" )
Input:
DATA_Plane.CSV Plane
DATA_PlaneType.CSV PlaneType
DATA_FlightLeg.CSV FlightLeg
DATA_PlaneSeats.CSV PlaneSeats
DATA_FlightLegInstance.CSV FlightLegInstance
DATA_Airport.CSV Airport
DATA_Pilot.CSV Pilot
DATA_FlightInstance.CSV FlightInstance
DATA_Reservation.CSV Reservation
DATA_Passenger.CSV Passenger
DISPLAY()
Plane
PlaneType
FlightLeg
PlaneSeats
FlightLegInstance
Airport
Pilot
FlightInstance
Reservation
Passenger
INSERT((AIRBUS,A340,295,137),PlaneType)
INSERT((1050,Meal,N),Flight)
INSERT((1050,10/5/2021,1/1/2021,19:20,1/1/2002,20:40,8.0),FlightLegInstance)
INSERT((SEA,Seattle, WA),AirPort)
INSERT((10,Jack,5/2/1990),Pilot)
INSERT((AIRBUS,A340,F,95),PlaneSeats)
INSERT((AIRBUS,A340,E,200),PlaneSeats)
INSERT((10,AIRBUS,A340,09/04/2021,SEA),Plane)
INSERT((11,1050,10/6/2021,LAX,SEA,E,9/7/2021),Reservation)
INSERT((12,Jean,(817)222-5555),Passenger)
INSERT((1050,10/7/2021),FlightInstance)
INSERT((1050,1,LAX,SEA,1/1/2021,15:30,1/1/2001,21:00,10),FlightLeg)
UPDATE((AIRBUS,A340,295,137),PlaneType)
UPDATE((1050,Meal,N),Flight)
UPDATE((1050,10/5/2021,1/1/2021,19:20,1/1/2002,20:40,8.0),FlightLegInstance)
UPDATE((SEA,Seattle, WA),AirPort)
UPDATE((10,Brian,5/2/1990),Pilot)
UPDATE((AIRBUS,A340,F,195),PlaneSeats)
UPDATE((AIRBUS,A340,E,100),PlaneSeats)
UPDATE((10,AIRBUS,A340,09/04/2021,SEA),Plane)
UPDATE((11,1050,10/6/2021,LAX,SEA,F,9/7/2021,9/8/2021),Reservation)
UPDATE((12,Jean,(817)000-6767),Passenger)
UPDATE((1050,10/8/2021),FlightInstance)
UPDATE((1050,1,LAX,SEA,1/1/2021,15:30,1/1/2021,21:00,10),FlightLeg)
DELETE((AIRBUS,A340,295,137),PlaneType)
DELETE((1050,Meal,N),Flight)
DELETE((1050,10/5/2021,1/1/2021,19:20,1/1/2002,20:40,8.0),FlightLegInstance)
DELETE((SEA,Seattle, WA),AirPort)
DELETE((10,Brian,5/2/1990),Pilot)
DELETE((AIRBUS,*,F,*),PlaneSeats)
DELETE((AIRBUS,A340,E,100),PlaneSeats)
DELETE((10,AIRBUS,A340,09/04/2021,SEA),Plane)
DELETE((11,1050,10/6/2021,LAX,SEA,F,9/7/2021,9/8/2021),Reservation)
DELETE((12,Jean,(817)000-6767),Passenger)
DELETE((1050,10/8/2021),FlightInstance)
DELETE((1050,1,LAX,SEA,1/1/2021,15:30,1/1/2021,21:00,10),FlightLeg)
SELECT((*,*,*,*,*,*,*,*),Pilot),Name)
SELECT((*,*,*,*,*,*,*,*),Reservation),FromA)
SELECT((*,*,*,*,*,*,*,*),FlightInstance),ActArr)
DISPLAY()
WRITE()
Data:
DATA_AirPort
Code,City,State
DFW,Dallas,TX
LOG,Boston,MA
ORD,Chicago,IL
MDW,Chicago,IL
JFK,New York,NY
LGA,New York,NY
INT,Houston,TX
LAX,Los Angeles,CA
DATA_Flight
FLNO,Meal,Smoking
1000,Bistro,Y
1010,Meal,N
1020,Meal,Y
1030,Snack,N
1040,Meal,N
DATA_FlightInstance
FLNO,Fdate
1000,10/5/2002
1000,10/6/2002
1000,10/7/2002
1010,10/5/2002
1010,10/6/2002
1020,10/5/2002
1030,10/5/2002
1040,10/7/2002
DATA_FlightLeg
FLNO,Seq,FromA,ToA,DeptTime,ArrTime,Plane
1000,1,"DFW","LOG",1/1/2001 10:20,1/1/2001 13:40,7
1010,1,"LAX","ORD",1/1/2001 13:10,1/1/2001 16:20,3
1010,2,"ORD","JFK",1/1/2001 17:10,1/1/2001 20:20,3
1020,1,"LOG","JFK",1/1/2001 5:40,1/1/2001 6:20,9
1020,2,"JFK","DFW",1/1/2001 7:20,1/1/2001 10:20,9
1020,3,"DFW","INT",1/1/2001 11:10,1/1/2001 11:40,7
1020,4,"INT","LAX",1/1/2001 12:20,1/1/2001 15:10,7
1030,1,"LAX","INT",1/1/2001 11:20,1/1/2001 16:10,6
1030,2,"INT","DFW",1/1/2001 17:20,1/1/2001 18:00,6
1040,1,"LAX","LGA",1/1/2002 15:30,1/1/2001 21:00,1
DATA_FlightLegInstance
Seq,FLNO,Fdate,ActDept,ActArr,Pilot
1,1000,10/5/2002,1/1/2002 10:10,1/1/2002 13:10,3
1,1000,10/6/2002,1/1/2002 10:30,1/1/2002 14:20,8
1,1010,10/5/2002,1/1/2002 13:20,1/1/2002 17:10,1
2,1010,10/5/2002,1/1/2002 18:00,1/1/2002 21:00,1
1,1010,10/6/2002,1/1/2002 13:10,1/1/2002 16:10,3
2,1010,10/6/2002,1/1/2002 17:00,1/1/2002 20:30,6
1,1020,10/5/2002,1/1/2002 5:40,1/1/2002 6:30,5
2,1020,10/5/2002,1/1/2002 7:30,1/1/2002 10:40,5
3,1020,10/5/2002,1/1/2002 11:30,1/1/2002 12:20,5
4,1020,10/5/2002,1/1/2002 13:00,1/1/2002 16:00,2
1,1030,10/5/2002,1/1/2002 11:20,1/1/2002 16:10,8
2,1030,10/5/2002,1/1/2002 17:20,1/1/2002 18:40,8
1,1000,10/7/2002,,,
1,1040,10/7/2002,,,
DATA_Passenger
ID,Name,Phone
1,"Jones","(972)999-1111"
2,"James","(214)111-9999"
3,"Henry","(214)222-1111"
4,"Luis","(972)111-3333"
5,"Howard","(972)333-1111"
6,"Frank","(214)111-5555"
7,"Frankel","(972)111-2222"
8,"Bushnell","(214)111-4444"
9,"Camden","(214)222-5555"
10,"Max","(972)444-1111"
11,"Flores","(214)333-6666"
12,"Clinton","(214)222-5555"
DATA_PILOT
ID,Name,DateHired
1,Jones,5/10/1990
2,Adams,6/1/1990
3,Walker,7/2/1991
4,Flores,4/1/1992
5,Thompson,4/10/1992
6,Dean,9/2/1993
7,Carter,8/1/1994
8,Mango,5/2/1995
DATA_Plane
ID,Maker,Model,LastMaint,LAstMaintA
1,MD,MD11,9/3/2002,DFW
2,MD,MD11,9/4/2002,MDW
3,MD,SUPER80,9/1/2002,LAX
4,MD,SUPER80,9/3/2002,ORD
5,MD,SUPER80,9/6/2002,LGA
6,BOEING,727,9/1/2002,DFW
7,BOEING,757,10/2/2002,LAX
8,AIRBUS,A300,9/1/2002,INT
9,AIRBUS,A320,9/4/2002,LOG
DATA_PlaneSeats
Maker,Model, SeatType,NoOfSeats
MD,MD11,F,20
MD,MD11,E,150
MD,SUPER80,F,10
MD,SUPER80,E,90
BOEING,727,F,10
BOEING,727,E,110
BOEING,757,F,20
BOEING,757,E,160
AIRBUS,A300,F,20
AIRBUS,A300,E,160
AIRBUS,A320,F,30
AIRBUS,A320,E,200
DATA_PlaneType
Maker,Model,FlyingSpeed,GroundSpeed
MD,MD11,600,180
MD,SUPER80,500,170
BOEING,727,510,160
BOEING,757,650,160
AIRBUS,A300,620,150
AIRBUS,A320,700,180
DATA_Reservations
PassID,FLNO,FDate,FromA,ToA,SeatClass,DateBooked,DateCancelled
1,1000,10/5/2002,DFW,LOG,E,9/5/2002,
1,1020,10/5/2002,LOG,JFK,E,9/14/2002,
2,1020,10/5/2002,LOG,INT,E,9/4/2002,
3,1020,10/5/2002,JFK,LAX,E,9/19/2002,
4,1020,10/5/2002,LOG,LAX,E,9/10/2002,
5,1020,10/5/2002,LOG,DFW,F,9/29/2002,
6,1010,10/5/2002,LAX,JFK,E,9/19/2002,
7,1010,10/5/2002,LAX,ORD,E,9/27/2002,
8,1030,10/5/2002,LAX,DFW,F,10/5/2002,
3,1010,10/6/2002,LAX,JFK,E,9/14/2002,
9,1010,10/6/2002,LAX,JFK,E,9/9/2002,
10,1010,10/6/2002,ORD,JFK,E,9/7/2002,9/19/2002
11,1000,10/6/2002,DFW,LOG,E,9/9/2002,
12,1000,10/6/2002,DFW,LOG,E,9/19/2002,
1,1010,10/6/2002,ORD,JFK,E,9/15/2002,
1,1040,10/7/2002,LAX,LGA,E,10/1/2002,
tables_schema
table_name,column1,column2,column3,column4,column5,column6,column7,column8
Plane,ID:k:int,Maker::str,Model::str,LastMaint::str,LastMaintA::str,,,
PlaneType,Maker:k:str,Model:k:str,FlyingSpeed::int,GroundSpeed::int,,,,
FlightLeg,FLNO:k:str,Seq:k:str,FromA::str,ToA::str,DeptTime::str,ArrTime::str,Plane::str,
PlaneSeats,Maker:k:str,Model:k:str,SeatType:k:str,NoOfSeats::int,,,,
FlightLegInstance,Seq:k:str,FLNO:k:str,Fdate:k:str,ActDept::str,ActArr::str,Pilot::str,,
Airport,Code:k:str,City::str,State::str,,,,,
Pilot,ID:k:int,Name::str,DateHired::str,,,,,
FlightInstance,FLNO:k:str,FDate:k:str,,,,,,
Reservation,PassID:k:str,FLNO:k:str,FDate:k:str,FromA::str,ToA::str,SeatClass::str,DateBooked::str,DateCancelled::str
Passenger,ID:k:int,Name::str,Phone::str,,,,,
Flight,FLNO:k:str,Meal::str,Smoking::str,,,,,
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started