Hello, I have a code I'm working on that is supposed to keep track of airline tracks. You need to know the airline name, the flight number, and the date and time of a set of flights. Once you have a set of flights, you would like to be able to print them out, and to search for a specific flight by number.
This is my code so far:
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
const int SIZE = 100;
struct flightInfo
{
int number;
string airline;
string date;
string time;
};
void listFlights(flightInfo flights[], int count);
void newFlight();
void flightNumber();
int main()
{
char choice = 'a'; 'p'; 's'; 'q';
flightInfo flights[SIZE];
flightInfo count;
cout << "Welcome to the flight tracker." << endl;
cout << "What would you like to do? (a)dd a flight, (p)rint, (s)earch, or (q)uit: ";
cin >> choice;
cout << "What is the airline name of the flight to add? ";
getline(cin, flights[0].airline);
index++
listFlights(flights[], index);
system("pause");
return 0;
}
{
void listFlights(flightInfo flights[], int cout) = 100;
int i = 0;
for (i = 0, i < count; i++)
{
cout << "Airline: " << flights[i].airline;
cout << "Number: " << flights[i].number;
cout << "Date: " << flights[i].date;
cout << "Time: " << flights[i].time;
}
return;
}
{
void insertFlight(flightInfo[], newFlight);
}
{
void listFlights(flightInfo, flights[]);
}
{
void searchFlights(flightInfo, flights[], int flightnumber);
}
// In the main function, I can't figure out how to make the choice, I know I'm doing it wrong with the char.
// I'm also supposed to create seerate function for each operation I listed such as
void insertFlight(flights[], flightInfo newFlight);
I am brand new to programming. and would like some help in direction of how to continue or maybe some websites that could help me with structure. The book I have from class really didn't help me, I feel stuck. Help would be appreciated!
Thanks.