Visual Basic Question Imagine that you plan to apply for a programming position
ID: 641151 • Letter: V
Question
Visual Basic Question
Imagine that you plan to apply for a programming position at an airline. Before interviewing, you need to have a good idea of how airlines calculate flight arrival times. Therefore, you will create a simple application that explores this concept. Your application will calculate the arrival time of any airline flight. The user selects the local departure date and time, the departure airport, and the arrival airport, then the application calculates the local arrival date and time. It displays this information, along with the trip duration.
It is reasonable to assume that airlines use Coordinated Universal Time (UTC) when calculating departure and arrival times. (Appendix B of the eText explains how to convert between local time and UTC time with examples).
The departure date should be selected from a DateTimePicker control, and departure time is entered into a text box. When the user selects a departure airport, arrival airport, data and time and clicks a Continue button, the arrival date and time appear on the right side of the form.
Implementation Notes:
If the user clicks the Continue button without selecting departure and arrival airports, use an ErrorProvider control to signal the error. Do not allow the program to calculate dates and times until airports are selected.
A suggested approach is to use three steps in your calculations (1) convert the local departure time into UTC time; (2) add the trip
Explanation / Answer
#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);
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.