Question: i am trying to comple this c++ program but getting this error can someone help me ? Also the class Facility and the main funtion

i am trying to comple this c++ program but getting this error can someone help me ? Also the class Facility and the main funtion should not be modified. the output of the program is given below.

SFO SAN FRANCISCO INTL test if DFW: false test if SFO: true

#include "Facility.h"

#include "Code.h"

#include

#include

#include

#include

using namespace std;

class Facility

{

public:

Facility(std::string s);

std::string site_number(void) const;

std::string type(void) const;

std::string code(void) const;

std::string name(void) const;

double latitude(void) const;

double longitude(void) const;

double distance(double lat, double lon) const;

private:

const std::string site_number_;

const std::string type_;

const std::string code_;

const std::string name_;

const double latitude_, longitude_;

double convert_latitude(std::string s) const;

double convert_longitude(std::string s) const;

};

class Code {

public:

bool boolalpha;

Code(string s)

{

this.s = s;

boolalpha = true;

}

};

int main(int argc, char **argv)

{

ifstream facilities_file("testFacility1.in");

string line;

getline(facilities_file,line);

Facility *f = new Facility(line);

cout code() name()

cout

cout

delete f;

}

i am trying to comple this c++ program but getting this error

class Code public: ..bool boolalpha; Code(string s) boolalphatruei Member reference type 'Code " is a pointer; did you mean to use'->"? Replace'' with '-> 0 ! No member named 's' in 'Code' Hi int main(int argc, char *argv) . . . ifstream-facilities-file ( "testFacilityl.in" ) ; string line; getline (facilities_file,line) Facility fnew Facility(line); cout code)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!