how to calculate the difference between the departure and arrival times of a plane entered from the console?
in my task it is said to display data on aircrafts with the highest average speed (structure array i believe) ; time of arrival, departure, distance, etc. are entered manually from the console.
what's the best way to calculate flight times for this? some function? can you explain please
also, here's the full task just so you get the idea of what i need:
"Flight data includes flight number, departure time, arrival time, direction, aircraft model, distance.
Organize an information array for storing data in the form of a given structure and fill it with data from the keyboard (console). After entering the data on the current flight, allow you to correct the information as needed, if the user has such a need.
Display data on flights with the maximum average speed.
Display flight data from a user-specified destination.
Display data on flights departing from a given point within a given period of time."
ps: just a piece of my code, don't know if you need it
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#include <iostream>
#include <string>
#include<ctime>
using namespace std;
struct Time
{
short hours;
short minutes;
};
struct flight
{
int num; // номер рейса
Time departure; // отправление
Time arrival; // прибытие
string direction; // направление
char model; // модель
double distance; // расстояние
};
|