-
calendar
I need assistance with source code for a calendar Please review my input and list what is needed
#inclue<iostream.>
void start();
void firstr();
void rest();
void otpt();
int year;startc, count=1,cal [6][7];
void main()
{
cout<<"this is my calendar program."<<endl;
<<"enter any year equal to or greater then 1961:";
cin>>year;
start();
firstr();
rest();
otpt:
}
void start()
{
int diff,ly,tdiff,startc;
diff=year-1961; //(2002-1961)=41 the difference in the years that are the input
ly=int(diff/4); //ly=int(41/4)=(10.25)=10
tdiff=dif+ly; //tdiff=41 + 10=51
startc=tdiff%7; //startc=51 % 7=8 (%=mod=51/7=a remainder of 8.)
}
void firstr()
{
int y;
for (y=startc;y<7y++)
{
cal[0][y]=count
count++;
}
}
void rest()
{
int x,y;
for (x=1;x<6;x++)
for (y=0;y<7;y++)
{
cal[x][y]=count;
count++;
}
}
void otpt()
{
intx,y;
cout<<" jan "<<year<<endl;
cout<<"s"<<\tm"<<"tt:<<\tw"<<\tth"<<"\tf"<<"\ts";
for(x=0;x<6;x++);
{
for(y=0;y<7;Y++);
{
if ((cal[x][y],1)||(cal[x][y]>31))
cout<<" "<<\t";
else
cout<<cal[x][y]<<"\t";
}
}
for(x=0;x<6;x++)
{
for(y=0;y<7;y++)
cout<<cal[x][y]<<"\t";
return 0;
}
cout<<endl;
}
-
to start off with. lots of typos.
Code:
#include <iostream.h>
#include <conio.h>
void start();
void firstr();
void rest();
void otpt();
int year, startc, count=1,cal [6][7];
void main()
{
clrscr();
cout<<"this is my calendar program."<<endl;
cout << "enter any year equal to or greater then 1961:";
cin>>year;
start();
firstr();
rest();
otpt();
getch();
}