x.Hm Solution x.0mlor=\"red\">please rate - thanks use the cin.getline, but you
ID: 3616160 • Letter: X
Question
x.HmExplanation / Answer
x.0mlor="red">please rate - thanks use the cin.getline, but you must also flush the input buffer of any enters that are left in it. I've highlighted the corrections I made #include #include #include #include #include #include #include #include using namespace std; //******************************************************************************** //******************************************************************************** //Class Agenda class Agenda { public: virtual void Print() = 0; }; ///////////////////////////////////************************************************* /// class Notes ///************************************************* ///////////////////////////////////************************************************* class Notes : public Agenda { public: virtual void Print() = 0; }; //******************************************************************************** //******************************************************************************** // class New class New : public Notes { string data; int cut; struct New2 { string when; string event; } cs; public: New(string data, int y); //the constructor of the class, it saves the data input by the user and record if the user input //or not a date for the new event void getsystemdateinstring(string &sytyr3, string &sytmon2, string &sytday, string &syttom); //gets the system date and save the year, month and day in different string variables void splitstring2(string str, string seperater, string &first, string &second); //it's almost the same that splitstring, with a little difference about a space void splitstring(string str, string seperater, string &first, string &second); //takes a separator symbol chosen when you call the function, looks for that symbol in a //string A and when he founds it, he cuts the string in two parts in that point virtual void Print(); // all the functions are called from here to save the new events on the agenda. If the user //inputs a date, the event is saved in that date; otherwise, the event is saved in the day after //the current date (if today is 12/17, the event is saved in 12/18). Finally, it lets the user know //that the saving was successful and in which date was the event saved }; New::New(string dat, int y) { data = dat; cut = y; } void New::Print() { if(data == "NULL") { coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.