Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help i updated In this project, the LINES. Dxt and CITIES.bat files attached below and detailed below. You are expected to write a C++

please help
image text in transcribed
image text in transcribed
image text in transcribed
i updated
image text in transcribed
image text in transcribed
image text in transcribed
In this project, the LINES. Dxt and CITIES.bat files attached below and detailed below. You are expected to write a C++ program using data. The drawing below shows an air transport line (one-way) where the letters show the city names and the numbers show the distances (kilometers) between two cities *A* is the first terminal city. "Z" is the last terminal city. 2000 1000 1500 2000 A B D > Z In this project, you are gen two teattles The "LINES. TXT file contains the following data Line code (line code) Line namene name) Line type ine_craftype) Number of cities on the ineline_cities) Sequence of Chy code and any name pains (schy_code and cly distances) The "CITIES.TXT file contains the following data City code (cly_code) . Cay name folyname) Write the definition for the Line des given in the UML Gagram below. Line line_code int line_name string line_craft_type : string + line_cities : vector. The first template parameter (int) is the key (city code). The second template parameter (string) is the value (city name). The program should read the file "CITIES.TXT" and start this map Declare the STL vector of Line class objects. The program should read the file "LINES.TXT" and initialize this vector. If any of the data files cannot be opened, the program should throw a corresponding exception message. Display the user interface shown below and perform user query operations. First, the UI should show a list of all available lines using the lines STL vector LINES MENU Line_code Line_nane Line_craft_type 1 LINE-1 Boeing 2 LINE-2 Airbus LINE-3 Detfly LINE-4 Lockheed LINE-5 Boeing LINE-6 Jetfly Enter Line Code : 4 Next, the UI CITIES ON SELECTED LINE should display the Distance names of all cities city_code City name in the selected row 13 Lancaster e 11 and Kimberley 2000 should prompt the 1 Apeldoorn 3000 26 Vinh 1000 user to select a 10 Jaipur 2000 starting city code 29 Yingkou 1000 and an ending city Ogbomosho 3000 code. Datong 4000 Liaocheng 1000 Quilmes 3000 Enter Start city code and End City Code : 26 5 If the user makes any invalid input, the program should throw a corresponding exception message program output The main program should call the print_schedule function of the selected row object. print_schedule should create and display a timeline between the start city and the selected end city. Departure_city Departure Time Arrival City Arriva flee Distance() Travel DurationCours) Vi 18:00 Jaipur 21:00 Jaipur 22:00 Yingo 23:00 Vio 24:00 Oxborosho ghoshe 05:00 Dating TOTAL DISTANCE) 10000 TOTAL HOURS. 34 IMPORTANT: The first (earliest) departure time from a terminal city (the first city in the line sequence) is 07:00 Arrival time in a city is based on the average speed of the line and the distance between two cities. must be calculated The first terminal is in the city and the last terminal is outside the city, and there should be a waiting time of 1 hour in every arriving city Hours for time calculations and minutes to always show as zero If a time reaches 24, after that it should be set to zero. After selecting the menu, there is no need to return to the main menu, the program must stop, You can skip column alignments in the UI and output screens you can round. In this project, the LINES.txt and CITIES.txt files attached below and detailed below. You are expected to write a C++ program using data. The drawing below shows an air transport line (one-way) where the letters show the city names and the numbers show the distances (kilometers) between two cities. "A" is the first terminal city, "Z" is the last terminal city. 2000 1000 > > B 1500 > D 2000 > Z A Y In this project, you are given two text files The "LINES. TXT" file contains the following data Line code (ine code) Line name (line name) Line type (ine_craft_type) Number of cities on the fine line_cities) Sequence of cay code and aty name pairs (. The first template parameter (int) is the key (city code). The second template parameter (string) is the value (city name). The program should read the file "CITIES.TXT" and start this map Declare the STL vector of Line class objects. The program should read the file "LINES.TXT" and initialize this vector. If any of the data files cannot be opened, the program should throw a corresponding exception message. Display the user interface shown below and perform user query operations. First, the UI should show a list of all available lines using the lines STL vector LINES MENU Line_code Line_nane Line_craft_type 1 LINE-1 Boeing 2 LINE-2 Airbus LINE-3 Detfly LINE-4 Lockheed LINE-5 Boeing LINE-6 Jetfly Enter Line Code : 4 Next, the UI CITIES ON SELECTED LINE should display the Distance names of all cities city_code City name in the selected row 13 Lancaster e 11 and Kimberley 2000 should prompt the 1 Apeldoorn 3000 26 Vinh 1000 user to select a 10 Jaipur 2000 starting city code 29 Yingkou 1000 and an ending city Ogbomosho 3000 code. Datong 4000 Liaocheng 1000 Quilmes 3000 Enter Start city code and End City Code : 26 5 If the user makes any invalid input, the program should throw a corresponding exception message program output The main program should call the print_schedule function of the selected row object. print_schedule should create and display a timeline between the start city and the selected end city. Departure_city Departure Time krivec City Arrival Tie bistance() Travel Duration (Hours) Vih 15:00 Jaipur 21:00 Dapur 22:00 Virglow 23100 Vio 24. Ogbomosho 04 oghorosho 05:00 Dating 4000 TOTAL DISTANCE (6) - 1000 TOTAL HOUS-14 IMPORTANT: The first (earliest) departure time from a terminal city (the first city in the line sequence) is 07:00. Arrival time in a city is based on the average speed of the line and the distance between two cities. must be calculated The first terminal is in the city and the last terminal is outside the city, and there should be a waiting time of 1 hour in every arriving city Hours for time calculations and minutes to always show as zero you can round If a time reaches 24, after that it should be set to zero. After selecting the menu, there is no need to return to the main menu, the program must stop. You can skip column alignments in the UI and output screens

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Does it have correct contact information?

Answered: 1 week ago