Question
Implement the program runway.cpp which uses the provided class runway.h and can be tested with provided program testRunway.cpp Instriution for the program are provided below--
Implement the program runway.cpp which uses the provided class runway.h and can be tested with provided program testRunway.cpp
Instriution for the program are provided below--
Runway(string s) The constructor takes a single string argument. The argument s contains a full line read from theRunways.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
class Runway
{
public:
Runway(std::string s);
std::string site_number(void) const;
std::string name(void) const;
int length(void) const;
private:
int convert_length(std::string s) const;
const std::string site_number_;
const std::string name_;
const int length_;
};
#endif
//
// testRunway.cpp
//
#include "Runway.h"
#include
#include
using namespace std;
int main()
{
string line;
getline(cin,line);
Runway r(line);
cout << r.site_number() << " " << r.name() << " "
<< setw(8) << r.length() << endl;
}
example of input--
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
example of output--
04508.*A 09R/27L 7967
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started