Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

i am trying to comple this c++ program but getting this error can someone help m

ID: 3901878 • Letter: I

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 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 <iostream>

#include <fstream>

#include <iomanip>

#include <string>

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 << f->code() << " " << f->name() << endl;

cout << "test if DFW: " << boolalpha << Code("DFW ")(f) << endl;

cout << "test if SFO: " << boolalpha << Code("SFO ")(f) << endl;

delete f;

int main int argc, char *argv)- . . ifstream facilities-file( "testFacilityl.in"); .string line .getline(facilities_file,line); Facility *f =.new. Facility (line);?. cout

Explanation / Answer

In C++, you cannot create object using Code("DFW ").

In order to create an object of Code, you need to do

Code c1("DFW ");

This is the reason you are getting the error that "Type 'Code' does not provide a call operator".