498591 add days of the week

Tamamlanmış İlan edilme: May 15, 2011 Teslim sırasında ödenir
Tamamlanmış Teslim sırasında ödenir

I have an assignment due today and I'm so rusty at programming and had a week from hell, that i havent even had time to read the new chapter and get started on my lab. I need help asap. here's what i need:

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.

1. Set the day.

2. Print the day.

3. Return the day.

4. Return the next day.

5. Return the previous day.

6. Calculate and return the day by adding a certain amount of days to the current day. For example, if you add five days to Saturday, the day to be returned is Thursday. Likewise, if we add 12 days to Wednesday, the day returned will be Monday.

1. Expand the member functions of iLab 1 to allow for the additional operations outlined in the lab summary above.

2. Call the additional functions, plusOneDay(), minusOneDay(), and addDays().

Function plusOneDay() returns the next day.

Function minusOneDay() returns the previous day.

Function addDays() will take the number of additional days as a parameter and calculate and return a new day name by adding a certain amount of days to the current day.

This is what i have from my previous assignment:

#include <iostream>

#include <string>

using namespace std;

class DayOfTheWeek

{

public:

void setDay(string );

// setDay(string) takes a string parameter

// and stores the value in the day attribute.

void printDay() const;

// printDay() prints the value of the day attribute

// on console output (cout).

string getDay() const;

// returns the value of the day attribute.

void plusOneDay();

void minusOneDay();

void addDays();

private:

string day; // This is where the value of the day attribute is stored.

};

string DayOfTheWeek::getDay() const

{

return day;

}

void DayOfTheWeek::setDay(string newDay)

{

day = newDay;

}

void DayOfTheWeek::printDay() const

{

cout << day;

}

void DayOfTheWeek::plusOneDay()

{

}

int main()

{

DayOfTheWeek monday;

DayOfTheWeek tuesday;

// Set the values of the objects

[url removed, login to view]("Monday");

[url removed, login to view]("Tuesday");

// Get the monday object and print it out

string currentDay = [url removed, login to view]();

cout << "The value of the object is " << currentDay << ". This object wishes it was Sunday!" << endl;

// Print the tuesday object

cout << "The value of the object is ";

[url removed, login to view]();

cout << ". This object is just glad it's not Monday!" << endl;

return 0;

}

Odd Jobs PHP

Proje NO: #2244511

Proje hakkında

1 teklif Uzak proje Aktif Jul 11, 2012

Seçilen:

edogsl

thanks so much~!

%selectedBids___i_period_sub_7% gün içinde 18%project_currencyDetails_sign_sub_9% %project_currencyDetails_code_sub_10%
(10 Değerlendirme)
3.8