2 Replies - 2406 Views - Last Post: 04 September 2010 - 01:29 PM Rate Topic: -----

#1 Jigokuchi  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 18
  • Joined: 30-May 10

Program Title: The Days of the Week

Posted 04 September 2010 - 12:28 PM

Write a program that contains a class that implements the days of the week. The program should be able to perform the following on an object of the class.

Set the day
Print the day to the computer monitor (not the printer)
Return the day

This is what i have so far

HEADER
#include <string>
using std::string;
class DayOfTheWeek
{
private:
	string day;
	string hour;

public:
	void SetDay(string, string);
	void PrintDay();
	string GetDay();
};


MAIN
#include <string>
#include "DayOfTheWeek.h"

using namespace std;

int Main()
{

}

void DayOfTheWeek::SetDay(string day, string hour)
{
	string Monday = "mon";
	string Tuesday = "tues";
	string Wednesday = "wed";
	string Thursday = "thurs";
	string Friday = "fri"; 
	string Saturday = "sat";
	string Sunday = "sun"; 
}
void DayOfTheWeek::PrintDay()
{ 
	cout << "Day: " << day << endl;
	cout << "Hour: " << hour << endl;
}

string DayOfTheWeek::GetDay()
{

}


Im not quite sure where to go from here. can someone help me with what i should do next

This post has been edited by Jigokuchi: 04 September 2010 - 12:50 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Program Title: The Days of the Week

#2 Suryc  Icon User is offline

  • D.I.C Head

Reputation: 9
  • View blog
  • Posts: 105
  • Joined: 15-August 10

Re: Program Title: The Days of the Week

Posted 04 September 2010 - 12:42 PM

View PostJigokuchi, on 04 September 2010 - 11:28 AM, said:

void Main()


Seeing as I don't know exactly what you want, I can give this advice. Don't use void Main(); instead, use int main();

Here's why.

This post has been edited by Suryc: 04 September 2010 - 12:45 PM

Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6039
  • View blog
  • Posts: 23,437
  • Joined: 23-August 08

Re: Program Title: The Days of the Week

Posted 04 September 2010 - 01:29 PM

This is asked EVERY SEMESTER. Perhaps a search of the forum might be helpful.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1