help me please

Discussion in 'C++' started by Herane Abule, Feb 19, 2012.

  1. Herane Abule

    Herane Abule Guest

    I am an Ethiopian and I have a group assignment but I am alone and I
    can't do the following problem.

    The course is programming I

    the question is the following!-

    Required a C++ program that expects user top provide a month and year
    values from the key board. After accepting the program should be able
    to display the full calender to the given month of that year.
    The program should
    1. Validate inputs
    2. Let users to use it as many times as they choose
    3. create in and out properly and e.t.c



    Sample program

    Enter month>>1
    Enter year>> 2009
    Your calendar for January 2009

    Sun Man 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


    Do you want to see for another month/year?>>Y
    Enter month>>2
    Enter year>>2009

    Your calendar for February 2009
    Sun Man Tue Wed Thu Fri
    Sat
    1 2 3 4
    5 6 7
    8 9 10 11 12
    13 14
     
    Herane Abule, Feb 19, 2012
    #1
    1. Advertising

  2. Herane Abule

    osmium Guest

    "Herane Abule" wrote:

    >I am an Ethiopian and I have a group assignment but I am alone and I
    > can't do the following problem.
    >
    > The course is programming I
    >
    > the question is the following!-
    >
    > Required a C++ program that expects user top provide a month and year
    > values from the key board. After accepting the program should be able
    > to display the full calender to the given month of that year.
    > The program should
    > 1. Validate inputs
    > 2. Let users to use it as many times as they choose
    > 3. create in and out properly and e.t.c

    <snip>
    I think a student should approach this differently than a real
    programmer,would. Try to get some positive feedback early on and build up a
    feel for programming and the language. IMO, a good starting point would be
    to write a routine (function) that displays a 31 day calendar that starts on
    Sunday. When you have this working to your satisfaction modify it to start
    on different days (Monday and so on) and then print differing numbers of
    days. Then work on the input from the user and do the leap year stuff next
    to last. Letting the user have several runs would be dead last. This will
    take quite a few hours for a student, don't be dismayed, it's a lot of fun.
    You should have one major goal at all times, but the goal keeps changing.

    None of this written in stone, thus the IMO proviso.
     
    osmium, Feb 19, 2012
    #2
    1. Advertising

  3. Herane Abule

    Jorgen Grahn Guest

    On Sun, 2012-02-19, osmium wrote:
    > "Herane Abule" wrote:
    >
    >>I am an Ethiopian and I have a group assignment but I am alone and I
    >> can't do the following problem.
    >>
    >> The course is programming I
    >>
    >> the question is the following!-
    >>
    >> Required a C++ program that expects user top provide a month and year
    >> values from the key board. After accepting the program should be able
    >> to display the full calender to the given month of that year.
    >> The program should
    >> 1. Validate inputs
    >> 2. Let users to use it as many times as they choose
    >> 3. create in and out properly and e.t.c

    > <snip>
    > I think a student should approach this differently than a real
    > programmer,would. Try to get some positive feedback early on and build up a
    > feel for programming and the language.


    Well, positive feedback early is important for real programmers, too!

    > IMO, a good starting point would be
    > to write a routine (function) that displays a 31 day calendar that starts on
    > Sunday. When you have this working to your satisfaction modify it to start
    > on different days (Monday and so on) and then print differing numbers of
    > days. Then work on the input from the user and do the leap year stuff next
    > to last.


    Agreed.

    It should be noted (especially since the OP is from Ethiopia) that the
    concept of week varies with the culture. The one in the assignment
    seems to be the US version, but it's enough to move to Sweden and you
    have differences (Sunday belongs to the end of the week before).

    > Letting the user have several runs would be dead last.


    A useful real-world program would also not take input that way -- it
    would be much more convenient to have command-line options, like the
    standard Unix command cal(1):

    tuva:~> cal 2 2012
    February 2012
    Su Mo Tu We Th Fr Sa
    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

    There's nothing /wrong/ with assignments which include "please enter a
    number:" prompts, but there are rarely reasons to write such code in
    real life.

    /Jorgen

    --
    // Jorgen Grahn <grahn@ Oo o. . .
    \X/ snipabacken.se> O o .
     
    Jorgen Grahn, Feb 25, 2012
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JC
    Replies:
    4
    Views:
    7,976
    Jeff C
    Jul 8, 2004
  2. Replies:
    4
    Views:
    517
    Chris Uppal
    May 5, 2005
  3. KK
    Replies:
    2
    Views:
    584
    Big Brian
    Oct 14, 2003
  4. MuZZy
    Replies:
    7
    Views:
    1,761
    Mike Hewson
    Jan 7, 2005
  5. mera
    Replies:
    7
    Views:
    1,111
Loading...

Share This Page