Results 1 to 7 of 7

Thread: hey guys.. help plz

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Posts
    2

    hey guys.. help plz

    hey guys help me with this problem please


    Problem DateChecker
    Write a use case diagram and a C# console program called DateCheck that determines whether a calendar date is valid. For example, the date 30-02-2006 (in the form DD-MM-YYYY) is not correct because there will only be 28 days in February, 2006. Your program will accept a day and month and a year from the user and report to the user whether that date is valid.



    Assistance:
    • A year is a leap year if:
    o the year is divisible by 400, OR…
    o the year is divisible by 4 AND the year is NOT divisible by 100

    Tips:
    • The trick to solving this problem is to break the problem into pieces and solve each piece, one at a time. For example, you could add the following features to your program one at a time and test each one before adding the next one.
    o Display a title using an Intro() method
    o Obtain a single date from the user using an InputDate() method
    o Verify the year only by adding a ValidYear() method and display message like ”That date is okay!” or “That date does NOT exist” for the user.
    o Add month verification using ValidMonth().
    o Add day of month verification using ValidDayr() assuming that February ALWAYS has 28 days.
    o Now modify ValidDay() to handle leap years too using the algorithm provided under “Assistance”.! Note that if you never get to this step you’ll only lose 2 marks on the project!



    Your program must be modular making use of methods in the following way:
    • A method called Intro() that has NO return value and merely displays the title.
    • A method called InputDate() that is called from your Main method and that will obtain and return the day, month and year entered by the user
    • A method called ValidYear() that returns a value that indicates whether the year is valid. For this program assume that any 4-digit year is acceptable (1000 to 9999 inclusive) and all other values are not.
    • A method called ValidMonth() that returns a value that indicates whether the month is valid. Of course a valid month can be any integer in the range of 1 to 12 inclusive.
    • A method called ValidDay() that returns a value that indicates whether the day is valid. The day must be ≥ 1 and ≤the maximum day for that month. Note that the months January (01), March (03), May (05), July (07), August (08), October (10) and December (12) each have 31 days. April (04), June (06), September (09) and November (11) each have 30 days. February (02) usually has 28 days except in leap years when it has 29 days. For full marks this method should use a ‘switch’ statement!
    • You must incorporate at least one method (it could be one of the above) that passes its parameters by reference!

    **** Plz of the experts in here to help me with sucha probelm, i no oit might be something big to do, but plz do it for me, and i'll aporeciable , and thx alot guys***
    Last edited by m7md; Nov 12th, 2005 at 08:05 PM.

  2. #2
    Frenzied Member conipto's Avatar
    Join Date
    Jun 2005
    Location
    Chicago
    Posts
    1,175

    Re: hey guys.. help plz

    This should be in the C# Forum, the codebank is for finished or nearly finished code that might be usefull to others.

    Bill
    Hate Adobe Acrobat? My Codebank Sumbissions - Easy CodeDom Expression evaluator: (VB / C# ) -- C# Scrolling Text Display

    I Like to code when drunk. Don't say you weren't warned.

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: hey guys.. help plz

    Moved
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: hey guys.. help plz

    The general consensus around here is that people should only be helped with assignments if they are having specific issues with parts of there code or they are stuck as to how to proceed with something specific. You've just posted your assignment instructions and that's it. No effort on your part means no help from us. Make a start and then post the code that you're having trouble with if you run into problems, but we're not going to do your homework for you.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: hey guys.. help plz

    The assignment details are a load of rubbish. Validating a date should be a short simple function, not a whole lot of one liners that they have described above.

    Your program must be modular making use of methods
    What they describe is 'functional' not modular and in any case you cannot do pure functional programming in C# - C# is a completely OO language. I suppose that they want you to chuck all methods into one class, but even a class seems like too much overhead for such a simple task.

    Stating that for full marks you should use a switch() statement is ridiculous - the best way involves as little branching as possible and you should be marked only on the effectiveness and efficiency of your method, not what constructs you use. In any case validating the number of days in a month can be achieved purely mathematically - there is absolutely no need for a switch() construct.

    You must incorporate at least one method (it could be one of the above) that passes its parameters by reference!
    Why? What a pointless requirement.

    The whole thing stinks, homework or no homework.

    Anyway, m7md - do you know any C#? If so at least make an attempt at this, and we'll help if you get stuck. If not, I suggest you go back to your textbooks and have a think about how to tackle it... we can't teach you from scratch

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: hey guys.. help plz

    Like a great many teaching exercises, this one is pretty pointless in many ways. This could all be done in a couple of lines using the Calendar class, but then what would be the teaching value? I'm sure it's just to show that you understand and can put to use various concepts code structures, rather than to really create anything useful.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: hey guys.. help plz

    Yeah true - well the next exercise should be: make your code as short as possible by REMOVING the constructs... then you'll really be programming

Posting Permissions

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



Click Here to Expand Forum to Full Width