well our dr. gave us this home work annnd i have a problem in calculating the days
soo here's the Q and how i solved it and please tell what's wrong.
-------------------------------------------
#include<iostream>
#include<string>
using namespace std;
{ string daysOfWeek[7]={"sunday", "monday","tuesday","wednesday","thursday","friday","saturday"};
string currentDay;
string decide;
cout<<"If you want to add days, enter 1"<<endl
<<"If you want to subtract days, enter 2"<<endl;
cin>>decide;
if(decide=="1")
{
int add;
cout<<"Enter number of days you want to add"<<endl;
cin>>add;
int Dd;
btw here's the Q
Design and implement a class dayType that implements the day of the
week in a program. The class dayType should store the day, such as Sun
for Sunday. The program should be able to perform the following operations
on an object of type dayType:
a. Set the day.
b. Print the day.
c. Return the day.
d. Return the next day.
e. Return the previous day.
f. Calculate and return the day by adding certain days to the current day.
For example, if the current day is Monday and we add 4 days, the day to
be returned is Friday. Similarly, if today is Tuesday and we add 13 days,
the day to be returned is Monday.
g. Add the appropriate constructors.
well i thought about that, but first i want to make sure that everything is right then i'll change the if statements and thing like this.
my problem is that the calculator is always giving me "Sunday" even if i wanted to add just one day!
this home work should be done tonight :/