Link to home
Start Free TrialLog in
Avatar of IbanezRG
IbanezRG

asked on

Starting with Classes need help C++

#include <iostream>
#include <string>

using namespace std;

class DayOfTheWeek
{
public:
	void setDay(string );
	void printDay() const;
	string getDay() const;
private:
	string monday, tuesday;
	
};

void DayOfTheWeek::setDay(string mon, string Tues)
{
	monday = Mon
	tuesday = Tues
}

string DayOfTheWeek::getDay() const
{
	return monday;
	return tuesday;
}

void DayOfWeek::printDay()
{
	if (monday < 10)
		cout << "0";
	cout << monday << ":";
	if (tuesday < 10)
		cout << "0";
	cout << tuesday << ":";

int main()
{
	DayofTheWeek myDay;
	DayOfTheWeek newDay;

	myDay.setDay(monday);
	newDay.setDay(tuesday);

	cout << "Printing out monday object value" << endl;
	myDay.printDay();
	cout << endl << endl;

	cout << "Printing out tuesday object value" << endl;
	string firstDay = myDay.getDay();
	cout << firstDay << ":" << newDay.getDay() << ":" << newDay.getDay() << endl;
	
	return 0;

Open in new window

Avatar of Infinity08
Infinity08
Flag of Belgium image

So, what's your question ?
ASKER CERTIFIED SOLUTION
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Also note, I have identified syntax errors but there are plenty of other problems that need to be fixed. I won't correct them for you though; now you have the ability to compile the code you should work through it. We can give you suggestions on what needs improving but as this is a learning experience it is up to you to do the work :)
Avatar of IbanezRG
IbanezRG

ASKER

I will star on it right now.
I need to be really honest, I have all kinds of problems with this programming courses. I am getting my bachelors online and I am not grasping what I need to learn.
I need a tutor, and I need it quick. I need to get this lab done, and on Monday speak with my Academic adviser.
I worked at it and I don't seem to get it.
If someone can help.
>> I worked at it and I don't seem to get it.
Since you have many questions, instead of trying to work on the entire assignment at once, and asking very open-ended question, try writing down a list of basic items that you are having trouble with. Then ask about each item. After putting it all together, you may be able to do this project.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The help wasn't too clear.