ight here is my program or what i need my program to do and my frame work its pretty nasty its got lot of gaps but i just need to figure out how to output the ending to this to have the right start day the right num of days and the spaces i need!! I ve been so lost with this program if you can help i d appreciate it!

#include <iostream.h>

jake sanders
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

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.


int get_number_days();
int calculate_blankdays(char startday);
char configure_festival(char festivalmonth);
void report_calendar(int numdays,int blankdays,char festival);

int main() {

int numdays;
char startday;
int blankdays;
char festivalmonth;

cout<<"What day does your month start on?  ";<<endl;
cin>> startday;

cout<<"PLease enter a correct day: "<<endl;
cout<<"Is this month a festival month?
cout<<"Please type n for no and y for yes: "


int  get_number_days() {
int daynum;
cout<<"Invalid.Please type a number greater then 27";
<< but less than 37!: "<<endl;
return daynum;

int  calculate_blankdays(char startday) {
int spaces;
int daynum;
switch: B||b=2


char  configure_festival(char festivalmonth){

int ??;


void report_calendar(int numdays,char blankday,char

blanks for-loop numdays ;
and if festival month spaces carry on.loop til 2nd week maroon
endl, loop again till 4th week maroon then spaceing then carry on looping


yeah those were my thoughts i wanted to try but the spacing and counting really messed me up!

Edited by happygeek: fixed formatting

12 Years
Discussion Span
Last Post by 1o0oBhP

there might be a slight problem. If each month is to start on a particular day then depending on how many days in a month you might 'miss' days as it skips from OrangeDay on the last day of a month to, say, GreenDay (our hypothetical starting day) when the next month starts.

Ieally you should have 36 days in a month, not a range, as this is a multiple of 9 (you have 9 colour days in a 'colour week') so you wont skip any days when the month changes :)
and for the festival why not input a NUMBER to signify what month after the start of a calendar year it begins on, it seems to make more sense....

if you implemented the two above you could input an exact date as two numbers (day,month) and then when [(month*36) + day] days have passed from the calendar year start you have reached that date!

if you like i will take a break for a few hours and code the lot but i would like you to try first. for the ending you will need a few more params defining how big the calendar is ect... the easiest output is to have a square array for the table or draw it on a window.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.