954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

help compiling

im having the hardest time with this problem it doesnt like my do while loop it doesnt want to do my loop for spacing and doesnt want to do my day pacing with the if else breaks!
#include

/*
jake sanders
CS115-001
fall 2004
Programing Assignment 3

Program Description:

My program will be able to make a calendar for a
mythical country by asking the user for the number of days
in the month and the day the month begins on. The calendar
outputted will be made up in columns ands rows like you
would see in most common day calendars are.

Program Preconditions:

Input starting day as a letter, which should be
either R,r,B,b,G,g,Y,y,P,p,M,m,O,o,T,t,S,or s, this
representing the colordays Redday,Blueday,Greenday,
Yellowday,Purpleday,Maroonday,Orangeday,Tanday, and
Silverday.

The number of days in the month must be a number
between 27 and 37.

The input of festival month should be entered
either as Y or y for Yes it is a festival month, or N
or n stating NO its not a festival month.

Program Post-conditions:

The output of this program will be a calendar
arranged in columns and in rows making the first row the
days of the week abd the column showing which day of the
month will that day will land on. The calendar will have
27-37 days on it and have 9 days named after colors.

Fesival month- If you choose the month to be a
festival month then the calendar will be outputted
like any other month but 4 days,Maroonday-Silverday,
at the end of the week will not be counted because they
take a break from work and rest during festival month.

*/
char get_start_day();
int get_number_days();
char ask_festival();
int get_blanknum(char startday);
void report_calendar(int numdays,char
festival,char startday,int blanknum);



int main() {

int numdays;
char startday;
char festivalmonth;
int blanknum;
//do
//{
startday=get_start_day();
numdays=get_number_days();
festivalmonth=ask_festival();
blanknum=get_blanknum(startday);
report_calendar(numdays,festivalmonth,startday,blanknum);


char get_start_day(){
char startday;
cout<<"What day does your month start on? "<> startday;

while((startday!='r')&&(startday!='R')&&(startday!='G')&&
(startday!='g')&&(startday!='B')&&(startday!='b')&&
(startday!='s')&&(startday!='S')&&(startday!='T')&&
(startday!='t')&&(startday!='O')&&(startday!='o')&&
(startday!='Y')&&(startday!='y')&&(startday!='M') &&
(startday!='m')&&(startday!='P')&&(startday!='p')){
cout<<"PLease enter a correct day: "<>startday;
}
return startday;
}

char ask_festival(){
char festivalmonth;
cout<<"Is this month a festival month?";
cin>>festivalmonth;

while((festivalmonth!='N')&&(festivalmonth!='n')&&
(festivalmonth!='y')&&(festivalmonth!='Y')){
cout<<"Invailid entry please enter n for no or yes"
<< "for yes this is a festival month: "<>festivalmonth;
}
return festivalmonth;

}

int get_number_days() {
int daynum;
cout<<"Enter the number of days in your month (27-37): "
<>daynum;

while((daynum<27)||(daynum>37)){
cout<<"Invalid.Please type a number greater then 27"
<<" but less than 37!: "<>daynum;}
return daynum;
}



int get_blanknum(char startday){
int fnum;
switch(startday){
case 'R':
case 'r':
fnum=0;
break;
case 'B':
case 'b':
fnum=3;
break;
case 'G':
case 'g':
fnum=6;
break;
case 'Y':
case 'y':
fnum=9;
break;
case 'P':
case 'p':
fnum=12;
break;
case 'M':
case 'm':
fnum=15;
break;
case 'O':
case 'o':
fnum=18;
break;
case 'T':
case 't':
fnum=21;
break;
case 'S':
case 's':
fnum=24;
break;
}
return fnum;
}



void report_calendar(int numdays,char festivalmonth,
char startday,int blanknum){

cout<<"numdays "<< numdays<=numdays;i++){
cout<<" "<<'i'<>doagain;
while((doagain!='N')&&(doagain!='n')&&(doagain!='Y')&&
(doagain!='y')){
cout<<"Invailid. PLease choose Y or N: "<>doagain;

//}when((doagain!='N')&&(doagain!='n'));
}
}

please help!

sherbertmonkey
Newbie Poster
4 posts since Dec 2004
Reputation Points: 10
Solved Threads: 0
 

i thing i saw why do u use the upper case and lower caselike for R,r etc... make it simpler!!!!but wat u can do is that use either lower case only or uppercase only. this i amm sure wont solve the problema as a whole but will certainly help to reduce considerably the anount of mistakes ihncurred

anastacia
Junior Poster
142 posts since Nov 2004
Reputation Points: 11
Solved Threads: 1
 

r u using 2 dimensional matices????????

anastacia
Junior Poster
142 posts since Nov 2004
Reputation Points: 11
Solved Threads: 1
 

hello are you the same person who asked for help with the calendar a while back? technically according to the forum announcment i couldnt really post anything as you didnt post any code but i went ahead anyway as i had a bit of spare time. Did you get it working as i created a class to manage the calendar and got a system working...?

1o0oBhP
Posting Pro in Training
445 posts since Dec 2004
Reputation Points: 16
Solved Threads: 6
 

yup. the rioght track

anastacia
Junior Poster
142 posts since Nov 2004
Reputation Points: 11
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You