Question: InPassport.cpp: Implement the getter functionsgetCamperName() andcheckJuniorPassport(). Implement the functionaddParkVisited(), which takes in a pointer to aStatePark object as a parameter and adds it to the

  1. InPassport.cpp:
    1. Implement the getter functionsgetCamperName() andcheckJuniorPassport().
    2. Implement the functionaddParkVisited(), which takes in a pointer to aStatePark object as a parameter and adds it to the end of the vectorparksVisited. Additionally, it should use theaddCamper() function to add (a pointer to) itself to thecamperLog of that state park. (Hint: How do you get a pointer to the current object?)

Passport.cpp:

# include "Passport.h"

using std::string, std::vector;

// TODO: implement constructor using member initializer list

string Passport::getCamperName() { // TODO: implement getter

return ""; }

bool Passport::checkJuniorPassport() { // TODO: implement getter

return false; }

void Passport::addParkVisited(StatePark* park) { INFO(park)

// TODO: implement function

return; }

double Passport::getMilesHiked() { // TODO: (optional) implement function

return 0.0; }

int Passport::getHikerLevel() { // TODO: (optional) implement function

return 0; }

Passport.h:

# ifndef _PASSPORT_H # define _PASSPORT_H

# include "StatePark.h"

class Passport { private: std::string camperName; bool isJuniorPassport; std::vector parksVisited; double getMilesHiked();

public: Passport(std::string camperName, bool isJuniorPassport); std::string getCamperName(); bool checkJuniorPassport(); void addParkVisited(StatePark* park); int getHikerLevel();

StatePark* getParkAt(unsigned int i) { return parksVisited.at(i); } };

# endif

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 Programming Questions!