Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Please help me I have a very big problem!!

  1. #1
    darkrai is offline Newbie
    Join Date
    Jan 2009
    Posts
    5
    Rep Power
    0

    Unhappy Please help me I have a very big problem!!

    Please help me my teacher gave me this problems:

    1. Create a program that will show the plural form of the input regular nouns.

    example:
    Input a regular noun: church
    The plural form is: churches
    Input a regular noun: tomato
    The plural form is: tomatoes

    2. Create a program when you input it a 4 number will say it as a year(Maximum year is 2009).

    example:
    Input a year:1922
    The year is Nineteen Twenty Two
    Input a year: 2003
    The year is Two thousand three

    3. Create a program that will determine the date of the inputed num and if it is a leap year or not.

    example;
    Enter a year: 2002
    Enter the days: 365
    It is December 31
    Enter a year: 2004
    Enter the days: 365
    It is December 30

    Please help me the deadline is at the 2nd week of March and we can only use arrays,loops and if statements.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,478
    Blog Entries
    75
    Rep Power
    143

    Re: Please help me I have a very big problem!!

    What do you have so far?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    darkrai is offline Newbie
    Join Date
    Jan 2009
    Posts
    5
    Rep Power
    0

    Unhappy Re: Please help me I have a very big problem!!

    as for now I am at the 1/4 of the second problem; I think it is the only problem I can solve.. please will you help me? post the code or sent it to me please I am begging you.

  5. #4
    deer dance's Avatar
    deer dance is offline Learning Programmer
    Join Date
    Feb 2009
    Location
    Indiana
    Posts
    40
    Rep Power
    0

    Re: Please help me I have a very big problem!!

    You could set each character inputted individually, then use if statements to display the words.

    As for the last one, I'm stuck as well.
    Ameteur programmer
    HTML Expert
    Official Lunatic

  6. #5
    Join Date
    Jul 2006
    Posts
    16,478
    Blog Entries
    75
    Rep Power
    143

    Re: Please help me I have a very big problem!!

    1922 % 100 == 19 --> "Nineteen"
    1922 / 100 == 22 --> "twenty two"

    Break your problem into parts.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  7. #6
    FakeRobotGymnast is offline Learning Programmer
    Join Date
    Jan 2009
    Posts
    43
    Rep Power
    12

    Re: Please help me I have a very big problem!!

    1922 % 100 == 22 --> "twenty two"
    1922 / 100 == 19 --> "Ninteen"

    Break your problem into parts.

  8. #7
    Korsicall is offline Newbie
    Join Date
    Apr 2009
    Posts
    15
    Rep Power
    0

    Re: Please help me I have a very big problem!!

    I'm actually curious as to how to do the second problem. If your trying to cover all possible dates, 0001-> end of days, is there a "finesse" way?

  9. #8
    MerakSpielman is offline Learning Programmer
    Join Date
    Jan 2008
    Posts
    44
    Rep Power
    0

    Re: Please help me I have a very big problem!!

    You have to high a high-end number, just so you're not teaching it how to say everything up to a googleplex. But I'd think the "finesse" way would be to break the number into recognizable units. For a general number you'd break it into 3-digit units, just like where you put the commas. For dates, I think going up to just 4 total digits and two 2-digit sections should be sufficient. The first two digits (the ones and tens place) you have to program the numbers from 01 to 19 individually because they don't follow a set pattern, but it gets more elegant (i.e., there's a pattern) once you hit the 20s. The same script could be copied/pasted and tweaked slightly to get the last two digits (the hundreds and thousands place).

  10. #9
    Join Date
    Mar 2009
    Posts
    1,375
    Rep Power
    24

    Re: Please help me I have a very big problem!!

    For determining is-year-leap I would use DateTime class. It has a method for that, System.DateTime.IsLeapYear(int). If you want to implement the code determining it yourself, then look for a Wikipedia article describing what cryteria there are.

    For spelling years I would really suggest using Winged' code with modulo and division (% and /). Then I would use switch statements for numbers but if you cannot use switch then make if counterparts.

    For grammar code I would first look for some Wikipedia article which states what rules there are for making plural forms. I think it's just a matter of String.EndsWith("o") and few similar checks for ending letters.

    If you want more detailed help, you have to show us some concrete code.

  11. #10
    gon1387 is offline Newbie
    Join Date
    Jun 2009
    Posts
    17
    Rep Power
    0

    Re: Please help me I have a very big problem!!

    got any half-done codes?

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. If problem or cout problem?
    By chaoticape in forum C and C++
    Replies: 4
    Last Post: 06-10-2011, 10:29 AM
  2. C: Problem with solving problem
    By rakche in forum C and C++
    Replies: 15
    Last Post: 03-28-2010, 01:24 PM
  3. Replies: 0
    Last Post: 04-26-2007, 05:33 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts