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