Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,102 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,670 people online right now. Registration is fast and FREE... Join Now!




CALENDAR Program

 
Reply to this topicStart new topic

CALENDAR Program

MissyMykie
28 Sep, 2007 - 09:29 AM
Post #1

New D.I.C Head
*

Joined: 27 Sep, 2007
Posts: 13


My Contributions
missymykie..I have so many problems about programming..we do hav many assignments to do and project to be presented. My one assignment is to ceate a CALENDAR program!..i dont have any ideas how to start. I dont know what needs to be done.. blink.gif

The REQUIREMENTS Will be:

1) The user is asked to input the month and year and the program will show the calendar for that input.

E.g.

**********************
** CALENDAR PROGRAM **
**********************

Choose month: January
Enter a year: 2000

SUN MON TUE WED THU FRI SAT
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

2) The limit of the year is up to the capability of the program. Can be from year 1 AD to 1 million AD.

3) The program will terminate only when the user presses ESC key.


[b]....What will I do?...Could someone's willing to help me?.. i Will greatly appreciate your efforts.Thank you![/b]

This post has been edited by MissyMykie: 28 Sep, 2007 - 09:33 AM


Attached File(s)
Attached File  CALENDAR_Table.doc ( 23.5k ) Number of downloads: 92
User is offlineProfile CardPM
+Quote Post

_net
RE: CALENDAR Program
28 Sep, 2007 - 09:36 AM
Post #2

D.I.C Head
**

Joined: 22 Sep, 2007
Posts: 146


My Contributions
Have you started anything? You gotta attempt to do it first.
User is offlineProfile CardPM
+Quote Post

MissyMykie
RE: CALENDAR Program
28 Sep, 2007 - 10:09 AM
Post #3

New D.I.C Head
*

Joined: 27 Sep, 2007
Posts: 13


My Contributions
QUOTE(_net @ 28 Sep, 2007 - 10:36 AM) *

Have you started anything? You gotta attempt to do it first.



MissyMykie

...i only have this code..It will not run!..i dont know why!..Its not the correct code for my assignment..This is only the code that I made still!.. It has an error!..Im using TURBO C!..

I dont know how to begin with my assignment!.. sad.gif



#include<stdio.h>

void printMonth (int startDay, int days);

int main (void)
{
printfMonth(2,29);
return 0;
}

/*======printMonth===========*/

void printMonth (int startDay, int days)

{
int weekDay;
int dayCount = 0;
{
printf("Sun Mon Tue Wed Thu Fri Sat\n");
printf("--- --- --- --- --- --- ---\n");

for (weekDay= 0; weekDay < startDay; weekDay++)
{printf(" ");}

for (int dayCount = 1; dayCount <= days; dayCount++)
{
if (weekDay > 6)
{
printf("\n");
weekDay = 1;
}
else
weekDay++;
printf("%3d", daycount);
}
printf("\n--- --- --- --- --- --- ---\n");
return;
}}
User is offlineProfile CardPM
+Quote Post

mario_dfm
RE: CALENDAR Program
29 Sep, 2007 - 03:56 PM
Post #4

New D.I.C Head
*

Joined: 23 Sep, 2007
Posts: 8


My Contributions
@MissyMykie

I am assuming that we are in the same school. If you want help with the calendar program I already have one and can assist you with your code problems. biggrin.gif


USC-TC FTW!!! icon_up.gif



it seems that you have copied that code you gave from the book...*giggles*

This post has been edited by mario_dfm: 29 Sep, 2007 - 03:58 PM
User is offlineProfile CardPM
+Quote Post

MissyMykie
RE: CALENDAR Program
29 Sep, 2007 - 06:15 PM
Post #5

New D.I.C Head
*

Joined: 27 Sep, 2007
Posts: 13


My Contributions
QUOTE(mario_dfm @ 29 Sep, 2007 - 04:56 PM) *

@MissyMykie

I am assuming that we are in the same school. If you want help with the calendar program I already have one and can assist you with your code problems. biggrin.gif


USC-TC FTW!!! icon_up.gif



it seems that you have copied that code you gave from the book...*giggles*




hI Mario!..i just copied the code from the book because i dont have the idea how to start it..Can you please help me?..Yah!..were in the same school!..help me pls??..Can you teach me how to do our Ass? im tired thinking about this and no one knows how to do it!. sad.gif bigsmile.gif

User is offlineProfile CardPM
+Quote Post

jjhaag
RE: CALENDAR Program
29 Sep, 2007 - 06:48 PM
Post #6

me editor am smartastic
Group Icon

Joined: 18 Sep, 2007
Posts: 1,789



Thanked: 2 times
Dream Kudos: 775
Expert In: C,C++

My Contributions
couple of problems with the above code (these should be spouted out by your compiler)...

typo 1: you call a function printfMonth() in your main() routine...but the function you have defined is printMonth().

typo 2: you output a variable daycount using a printf statement...but the variable you have declared is dayCount. (EDIT: bah...typo of my own - that's a hard one to write)

that should let you compile it, at least.

oh, and you may have to move your int dayCount statement outside of the for loop. not sure about turbo c, but some (older) compilers don't like that - they need to meet the c99 standard for that to be accepted syntax.

-jjh

This post has been edited by jjhaag: 29 Sep, 2007 - 06:56 PM
User is offlineProfile CardPM
+Quote Post

mario_dfm
RE: CALENDAR Program
29 Sep, 2007 - 08:39 PM
Post #7

New D.I.C Head
*

Joined: 23 Sep, 2007
Posts: 8


My Contributions
biggrin.gif ...I just finished making editing my code to fit your needs....gimme your YM ID so we can discuss about the code...
User is offlineProfile CardPM
+Quote Post

MissyMykie
RE: CALENDAR Program
30 Sep, 2007 - 03:34 AM
Post #8

New D.I.C Head
*

Joined: 27 Sep, 2007
Posts: 13


My Contributions
QUOTE
fm' date='29 Sep, 2007 - 09:39 PM' post='261648']
biggrin.gif ...I just finished making editing my code to fit your needs....gimme your YM ID so we can discuss about the code...



....sOry!..Late repLy!., thanks for the effort!..ur my savior!.,hehehe!..anyways, thank you so much!..


my YM Id is mykie_omayao...

...thank you so much!., watz urs?!
User is offlineProfile CardPM
+Quote Post

BaltaX
RE: CALENDAR Program
6 Dec, 2007 - 09:42 AM
Post #9

New D.I.C Head
*

Joined: 6 Dec, 2007
Posts: 6


My Contributions
hahaha... taga tc diay mo..

pre gae kog code nimo sa imo calendar beh.. thanx daan or add me baltax_333@yahoo.com ym ug frenster, thanx
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 08:59PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month