Question: Runway Runway(string s) The constructor takes a single string argument. The argument s contains a full line read from the Runways.txt file. The constructor should
Runway
Runway(string s) The constructor takes a single string argument. The argument s contains a full line read from the Runways.txt file. The constructor should initialize the data members of Runway by selecting the appropriate substrings from the argument.
string site_number(void) const
This function returns the site number of the facility that the runway belongs to.
string name(void) const
This function returns the name of the runway.
int length(void) const
This function returns the length of the runway in ft.
int convert_length(string s) const This function converts the string s representing a runway length to an int value in feet.
// // Runway.h //
#ifndef RUNWAY_H #define RUNWAY_H #include
testRunway.cpp
// // testRunway.cpp //
#include "Runway.h" #include
int main() { string line; getline(cin,line); Runway r(line); cout << r.site_number() << " " << r.name() << " " << setw(8) << r.length() << endl; }
Example of Code: testRunway.in
04508.*A IL09R/27L 7967 150ASPH-CONC-G GRVD 108/R/C/W/UHIGH 09R090ILS/DME NPIR G41-59-02.0302N 151142.0302N087-55-06.0672W316506.0672W 659.8 743.00 659.8P4L TMRNMALSR NYY PIR 50 27L270ILS/DME NPIR G41-59-02.0405N 151142.0405N087-53-20.5834W316400.5834W 650.1 673.00 653.6P4R TMRNALSF2 NYYRR PIR 42 34 162944R 3RD PARTY SURVEY07/27/2012 100.0 210.0 350.0 0.1 3RD PARTY SURVEY07/27/20123RD PARTY SURVEY07/27/2012 3RD PARTY SURVEY07/27/2012 7967 7967 7709 7709 0.1 3RD PARTY SURVEY07/27/20123RD PARTY SURVEY07/27/2012 3RD PARTY SURVEY07/27/2012 7967 7967 7782 7782
testRunway.out
04508.*A 09R/27L 7967
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
