+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 19

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

  1. #1
    Newbie darkrai is an unknown quantity at this point
    Join Date
    Jan 2009
    Posts
    5

    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. #2
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,673
    Blog Entries
    57

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

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

  3. #3
    Newbie darkrai is an unknown quantity at this point
    Join Date
    Jan 2009
    Posts
    5

    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.

  4. #4
    Learning Programmer deer dance is an unknown quantity at this point deer dance's Avatar
    Join Date
    Feb 2009
    Location
    Indiana
    Age
    16
    Posts
    33

    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

  5. #5
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,673
    Blog Entries
    57

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

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

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

  6. #6
    Learning Programmer FakeRobotGymnast is on a distinguished road
    Join Date
    Jan 2009
    Posts
    44

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

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

    Break your problem into parts.

  7. #7
    Newbie Korsicall is an unknown quantity at this point
    Join Date
    Apr 2009
    Posts
    15

    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?

  8. #8
    Learning Programmer MerakSpielman is an unknown quantity at this point
    Join Date
    Jan 2008
    Posts
    44

    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).

  9. #9
    Guru ArekBulski is just really nice ArekBulski is just really nice ArekBulski is just really nice ArekBulski is just really nice ArekBulski is just really nice ArekBulski's Avatar
    Join Date
    Mar 2009
    Posts
    1,374

    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.

  10. #10
    Newbie gon1387 is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    5

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

    got any half-done codes?

+ Reply to Thread
Page 1 of 2
1 2 LastLast

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. X Y Z problem
    By Disc339 in forum General Programming
    Replies: 4
    Last Post: 01-15-2009, 09:39 AM
  2. Peculiar UI Problem Needs Tackling
    By adriyel in forum C# Programming
    Replies: 2
    Last Post: 04-06-2008, 07:46 AM
  3. Problem read pwd protected Access2K dbase - CR9 & VB6
    By mrbar in forum Visual Basic Programming
    Replies: 2
    Last Post: 03-10-2008, 04:50 AM
  4. How to tackle a programming problem?
    By TcM in forum General Programming
    Replies: 10
    Last Post: 01-07-2008, 11:29 AM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

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