Just wanted to get some feedback and see if this program contains the \"basics\"
ID: 3539796 • Letter: J
Question
Just wanted to get some feedback and see if this program contains the "basics" for C++ programming. Any comments or suggestions would be greatly appreciated. Sorry about the length of the post, wasnt sure how to load a project.
/**
* RunRecord.h - Class definition for a run record. This class will be
* a single node in the linked list.
*
*
*
*/
#ifndef _RUN_RECORD_H_
#define _RUN_RECORD_H_
#include <iostream>
#include <string>
using namespace std;
class RunRecord
{
public:
RunRecord();
RunRecord(const RunRecord &runRecord);
~RunRecord();
void setGoal(const string goal);
string getGoal() const;
void setWeather(const string weather);
string getWeather() const;
void setRoute(const string route);
string getRoute() const;
void setDistance(const string distance);
string getDistance() const;
void setTime(const string time);
string getTime() const;
void setDate(const string date);
string getDate() const;
private:
string goal;
string weather;
string route;
string distance;
string time;
string date;
};
#endif
___________________________________________________
/**
* RunRecord.cpp - Class implementation for a run record. This class
* will be a single node in the linked list.
*
*
*
*/
#include "RunRecord.h"
RunRecord::RunRecord()
{
// Currently does nothing ...
}
// Copy constructor
RunRecord::RunRecord(const RunRecord &runRecord)
{
this->goal = runRecord.goal;
this->weather = runRecord.weather;
this->route = runRecord.route;
this->distance = runRecord.distance;
this->time = runRecord.time;
this->date = runRecord.date;
}
RunRecord::~RunRecord()
{
// Currently does nothing ...
}
void RunRecord::setGoal(const string goal)
{
this->goal = goal;
}
string RunRecord::getGoal() const
{
return goal;
}
void RunRecord::setWeather(const string weather)
{
this->weather = weather;
}
string RunRecord::getWeather() const
{
return weather;
}
void RunRecord::setRoute(const string route)
{
this->route = route;
}
string RunRecord::getRoute() const
{
return route;
}
void RunRecord::setDistance(const string distance)
{
this->distance = distance;
}
string RunRecord::getDistance() const
{
return distance;
}
void RunRecord::setTime(string time)
{
this->time = time;
}
string RunRecord::getTime() const
{
return time;
}
void RunRecord::setDate(string date)
{
this->date = date;
}
string RunRecord::getDate() const
{
return date;
}
Explanation / Answer
Just made correction in default case .you have written "cerr" instead of "cout" and rest is fine .It consist all basic thing that a program can have.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.