I have an assignment due, and I am completely lost. I haven't taken C++ in years and now I am having to learn it in OOP, and though I remember some things, there is a lot I do not, and I am a total noob so still trying to learn. But what I am trying to do is write a program that has the user enter a day, and then uses that data to add one day to it, subtract one day too it, and then have the user enter a number, and take that number and add it to the day giving you what day it would be. I have gotten this far, but am stuck. I have no idea how I am supposed to add or subtract from a string array to get the days. Please Help!!!!!
Code:#ifndef DOW_H #define DOW_H #include<string> using namespace std; class Dow { private: string day; public: Dow(string); void setDay(string); string getDay( ); void printDay( ) const; void plusOneDay( ); string minusOneDay( ); string addDay( ); }; Dow::Dow(string Day) { day = Day; }; void Dow::setDay(string Day) { day = Day; } string Dow::getDay( ) { return day; } void Dow::plusOneDay( ) { } #endif _____________________________________________________________________ #include<iostream> #include<string> #include "Dow.h" using namespace std; void main( ) { Dow myDay[7] = {"Sunday", "Monday","Tuesday","Wednesday", "Thursday","Friday","Saturday"}; system("pause"); }



LinkBack URL
About LinkBacks


