76 311
Assignments Done
Successfully Done
In May 2019

Answer to Question #28559 in C++ for Paul

Question #28559
I am asking for any help with this program.a class called flight that displays flight number,flight name,origin and time of arrival then adds a new flight or deletes a flight
Expert's answer
There are some approaches to solve such problems, butmost of them are using containers. Because you need to store somewhere all of

There is many containers, such as vector (very close toarray), list (linked list), map (store some value with keys to fast search
through it), queue and etc. These are most common containers. They can be found
in STL (standard template library). There is some example to store, delete and
find some flights.

class Flight {
//....some of yourvalues

#include <vector>
using namespace std;

//....in some function
vector <Flight> Flight_vector;
Flight flight_one(100); //100 - flight numberFlight_vector.push_back(&Flight); //adding to back of vector;

int fn_to_delete = 1000; //flight number to delete
for(vector <Flight*> ::iterator i = Flights.begin();
i !=Flights.end(); ++i) { //iterator approach
if((*i).flight_number = fn_to_delete) {

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions