Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions